Message290620
The change is an optimization, so it requires a benchmark, think you provided. Ok. But the speedup is a few nanoseconds on a function which takes currently 40 nanoseconds. It's not really what I would call significant:
$ ./python -m perf compare_to ref.json patch.json --table
+---------------------+---------+-----------------------------+
| Benchmark | ref | patch |
+=====================+=========+=============================+
| int==float 8 digits | 39.2 ns | 37.9 ns: 1.03x faster (-3%) |
+---------------------+---------+-----------------------------+
| int==float 1 digit | 38.0 ns | 37.9 ns: 1.00x faster (-0%) |
+---------------------+---------+-----------------------------+
| int.bit_length() | 42.0 ns | 41.2 ns: 1.02x faster (-2%) |
+---------------------+---------+-----------------------------+
(See attached bench_bit_length.py script.)
So I'm not really convinced that the change is useful. Is bit_length() used in hot loops? |
|
Date |
User |
Action |
Args |
2017-03-27 15:36:58 | vstinner | set | recipients:
+ vstinner, mark.dickinson, serhiy.storchaka, niklasf |
2017-03-27 15:36:58 | vstinner | set | messageid: <1490629018.88.0.958157217238.issue29782@psf.upfronthosting.co.za> |
2017-03-27 15:36:58 | vstinner | link | issue29782 messages |
2017-03-27 15:36:58 | vstinner | create | |
|