Details
-
Type:
Improvement
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 2.1.2
-
Fix Version/s: 3.0.0
-
Labels:
-
Environment:Mac osx 10.7, java version "1.6.0_29"
-
Patch Submitted:Yes
-
Number of attachments :
Description
A patch to great improve DiskJournal's performance.I used java.nio.channels.FileChannel to write log in batch with ByteBuffer,insteadof using java.io.RandomAccessFile.Also i have reduced the lock range in some codes,please check the pacth in attachment.
In my test,it could get about 2x improvement in performance.
You can patch it with "git apply use_nio_channel.patch" and to diff the codes.
Interesting changes. There already were some similar things done in the btm-2.1.x branch but you went a little bit further. I merged the 2.1.3-SNAPSHOT changes back to the master branch then applied a modified version of your patch on top.
There were some serious race conditions in your patch which forced me to modify the scope of the synchronized blocks so this may reduce the perf improvement you measured, while at the same time concurrency has generally been improved in the core TM code so YMMV.
I'd be glad if you could try out this all-integrated version and post your feedback here.
Thanks!