Added lab experiment to check H2 MVStore perf

This commit is contained in:
andsel
2016-09-12 12:28:55 +02:00
parent 32b6b9b1da
commit 55ea2d7c12
2 changed files with 60 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
@Grab(group='com.squareup', module='tape', version='1.2.3')
import com.squareup.tape.QueueFile
byte[] content = UUID.randomUUID().toString().bytes//[0x0C, 0x0A, 0x0F, 0x0E, 0x0B, 0x0A, 0x0B, 0x0E] as byte[]
numMessages = 10000
def file = File.createTempFile("tape", ".bin")
println "Created tmp file"
QueueFile queue = new QueueFile(file)
println "Created queue and starting"
long start = System.currentTimeMillis()
(1..numMessages).each {
queue.add(content)
}
long stop = System.currentTimeMillis()
println "Wrote ${numMessages*content.length} bytes in ${stop-start} ms"