We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
queue
queue is designed for multithreading uses and acquire a lock in every method call. in a word, it's really slow.
just use list instead. it's much (about 50x) faster.
>>> import timeit >>> timeit.timeit('q.put(123)', 'import queue; q=queue.Queue()', number=10**6) 24.48412793993996 >>> timeit.timeit('q.append(123)', 'q=[]', number=10**6) 0.5576901608900329
The text was updated successfully, but these errors were encountered:
Since this class had been recently removed due to a potential rewrite, I will take this suggestion into consideration with the utmost importance.
I personally believe that writing a class (not thread-safe) by myself would be a better option.
Sorry, something went wrong.
jeffswt
No branches or pull requests
queue
is designed for multithreading uses and acquire a lock in every method call. in a word, it's really slow.just use list instead. it's much (about 50x) faster.
The text was updated successfully, but these errors were encountered: