On Sun, Oct 18, 2009 at 9:01 PM, Antoine Pitrou <solip...@pitrou.net> wrote:
> 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 ? Yes, I suspect there are. Though you don't need millions of digits for a single operation to take a noticeable amount of time: try str(10**100000), for example. Is there a benefit to removing the check? Mark _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com