Closed abissell closed 11 years ago
Thank you for the improvement. It is expect that if you need thread safety, this will be done externally via synchronized or a Lock. If you do this, everything should work.
Thanks for merging these in Peter, it's a point of pride to have contributed a bit of code to Chronicle. :)
It's a point of pride to have more contributors. Thank you.
I imagine most clients are using
writeLong()
andwriteDouble()
most of the time anyway, but I was able to make these other appending functions run a little faster by eliminating the need for anArrays.binarySearch()
on the powers of 10. It's about a ~30% improvement over the existing code.It appeared to me that the
AbstractExcerpt
is intended to be used thread locally. If that's not the case, then the buffers which I added to the class would need to be put in aThreadLocal
(a quick single-threaded benchmark indicated this wasn't a crippling performance hit or anything).All the tests currently pass. I added
NewVsOldNumberAppendTest
to allow the existing algorithms to be compared against my proposed ones.Of course, I'd always be interested to hear if the code is broken in some subtle way as well. :)