R
Robin Becker
Does using the decimal module incur a penalty because it imports threading or do
I have to actually start a thread?
I have to actually start a thread?
Does using the decimal module incur a penalty because it imports threading or do
I have to actually start a thread?
There is at least one threading-related performance penalty that
doesn't involve the user actually starting a thread: any arithmetic
operation without an explicitly specified context (e.g., as invoked by
one of the standard arithmetic operators) has to make a call to
threading.local() to look up the current (thread-local) context.
I don't know offhand whether this penalty is significant for the
Python version of decimal, though it definitely *is* significant for
decimal-in-C rewrite that's in the works: it would be interesting to
do some timings against a thread-unaware version of decimal.py.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.