UQLite (without transction)
寫入 26590 microseconds per iteration
讀取 11439 microseconds per iteration
LMDB
寫入 64458 microseconds per iteration
讀取 11631 microseconds per iteration
設定為 10000
UQLite (without transction)
寫入 57926 microseconds per iteration
讀取 75323 microseconds per iteration
LMDB
寫入 97469 microseconds per iteration
讀取 67560 microseconds per iteration
設定為 100000
UQLite (without transction)
寫入 616260 microseconds per iteration
讀取 777202 microseconds per iteration
LMDB
寫入 371342 microseconds per iteration
讀取 632069 microseconds per iteration
測試程式 (UNQLite - write):
#!/usr/bin/tclsh
package require unqlite
unqlite db1 "test.db"
set result [time {
for {set i 1} {$i <= 100000} {incr i} {
db1 kv_store $i $i
}
}]
puts $result
db1 close
測試程式 (UNQLite - read):
#!/usr/bin/tclsh
package require unqlite
unqlite db1 "test.db"
set result [time {
for {set i 1} {$i <= 100000} {incr i} {
puts [db1 kv_fetch $i]
}
}]
puts $result
db1 close
測試程式 (LMDB - write):
#!/usr/bin/tclsh
package require lmdb
set myenv [lmdb env]
$myenv set_mapsize 1073741824
file mkdir "testdb"
$myenv open -path "testdb"
set mydbi [lmdb open -env $myenv]
set result [time {
set mytxn [env0 txn]
for {set i 1} {$i <= 100000} {incr i} {
$mydbi put $i $i -txn $mytxn
}
$mytxn commit
}]
puts $result
$mytxn close
$mydbi close -env env0
$myenv close
測試程式 (LMDB - read):
#!/usr/bin/tclsh
package require lmdb
set myenv [lmdb env]
$myenv set_mapsize 1073741824
file mkdir "testdb"
$myenv open -path "testdb"
set mydbi [lmdb open -env $myenv]
set result [time {
set mytxn [env0 txn]
for {set i 1} {$i <= 100000} {incr i} {
puts [$mydbi get $i -txn $mytxn]
}
$mytxn commit
}]
puts $result
$mytxn close
$mydbi close -env env0
$myenv close
沒有留言:
張貼留言