3 ms·
For me, range (the posted source) took 95 seconds, and xrange was only a little better at 85 seconds. I think most of the benefit of xrange comes from the decr
by 0942v8653 11y ago
For me, range (the posted source) took 95 seconds, and xrange was only a little better at 85 seconds.
I think most of the benefit of xrange comes from the decreased memory usage, not from lower CPU usage. But xrange is definitely closer to what the other code is doing.
- dekhn 11y agothat's almost a 10% improvement- not just a little better!