Timing.java in Nashorn currently uses a LinkedHashMap<String, Long> to record compilation timings. This is grossly inefficient (not to mention not being thread safe). The solution is to switch to using a ConcurrentHashMap<String, LongAdder> instead; with a separate LinkedBlockingQueue<String> to preserve ordering of stats.