Stefan Krah <ste...@bytereef.org> added the comment: On Fri, Jan 26, 2018 at 11:11:00PM +0000, STINNER Victor wrote: > vstinner@apu$ ./python -m perf compare_to master.json pr5278.json > Mean +- std dev: [master] 1.86 us +- 0.03 us -> [pr5278] 2.27 us +- 0.04 us: > 1.22x slower (+22%) > > Note: master is the commit 29a7df78277447cf6b898dfa0b1b42f8da7abc0c and I > rebased PR 5278 on top on this commit.
Thank you and Elvis for running the benchmarks. Yes, the exact version does seem important -- I have been getting some differences based on the checkout. > This is obvious the *worst* case: a *micro* benchmark using local contexts > and modifying this local context. In this case, I understand that this > microbenchmark basically measures the overhead of contextvars on modying a > context. > > The question here is if the bottleneck of applications using decimal is the > code modifying the context or the code computing numbers (a+b, a*b, a/b, > etc.). Yes, that's the big question. In the generator discussions people were advised to use "with" whenever possible, so I assume short blocks *will* be used. I would use the context functions, which would not require PEP-567 at all. This means that I'm somewhat okay with excessive with-statements being a bit slower. > vstinner@apu$ ./python -m perf compare_to telco_master.json telco_pr5278.json > -v > Mean +- std dev: [telco_master] 10.7 ms +- 0.4 ms -> [telco_pr5278] 10.7 ms > +- 0.4 ms: 1.00x faster (-0%) > Not significant! Okay. In my above reference to telco, I ran the "telco.py full" command from http://www.bytereef.org/mpdecimal/quickstart.html#telco-benchmark . The numbers I posted weren't cooked, but I have a hard time reproducing them myself now consistently with the latest revisions, so let's declare telco.py and bench.py a tie. This means that I no longer have any objections, so Yury, please go ahead and merge the PR! Stefan Krah ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue32630> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com