Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
Closed
Description
Feature or enhancement
The pythonrange object contains code to compute the length from the start, stop and step values. This calculation is performed withPyLong objects which is expensive. We can add a fast path for the common case where start, stop and step all fit into a long value.
Pitch
Benchmark results are in the PR.
The range object itself is often converted to a range iterator. For the iterator object there already is a fast version (the the methodfast_range_iter). A further optimization could be achieved by creating a specialized range object that can construct the fast range iterator without conversions toPyLong, but this is much more involved.