box: speed up tuple_new() by 2x for sparse plain tuples
It is possible to skip MP_NIL by mp_decode_nil(), which is faster than mp_next(). This patch improves bench_tuple_new<FORMAT_SPARSE> by 2.2x. NO_WRAP $ taskset 0x2 ~/benchmark/tools/compare.py benchmarks \ ./tuple.perftest.old ./tuple.perftest.new \ --benchmark_min_warmup_time=10 \ --benchmark_repetitions=30 \ --benchmark_report_aggregates_only=true \ --benchmark_filter=tuple_new\<FORMAT_SPARSE\> [...] Comparing ./tuple.perftest.old to ./tuple.perftest.new Benchmark Time CPU Time Old Time New CPU Old CPU New ------------------------------------------------------------------------------------------------------------------------------------ bench_tuple_new<FORMAT_SPARSE>_mean -0.5525 -0.5525 6985 3126 6985 3126 bench_tuple_new<FORMAT_SPARSE>_median -0.5445 -0.5444 6838 3115 6838 3115 bench_tuple_new<FORMAT_SPARSE>_stddev -0.8368 -0.8367 541 88 541 88 bench_tuple_new<FORMAT_SPARSE>_cv -0.6354 -0.6352 0 0 0 0 NO_WRAP Needed for tarantool/tarantool-ee#711 NO_DOC=perf improvement NO_TEST=perf improvement NO_CHANGELOG=next commit
Loading
Please register or sign in to comment