Hi,
> feel free to change licence and modify code
Thanks!
I ran the benchmark 'TestPerformance' against the regular and the NIO
version. The result is:
Statements per second: 68628 (regular)
Statements per second: 76598 (NIO mapped, with mapped.load())
Statements per second: 83756 (NIO mapped, without mapped.load())
Statements per second: 83031 (NIO channel)
> what are your plans with FileChannel?
I will make two prefixes:
jdbc:h2:nio:... (FileChannel)
jdbc:h2:nioMapped:... (memory mapped files)
I might make nio the default later on (not now yet).
> I tried 'cleaner hack'
Your version didn't work for me at first. Then I added
cleanerMethod.setAccessible(true), and now it works. See my code in
the previous mail. If it fails (for whatever reason, for example when
using an JDK where the method doesn't exist) it will fall back to
using System.gc(). I will also add an option to disable it.
> There is one modification to my patch: Try to use
> MappedByteBuffer.load() right after buffer is initialized (at remap()
> method). This should improve performance.
For my benchmark () it actually decreases performance. Did I add it at
the right place?
// maps new MappedByteBuffer, old one is disposed during GC
mapped = file.getChannel().map(mode, 0, file.length());
if (SysProperties.NIO_LOAD_MAPPED) {
mapped.load();
}
mapped.position(oldPos);
In any case, I will add a system property (h2.nioLoadMapped, default false).
Regards,
Thomas
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "H2
Database" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/h2-database?hl=en
-~----------~----~----~----~------~----~------~--~---