Skip to content
Snippets Groups Projects
Commit e3209ebd authored by Ilya Verbin's avatar Ilya Verbin Committed by Serge Petrenko
Browse files

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
parent 0d869129
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment