3 ms·
Automatic Reference Counting, i.e. garbage collection. That's why the timer wouldn't attribute the CPU time to the line you mention; the GC cleans the structure
by dom0 9y ago
Automatic Reference Counting, i.e. garbage collection. That's why the timer wouldn't attribute the CPU time to the line you mention; the GC cleans the structure up when the "x" goes out of scope, so after the timing has ended.
- eesmith 9y agoThanks. No, it's not due to reference counting, at least, not according to the tracker issue which reports this oddity. Add: import os os._exit(0) to the bottom of the code and it still takes a minute to run, even though there's no final garbage collection. Also, that code creates only a few hundred objects, and the 'x' data structure is acyclic.