From: mechanik20051988 <mechanik20051988@tarantool.org> To: v.shpilevoy@tarantool.org, alyapunov@tarantool.org Cc: mechanik20051988 <mechanik20.05.1988@gmail.com>, tarantool-patches@dev.tarantool.org Subject: [Tarantool-patches] [PATCH 1/4] test: add performance test for memtx allocator. Date: Tue, 29 Dec 2020 14:03:29 +0300 [thread overview] Message-ID: <7d775b7475052a580be3511d61f3b9abd5c17a9a.1609239402.git.mechanik20051988@tarantool.org> (raw) In-Reply-To: <cover.1609239402.git.mechanik20051988@tarantool.org> From: mechanik20051988 <mechanik20.05.1988@gmail.com> --- perf/allocator_perf.test.lua | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100755 perf/allocator_perf.test.lua diff --git a/perf/allocator_perf.test.lua b/perf/allocator_perf.test.lua new file mode 100755 index 000000000..ffd217cdc --- /dev/null +++ b/perf/allocator_perf.test.lua @@ -0,0 +1,34 @@ +#!/usr/bin/env ../src/tarantool +os.execute('rm -rf *.snap *.xlog') +local clock = require('clock') +box.cfg{listen = 3301, wal_mode='none', allocator=arg[1]} +local space = box.schema.space.create('test') +space:format({ {name = 'id', type = 'unsigned'}, {name = 'year', type = 'unsigned'} }) +space:create_index('primary', { parts = {'id'} }) +local time_insert = 0 +local time_replace = 0 +local time_delete = 0 +local cnt = 0 +local cnt_max = 20 +local op_max = 2500000 +local nanosec = 1.0e9 +while cnt < cnt_max do + cnt = cnt + 1 + local time_before = clock.monotonic64() + for key = 1, op_max do space:insert({key, key + 1000}) end + local time_after = clock.monotonic64() + time_insert = time_insert + (time_after - time_before) + time_before = clock.monotonic64() + for key = 1, op_max do space:replace({key, key + 5000}) end + time_after = clock.monotonic64() + time_replace = time_replace + (time_after - time_before) + time_before = clock.monotonic64() + for key = 1, op_max do space:delete(key) end + time_after = clock.monotonic64() + time_delete = time_delete + (time_after - time_before) +end +io.write("{\n") +io.write(string.format(" \"alloc time\": \"%.3f\"\n", tonumber(time_insert) / (nanosec * cnt_max))) +io.write(string.format(" \"replace time\": \"%.3f\"\n", tonumber(time_replace) / (nanosec * cnt_max))) +io.write(string.format(" \"delete time\": \"%.3f\"\n}\n", tonumber(time_delete) / (nanosec * cnt_max))) +os.exit() -- 2.20.1
next prev parent reply other threads:[~2020-12-29 11:03 UTC|newest] Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-12-29 11:03 [Tarantool-patches] [PATCH 0/4] Choose allocator mor memtx mechanik20051988 2020-12-29 11:03 ` mechanik20051988 [this message] 2020-12-29 11:03 ` [Tarantool-patches] [PATCH 2/4] memtx: changed some memtx files from .c to .cc mechanik20051988 2020-12-29 11:03 ` [Tarantool-patches] [PATCH 3/4] memtx: implement api for memory allocator selection mechanik20051988 2021-01-10 13:56 ` Vladislav Shpilevoy via Tarantool-patches 2020-12-29 11:03 ` [Tarantool-patches] [PATCH 4/4] Implement system allocator, based on malloc mechanik20051988 2021-01-10 13:56 ` Vladislav Shpilevoy via Tarantool-patches 2021-01-10 13:55 ` [Tarantool-patches] [PATCH 0/4] Choose allocator mor memtx Vladislav Shpilevoy via Tarantool-patches 2021-01-10 14:36 ` Vladislav Shpilevoy via Tarantool-patches
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=7d775b7475052a580be3511d61f3b9abd5c17a9a.1609239402.git.mechanik20051988@tarantool.org \ --to=mechanik20051988@tarantool.org \ --cc=alyapunov@tarantool.org \ --cc=mechanik20.05.1988@gmail.com \ --cc=tarantool-patches@dev.tarantool.org \ --cc=v.shpilevoy@tarantool.org \ --subject='Re: [Tarantool-patches] [PATCH 1/4] test: add performance test for memtx allocator.' \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox