<< Back to previous view

[CLJ-858] Improve speed of STM by removing System.currentTimeMillis Created: 17/Oct/11  Updated: 22/Nov/13  Resolved: 22/Nov/13

Status: Closed
Project: Clojure
Component/s: None
Affects Version/s: Release 1.3
Fix Version/s: Release 1.6

Type: Enhancement Priority: Minor
Reporter: Stefan Kamphausen Assignee: Unassigned
Resolution: Completed Votes: 2
Labels: performance

Tested on Ubuntu and OSX

Attachments: File stm-rm-msecs-patch.diff    
Patch: Code
Approval: Ok


The inner class TVal in LockingTransaction and Ref has an unused milliseconds field (that is populated with System.currentTimeMillis()).

This patch removes the milliseconds from inner class TVal in LockingTransaction.java and Ref.java. Using a little test suite[1] a increase of performance by up to 25% could be measured.

Original post: https://groups.google.com/d/topic/clojure/kc99LcUK8Tk/discussion

[1] https://github.com/ska2342/clj-stm-perf-test/

Screened by: Alex Miller

Comment by Alex Miller [ 08/Aug/13 2:48 AM ]

Patch applies cleanly. Author is a contributor.

Did not verify performance claims but I can't see how removing fields and calls to System.currentTimeMillis() could do anything but make STM usage smaller and faster.

Marking Screened.

Generated at Wed Nov 25 18:34:08 CST 2015 using JIRA 4.4#649-r158309.