Dear all,

Part of the announcement of NaviServer 4.99.28 was the update of the nsdbbdb module (Berkley DB driver via nsdb). I did a few tests about its performance, that might interest a few here.

The test of this module configured with lmdb is quite impressive (see below). For comparison, there are also accesses to nsv, ns_cache and similar included. All timings are from my notebook (Apple Silicon M1). This is just a micro-benchmark and measures buffered access through the NaviServer DB driver infrastructure. More detailed information about LMDB in comparison to Berkley DB concerning large Applications and more micro-benchmarks is in [1]

all the best

-gb

183 ns nsv_set foo x 1; time {nsv_get foo x} 100000 213 ns time {ns_cache_eval ns:memoize 1 {set x 1}} 100000 253 ns time {array set x {a 1 b 2 c 3}} 100000 308 ns ns_urlspace set -key foo1 /*.adp A; time {ns_urlspace get -key foo1 /static/test.adp} 100000 >>> 511 ns set ::db [ns_db gethandle lmdb]; time {ns_db 0or1row $::db "GET key1"} 100000 3633 ns time {parameter::get -package_id [ad_conn subsite_id] -parameter DefaultMaster -default "x"} 100000 36893 ns time {xo::dc get_value dbqd..qn {select title from acs_objects where object_id=221}} 100000 42523 ns time {::mongo::collection::query $::mongoColl {name string Gustaf}} 100000
Times are in nano seconds, the "slowest" is here the access to MongoDB (via nsf 
package) and PostgreSQL.
The PostgreSQL access takes 36 micro seconds, this means, one can run ~27K of 
those in a second.
But with LMDB it is possible to gets nearly 2 Mio DB accesses per second.

[1]http://www.lmdb.tech/media/20130329-devox-MDB.pdf
_______________________________________________
naviserver-devel mailing list
naviserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/naviserver-devel

Reply via email to