Closed Niklp09 closed 7 months ago
Some interesting benchmark results:
BATCH 1: test results with 100000 iterations per function:
minetest.serialize(): TIME: 2192.18ms (2192179us) MIN: 17us MAX: 1.07ms (1069us) AVG: 21.92us
minetest.deserialize(): TIME: 1001.25ms (1001245us) MIN: 6us MAX: 1.24ms (1244us) AVG: 10.01us
minetest.write_json(): TIME: 2333.47ms (2333472us) MIN: 22us MAX: 85us AVG: 23.33us
minetest.parse_json(): TIME: 2344.72ms (2344722us) MIN: 22us MAX: 701us AVG: 23.45us
4 benchmarks done
BATCH 2: test results with 100000 iterations per function:
minetest.serialize(): TIME: 2041.88ms (2041876us) MIN: 15us MAX: 652us AVG: 20.42us
minetest.deserialize(): TIME: 998.06ms (998062us) MIN: 6us MAX: 750us AVG: 9.98us
minetest.write_json(): TIME: 2339.71ms (2339714us) MIN: 22us MAX: 77us AVG: 23.4us
minetest.parse_json(): TIME: 2330.71ms (2330707us) MIN: 22us MAX: 681us AVG: 23.31us
4 benchmarks done
BATCH 3: test results with 100000 iterations per function:
minetest.serialize(): TIME: 2053.68ms (2053679us) MIN: 15us MAX: 683us AVG: 20.54us
minetest.deserialize(): TIME: 999.78ms (999783us) MIN: 6us MAX: 983us AVG: 10us
minetest.write_json(): TIME: 2322.41ms (2322412us) MIN: 22us MAX: 77us AVG: 23.22us
minetest.parse_json(): TIME: 2323.4ms (2323396us) MIN: 22us MAX: 694us AVG: 23.23us
4 benchmarks done
This is a proposal for the
archtec_playerdata
API v2.Some basic notes:
number
,string
,boolean
,table
Public functions
Register new key (v1 has a static struct table)
Get the default value of a key
Get the value of a key
Set a key to value
Mod a key by value
Get all key-value pairs of a player
Migrate data of a key on server start
Cc: @debagos @blaboing