Skip to content

Instantly share code, notes, and snippets.

@smetj
Created May 22, 2013 17:27
Show Gist options
  • Save smetj/5629319 to your computer and use it in GitHub Desktop.
Save smetj/5629319 to your computer and use it in GitHub Desktop.
https://github.com/smetj/experiments/blob/master/python/testlap/queue_vs_deque_vs_mxstack.py
2.7.3 (default, Aug 9 2012, 17:23:57)
[GCC 4.7.1 20120720 (Red Hat 4.7.1-5)]
Linux-3.8.11-200.fc18.x86_64-x86_64-with-fedora-18-Spherical_Cow
Compare IO speed of different queue implementations.
Pushing and popping 1000000 integers.
+--------------------------+-----------------------+--------+--------------+
| Function | Description | Result | Seconds |
+--------------------------+-----------------------+--------+--------------+
| test_4_mx_stack_pop | Pop from mx stack | OK | 0.1480798721 |
| test_2_mx_queue_pop | Pop from mx queue | OK | 0.1491398811 |
| test_7_deque_push | Push to python deque. | OK | 0.159236908 |
| test_3_mx_stack_push | Push to mx stack | OK | 0.1677811146 |
| test_8_deque_pop | Pop from python deque | OK | 0.1759030819 |
| test_1_mx_queue_push | Push to mx queue | OK | 0.1815340519 |
| test_6_python_queue_pop | Pop from python queue | OK | 2.8252179623 |
| test_5_python_queue_push | Push to python queue. | OK | 2.8569397926 |
+--------------------------+-----------------------+--------+--------------+
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment