Antoine Pitrou <[EMAIL PROTECTED]> added the comment: Le samedi 21 juin 2008 à 16:40 +0000, sebastian serrano a écrit : > sebastian serrano <[EMAIL PROTECTED]> added the comment: > > Running with python -O the timing gets a little closer between Lock and > RLock. This code won't be easy to improve in performance. > The heaviest call is current_thread(), used at lines: > 117: me = current_thread() > 137: if self.__owner is not current_thread():
One could always try to rewrite RLock by replacing calls to threading.current_thread() with thread.get_ident(). However, given the profile table you have appended, it will only save at most 30% of the time. If someone needs a more important speed-up, he should reimplement the RLock type in C (and contribute it back :-)). _______________________________________ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue3001> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com