On Thu, 31 Aug 2017 23:35:34 +0000
"Manciu, Catalin Gabriel" <catalin.gabriel.man...@intel.com> wrote:
> 
> The focus of this experiment was inplace adds in general. While, as you've
> shown, there are ways to write the loop optimally, the benchmark was written
> as a huge loop just to showcase that there is an improvement using this
> approach. The performance improvement is a result of not having to
> allocate/deallocate a PyLong per iteration.
> 
> A huge Python program with lots of PyLong inplace operations (not just
> adds, this can be applied to all PyLong inplace operations), regardless of 
> them
> being in a loop or not, might benefit from such an optimization.

I'm skeptical there are some programs out there that are limited by the
speed of PyLong inplace additions.  Even if you have a bigint-intensive
workload (say public-key cryptography, not that it's specifically a
good idea to do so in pure Python), chances are it's spending much of
its time in more sophisticated operations such as multiplication, power
or division.

In other words, while your experiment has intellectual and educational
interest, I don't think it shows the path to a useful optimization.

Regards

Antoine.


_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to