1 2 Previous Next 16 Replies Latest reply on Aug 7, 2012 10:37 PM by 909806 Go to original post
      • 15. Re: Reducing shutdown time
        Ah interesting, I hope it's that simple. TreeMap also conveniently has firstKey(), which could be used in place of creating an iterator to retrieve a single element in removeNextNode(), and save some object allocation. It will be interesting to see if the insertion time suffers noticeably (since it's log(N) for TreeMap, as opposed to constant time for HashMap).

        Thanks much for looking into this.
        • 16. Re: Reducing shutdown time
          BTW, I did some benchmarking and LinkedHashMap performs even better than TreeMap in this usage pattern (perhaps because LinkedHashMap is still constant-time whereas TreeMap is log(n)). So you might want to give this a try for a future release (it's also a simple drop-in replacement).
          1 2 Previous Next