[issue15722] PEP 3121, 384 Refactoring applied to decimal module

2014-10-14 Thread Stefan Krah
Stefan Krah added the comment: I would like to reject this until either the performance problems are solved or someone actually uses _decimal in multiple interpreters. If you do, you get tons of warnings about libmpdec being reinitialized, so I suspect no one has ever done that in Python 3.3+ (I

[issue15722] PEP 3121, 384 Refactoring applied to decimal module

2014-07-11 Thread Stefan Krah
Stefan Krah added the comment: Sorry Robin, I was wrong about the context -- it should be fine since it's thread-local. So the slowdown is back to 25%. -- ___ Python tracker ___

[issue15722] PEP 3121, 384 Refactoring applied to decimal module

2014-07-03 Thread Stefan Krah
Stefan Krah added the comment: Yes, python-ideas is probably better. -- I just noticed that the total slowdown is even 40% if the global variable "cached_context" is also placed into the module state (as it should). -- ___ Python tracker

[issue15722] PEP 3121, 384 Refactoring applied to decimal module

2014-07-03 Thread Ezio Melotti
Ezio Melotti added the comment: This sounds like a question for python-dev (or perhaps python-ideas). -- ___ Python tracker ___ ___ Py

[issue15722] PEP 3121, 384 Refactoring applied to decimal module

2014-07-02 Thread Stefan Krah
Stefan Krah added the comment: In order to avoid the significant slowdown: Could we create a new kind of method (METH_STATE) and change ceval to pass a state struct that contains the thread and the module state as the first parameter if the METH_STATE flag is present? -- __

[issue15722] PEP 3121, 384 Refactoring applied to decimal module

2012-11-08 Thread Robin Schreiber
Changes by Robin Schreiber : -- keywords: +pep3121 -patch ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http:

[issue15722] PEP 3121, 384 Refactoring applied to decimal module

2012-08-19 Thread Stefan Krah
Stefan Krah added the comment: > What specific decimal test is failing? # Attributes cannot be deleted for attr in ['prec', 'Emax', 'Emin', 'rounding', 'capitals', 'clamp', 'flags', 'traps']: self.assertRaises(AttributeError, c.__delattr__, attr) test test_decimal f

[issue15722] PEP 3121, 384 Refactoring applied to decimal module

2012-08-19 Thread Martin v . Löwis
Martin v. Löwis added the comment: hackcheck fixes the "Carlo Verry hack", which goes like this: py> object.__setattr__(str, 'lower', str.upper) py> 'dammit Carlo!'.lower() 'DAMMIT CARLO!' (from http://bugs.jython.org/issue1058) It shouldn't be possible to monkey-patch a builtin type; I believe

[issue15722] PEP 3121, 384 Refactoring applied to decimal module

2012-08-19 Thread Stefan Krah
Stefan Krah added the comment: The test suite is not a good benchmark: it also tests decimal.py. For numerical performance I'm running: cd Modules/_decimal/tests ../../../python bench.py You can hit Ctrl-C after the first cdecimal result, since that's usually already a pretty good indicator

[issue15722] PEP 3121, 384 Refactoring applied to decimal module

2012-08-18 Thread Robin Schreiber
Robin Schreiber added the comment: I have removed some redundant modulestate lookups and the testsuite now executes the decimal tests as fast as before the patch is applied. (at least for me). May I ask how you tested the decimal performance? Regarding the failing test: It appears that the hac

[issue15722] PEP 3121, 384 Refactoring applied to decimal module

2012-08-18 Thread Antoine Pitrou
Antoine Pitrou added the comment: > 2) The patch slows down _decimal by 25% (!). Ouch. That's an interesting observation, because I guess other modules could be affected as well. Robin, can you please take care that other modules don't have significant performance regressions after your work?

[issue15722] PEP 3121, 384 Refactoring applied to decimal module

2012-08-18 Thread Stefan Krah
Changes by Stefan Krah : -- assignee: -> skrah ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyt

[issue15722] PEP 3121, 384 Refactoring applied to decimal module

2012-08-18 Thread Stefan Krah
Stefan Krah added the comment: Thank you for the patch and the big amount of work that you are doing on so many modules! I'm afraid though that the patch is not acceptable in its current state: 1) The unit tests do not pass. This could be fixed. 2) The patch slows down _decimal by 25%

[issue15722] PEP 3121, 384 Refactoring applied to decimal module

2012-08-18 Thread Robin Schreiber
Changes by Robin Schreiber : -- components: +Extension Modules -Regular Expressions ___ Python tracker ___ ___ Python-bugs-list mailin

[issue15722] PEP 3121, 384 Refactoring applied to decimal module

2012-08-18 Thread Robin Schreiber
New submission from Robin Schreiber: Changes proposed in PEP3121 and PEP384 have now been applied to the decimal module! -- components: Regular Expressions files: _decimal_pep3121-384_v0.patch keywords: patch messages: 168511 nosy: Robin.Schreiber, ezio.melotti, mrabarnett, skrah priori