A programmer writes the same program in a low-level language and in a high-level language.
Explain one reason why the program written in the low-level language may run faster.
Mark scheme
Award up to two marks for a linked explanation such as:
- The programmer can choose the most efficient instructions/registers to use (1) so the program completes its task in fewer steps (1)
- The programmer can optimise the code for the processor (1) because low-level instructions give direct control of registers/memory (1)
- Each low-level instruction maps to one machine code instruction (1) so fewer instructions are executed than for the equivalent high-level code (1)
- The translated code is smaller (1) so fewer instructions are fetched from memory and executed (1)
For both marks, the expansion must follow/associate with the statement.
Do not accept 'it is low-level' / 'it is closer to machine code' / 'low-level code is faster' on its own without a reason why it makes the program run faster.
Do not accept 'high-level code has to be translated' / 'high-level code is interpreted' on its own without saying why that makes the program slower.
Do not accept 'the code is smaller' on its own without saying that this means fewer instructions are fetched/executed.
Do not accept 'it is easier to write' or 'quicker to type' as a reason for faster execution.
Example answers and how they were marked
The programmer can choose the most efficient instructions and registers to use (1) so the program completes its task in fewer steps (1).
Why: Linked point (1) of choosing efficient instructions/registers and reason (1) that the task is completed in fewer steps, so it runs faster.
Each low-level instruction maps to one machine code instruction (1) so the program is shorter to type.
Why: Point (1) that one low-level instruction maps to one machine code instruction, but being shorter to type does not explain why the program runs faster, so no second mark.
Because it is closer to machine code.
Why: 'Closer to machine code' alone gives no reason why that makes the program run faster, and the mark scheme does not accept it on its own.