4 ms·
1. You should be profiling. If this is your bottleneck, then consider tricks like this, or write that loop in C. This is probably not your bottleneck. 2. This
by koenigdavidmj 14y ago
1. You should be profiling. If this is your bottleneck, then consider tricks like this, or write that loop in C. This is probably not your bottleneck.
2. This is very interpreter-dependent. Any JIT worth its salt (like, say, PyPy) would probably decide to inline the append code if we're in this loop long enough for it to matter.