[concurrency-interest] Performance of LinkedBlockingQueue.poll()

Baker, Anthony abaker at c-cor.com
Thu Jun 30 11:17:53 EDT 2005


During a recent profiling session, I was surprised to discover a perfomance hotspot identified as LinkedBlockingQueue.poll().  The profiler recorded about 39k invocations of poll() as accummulating 139s of cpu time (that's an avg of about 3.5ms per invocation).  Is this a known issue or perhaps a profiling artifact?  Switching back to Doug Lea's BoundedLinkedQueue removed this hotspot.

The test was executed on a 2-cpu Solaris8 server using jdk 1.5.0_03-b07 (64bit).  Our usage looks something like this:

  public void run() {
    while (true) {
      Transaction t = _queuedWrites.poll(1000, TimeUnit.MILLISECONDS);
      if (t == null) {

      } else {

There is a single producer thread and a single consumer thread.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/attachments/20050630/88428972/attachment.htm

More information about the Concurrency-interest mailing list