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/2009-October/093071.html below:

[Python-Dev] SIGCHECK() in longobject.c

[Python-Dev] SIGCHECK() in longobject.c [Python-Dev] SIGCHECK() in longobject.cAntoine Pitrou solipsis at pitrou.net
Sun Oct 18 22:01:54 CEST 2009
Hello,

In Objects/longobject.c, there's the SIGCHECK() macro which periodically checks
for signals when doing long integer computations (divisions, multiplications).
It does so by messing with the _Py_Ticker variable.

It was added in 1991 under the title "Many small changes", and I suppose it was
useful back then.

However, nowadays long objects are ridiculously fast, witness for example:

$ ./py3k/python -m timeit -s "a=eval('3'*10000+'5');b=eval('8'*6000+'7')"
"str(a//b)"
1000 loops, best of 3: 1.47 msec per loop

Can we remove this check, or are there people doing million-digits calculations
they want to interrupt using Control-C ?

Regards

Antoine.


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