| That's not a million sequential memory accesses. Assuming a fairly naive python interpreter, it involves - Parsing a million lines of code - Outputting bytecode for a million lines of code - Running a million of lines of bytecode, including - Allocating a million int objects (ints are heap allocated in python) - Hashing a million identifiers - Putting those million identifiers into a hashmap, each pointing to the corresponding into object - Deallocating those million int object Plus VM/Interpreter startup/shutdown. But we can benchmark that by running an empty python file and it's not significant. |