[
https://issues.jboss.org/browse/JGRP-1406?page=com.atlassian.jira.plugin....
]
Bela Ban commented on JGRP-1406:
--------------------------------
Actually, TimeScheduler2 probably benefits from currentTimeMillis(): because of the lesser
granularity, we have to create fewer entries in the tasks ConcurrentSkipListMap. This map
is ordered in ascending order of its keys, which are execution times in milliseconds. If
we had nanoseconds, we'd have many more keys, and that's bad as a
ConcurrentSkipListMap has a high cost of inserting keys in sorted order !
With currentTimeMillis(), we have fewer keys (the same keys are then maintained in a list
in the associated value, which is cheap).
Replace System.currentTimeMillis() with System.nanoTime()
---------------------------------------------------------
Key: JGRP-1406
URL:
https://issues.jboss.org/browse/JGRP-1406
Project: JGroups
Issue Type: Enhancement
Reporter: Bela Ban
Assignee: Bela Ban
Priority: Minor
Fix For: 3.1
For short timings, replace currentTimeMillis() with nanoTime(). This might get us better
precision. Might need testing on Windows, where nanoTime() is apparently not implemented
efficiently...
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see:
http://www.atlassian.com/software/jira