A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2006-October/069156.html below:

[Python-Dev] Caching float(0.0)

[Python-Dev] Caching float(0.0) [Python-Dev] Caching float(0.0)"Martin v. Löwis" martin at v.loewis.de
Tue Oct 3 14:25:38 CEST 2006
Nick Craig-Wood schrieb:
> Even if 0.0 is allocated and de-allocated 10,000 times in a row, there
> would be no memory savings by caching its value.
> 
> However there would be
> a) less allocator overhead - allocation objects is relatively expensive
> b) better caching of the value
> c) less cache thrashing
> 
> I think you'll find that even in the no memory saving case a few
> cycles spent on comparison with 0.0 (or maybe a few other values) will
> speed up programs.

Can you demonstrate that speedup?

It is quite difficult to anticipate the performance impact of a change,
in particular if there is no change in computational complexity. Various
effects tend to balance out each other.

Regards,
Martin
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4