Test 1

Spawned 100 threads that each performed 100,000 enqueue operations against an nsEventQueue, and another 100 threads that each slept 100ms and then performed 100,000 dequeue operations against the same nsEventQueue. Recorded the time taken by each thread (excluding the 100ms of sleep for the dequeueing threads). Repeated the test for the lockless queue.

Each of 100 threads performs 100,000 dequeue operations against an nsEventQueue.
Each of 100 threads performs 100,000 dequeue operations against a lockless queue.
Horizontal axis: thread number, in starting order.
Vertical axis: milliseconds to perform 100,000 dequeue operations.
Each of 100 threads performs 100,000 enqueue operations against an nsEventQueue.
Each of 100 threads performs 100,000 enqueue operations against a lockless queue.
Horizontal axis: thread number, in starting order.
Vertical axis: milliseconds to perform 100,000 enqueue operations.

Test 2

Setup identical to the first test, except threads are created at 200ms intervals to eliminate lock contention. The two queues perform more comparably in the absence of lock contention, but dequeueing is still faster for the lockless queue than for the nsEventQueue.

Each of 100 threads performs 100,000 dequeue operations against an nsEventQueue.
Each of 100 threads performs 100,000 dequeue operations against a lockless queue.
Horizontal axis: thread number, in starting order.
Vertical axis: milliseconds to perform 100,000 dequeue operations.
Each of 100 threads performs 100,000 enqueue operations against an nsEventQueue.
Each of 100 threads performs 100,000 enqueue operations against a lockless queue.
Horizontal axis: thread number, in starting order.
Vertical axis: milliseconds to perform 100,000 enqueue operations.