Skip to content

Instantly share code, notes, and snippets.

@igormunkin
Last active October 5, 2021 12:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save igormunkin/e956396d8fb3348d3ebbad60588af297 to your computer and use it in GitHub Desktop.
Save igormunkin/e956396d8fb3348d3ebbad60588af297 to your computer and use it in GitHub Desktop.
#!/usr/bin/tarantool
-- vim:ts=4 ss=4 sw=4 expandtab
-- Usage: tarantool relay-1mops.lua [num_ops] [nodes]
-- num_ops should be a number multiple of num_fibers * ops_per_txn
-- nodes should be a number from 1 to 31
local clock = require('clock')
local fiber = require('fiber')
local popen = require('popen')
local yaml = require('yaml')
-- TUNE OPTIONS HERE
-- working dir is cleared/created for every run, set mwd
-- during the test a subdir will be created for each replica
local mwd = './relay-test.data'
-- turn true to test the qsync
local test_qsync = false
-- number of operations performed by test
local num_ops = tonumber(arg[1] or 1e6)
-- number of fibers
local num_fibers = 50
-- number of operations per transaction
local ops_per_txn = 100
-- check the number of operations value
local txns, tail = math.modf(num_ops / num_fibers / ops_per_txn)
assert(txns > 0 and tail == 0,
('Invalid number of iterations: %s'):format(num_ops))
-- number of nodes - master and replicas
local nodes, tail = math.modf(tonumber(arg[2] or 0) + 1)
assert(nodes > 0 and nodes < 32 and tail == 0,
('Invalid number of nodes: %s'):format(nodes))
-- posterior evaluation shows that 256Mb is enough to make
-- 4 million replaces
local default_memtx_memory = 256 * 1024 * 1024
local memtx_memory = math.max(math.ceil(num_ops / 1e6 * default_memtx_memory),
default_memtx_memory)
-- END OF TUNABLE OPTIONS
print(('making %d operations, %d operations per txn using %d fibers'):format(
num_ops, ops_per_txn, num_fibers))
--- transactions per fiber
local trans_per_fiber = num_ops/ops_per_txn/num_fibers
os.execute(('rm -rf %s'):format(mwd))
os.execute(('mkdir -p %s'):format(mwd))
box.cfg({
listen = 3301,
log_level = 0,
memtx_memory = memtx_memory,
read_only = false,
replication = 'replicator:password@localhost:3301',
work_dir = mwd,
})
if test_qsync then
box.cfg({ replication_synchro_quorum = nodes })
end
box.schema.user.create('replicator', { password = 'password' })
box.schema.user.grant('replicator', 'replication')
-- number of nodes, storage for popen handles
local nodes_ph = {}
-- run replicas (if needed)
if nodes > 1 then
print(('starting %d replicas'):format(nodes - 1))
for i = 2, nodes do
-- subdir for replica's data
local rwd = ('relay-test.replica-%s'):format(i)
os.execute(('rm -rf %s'):format(rwd))
os.execute(('mkdir -p %s'):format(rwd))
-- command line for replica to start
local cmd = { arg[-1], '-e', ([[
box.cfg({
listen = %d,
log_level = 0,
memtx_memory = %d,
read_only = false,
replication = 'replicator:password@localhost:3301',
work_dir = '%s',
})
]]):format(3300 + i, memtx_memory, rwd) }
local res, err = popen.new(cmd, {
stdin = 'devnull',
stdout = 'devnull',
stderr = 'devnull',
})
assert(res, ('Error running replica %d: %s'):format(i, err))
nodes_ph[i] = res
end
-- wait for all replicas to connect
while #box.info.replication < nodes do
fiber.sleep(0.1)
end
end
local space = box.schema.create_space('test',
test_qsync and { is_sync = true } or { })
space:create_index('pk', { type = 'HASH' })
-- each fiber runs the fiber_load that has evenly distributed workload
function fiber_load(start, s)
for i = 1, trans_per_fiber do
box.begin()
for j = 1, ops_per_txn do
s:replace{ start, start }
start = start + 1
end
box.commit()
end
end
-- fiber storage to join them
local fibers_storage = { }
-- start timer
local start = {
lsn = box.info.replication[1].lsn,
proc = clock.proc(),
time = clock.time(),
}
for i = 1, num_fibers do
fibers_storage[i] = fiber.create(fiber_load, i*num_ops, space)
fibers_storage[i]:wakeup() -- needed for backward compatibility with 1.7
end
-- wait for all fibers to finish
for i = 1, num_fibers do
while fibers_storage[i]:status() ~= 'dead' do
fiber.yield()
end -- the loop is needed for backward compatibility with 1.7
end
local ops_done = box.info.replication[1].lsn
-- stop timer for master
local stop = {
lsn = ops_done - start.lsn,
proc = clock.proc() - start.proc,
time = clock.time() - start.time,
}
assert(num_ops == stop.lsn,
('Missing data: %d/%d inserted'):format(stop.lsn, num_ops))
print(('master done in time: %f, cpu: %f\nmaster speed: %d ops/sec'):format(
stop.time, stop.proc, math.floor(stop.lsn / stop.time)))
-- wait for all replicas and kill them
if nodes > 1 then
local done = false
repeat
for i = 2, nodes do
local r_vclock = box.info.replication[i].downstream.vclock
if r_vclock and r_vclock[1] < ops_done then
done = false
break
end
done = true
end
if not done then
fiber.sleep(0.001)
end
until done
-- stop timer for replicas
stop = {
lsn = box.info.replication[nodes].downstream.vclock[1] - start.lsn,
time = clock.time() - start.time,
proc = clock.proc() - start.proc,
}
print(('replicas done in time: %f, cpu: %f\nreplicas speed: %f ops/sec'):format(
stop.time, stop.proc, math.floor(stop.lsn / stop.time)))
for _, replica in pairs(nodes_ph) do
replica:kill()
replica:wait()
end
end
os.exit(0)
@igormunkin
Copy link
Author

Some stats for wall clock timings and operations per second (Apple M1 vs Apple M1 (Rosetta 2)).

1000000 replaces
Apple M1 (wall clock) Apple M1 (ops/sec) Apple M1 (Rosetta 2) (wall clock) Apple M1 (Rosetta 2) (ops/sec) Relation (Rosetta 2/M1)
-------- ----------------------- -------------------- ----------------------------------- -------------------------------- -------------------------
Run 1 0.513485 1947476 0.779232 1283314 1.517536053
Run 2 0.515587 1939536 0.803177 1245055 1.557791411
Run 3 0.514109 1945113 0.805633 1241259 1.567047066
Run 4 0.520584 1920919 0.826969 1209234 1.588540946
Run 5 0.518380 1929087 0.806673 1239659 1.556142212
Run 6 0.537575 1860205 0.812485 1230791 1.511389108
Run 7 0.530633 1884541 0.809894 1234729 1.526278991
Run 8 0.533390 1874800 0.795565 1256968 1.491525900
Run 9 0.516247 1937057 0.776764 1287392 1.504636347
Run 10 0.515243 1940832 0.793976 1259483 1.540973871
Run 11 0.517204 1933472 0.799150 1251329 1.545134995
Run 12 0.522334 1914484 0.784650 1274453 1.502199742
Run 13 0.515059 1941525 0.814270 1228093 1.580925680
Run 14 0.530446 1885205 0.810215 1234240 1.527422207
Run 15 0.523705 1909471 0.800976 1248476 1.529441193
-------- ----------------------- -------------------- ----------------------------------- -------------------------------- -------------------------
Med 0.518380 1929087 0.803177 1245055 1.549398125
Avg 0.521599 1917581.533 0.8013086 1248298.333 1.536254881
Min 0.513485 1860205 0.776764 1209234 1.512729681
Max 0.537575 1947476 0.826969 1287392 1.538332326
5000000 replaces
Apple M1 (wall clock) Apple M1 (ops/sec) Apple M1 (Rosetta 2) (wall clock) Apple M1 (Rosetta 2) (ops/sec) Relation (Rosetta 2/M1)
-------- ----------------------- -------------------- ----------------------------------- -------------------------------- -------------------------
Run 1 2.583679 1935224 4.001385 1249567 1.548715998
Run 2 2.565490 1948945 4.026963 1241630 1.569666224
Run 3 2.577809 1939631 4.046618 1235599 1.569789693
Run 4 2.578820 1938871 3.924158 1274158 1.521687438
Run 5 2.596891 1925379 3.993017 1252186 1.537614401
Run 6 2.612779 1913671 4.011028 1246563 1.535157776
Run 7 2.583271 1935530 4.037565 1238370 1.562966100
Run 8 2.589305 1931020 4.160194 1201866 1.606683647
Run 9 2.581282 1937022 3.978172 1256858 1.541161330
Run 10 2.583490 1935366 4.062729 1230699 1.572573921
Run 11 2.577924 1939545 3.943704 1267843 1.529798396
Run 12 2.597693 1924784 3.982676 1255437 1.533158845
Run 13 2.583340 1935478 4.041098 1237287 1.564291963
Run 14 2.570901 1944843 4.016310 1244923 1.562218849
Run 15 2.567064 1947750 3.924667 1273993 1.528854364
-------- ----------------------- -------------------- ----------------------------------- -------------------------------- -------------------------
Med 2.583271 1935530 4.011028 1246563 1.552693465
Avg 2.583315867 1935537.267 4.010018933 1247131.933 1.552275889
Min 2.56549 1913671 3.924158 1201866 1.529593957
Max 2.612779 1948945 4.160194 1274158 1.592248713
10000000 replaces
Apple M1 (wall clock) Apple M1 (ops/sec) Apple M1 (Rosetta 2) (wall clock) Apple M1 (Rosetta 2) (ops/sec) Relation (Rosetta 2/M1)
-------- ----------------------- -------------------- ----------------------------------- -------------------------------- -------------------------
Run 1 5.160520 1937789 7.988666 1251773 1.548035082
Run 2 5.162725 1936961 8.019857 1246905 1.553415493
Run 3 5.325083 1877905 8.196429 1220043 1.539211501
Run 4 5.163672 1936606 7.993553 1251008 1.548036552
Run 5 5.223807 1914312 7.983247 1252623 1.528243099
Run 6 5.188444 1927360 7.981670 1252870 1.538355237
Run 7 5.141926 1944796 7.968451 1254949 1.549701610
Run 8 5.146730 1942981 7.980432 1253065 1.550582992
Run 9 5.175809 1932065 7.983253 1252622 1.542416461
Run 10 5.207238 1920403 8.024833 1246131 1.541092034
Run 11 5.153160 1940556 8.052429 1241861 1.562619635
Run 12 5.167791 1935062 7.982209 1252786 1.544607551
Run 13 5.160697 1937722 8.053599 1241680 1.560564203
Run 14 5.155869 1939537 8.216340 1217086 1.593589752
Run 15 5.233821 1910649 8.136962 1228959 1.554688630
-------- ----------------------- -------------------- ----------------------------------- -------------------------------- -------------------------
Med 5.163672 1936606 7.993553 1251008 1.548036552
Avg 5.184486133 1928980.267 8.037462 1244290.733 1.550290963
Min 5.141926 1877905 7.968451 1217086 1.549701610
Max 5.325083 1944796 8.216340 1254949 1.542950598
15000000 replaces
Apple M1 (wall clock) Apple M1 (ops/sec) Apple M1 (Rosetta 2) (wall clock) Apple M1 (Rosetta 2) (ops/sec) Relation (Rosetta 2/M1)
-------- ----------------------- -------------------- ----------------------------------- -------------------------------- -------------------------
Run 1 7.683132 1952328 12.593965 1191046 1.639170718
Run 2 7.719851 1943042 11.920311 1258356 1.544111538
Run 3 7.717612 1943606 11.891690 1261385 1.540850978
Run 4 7.761347 1932654 11.978406 1252253 1.543341124
Run 5 7.695678 1949146 12.044989 1245331 1.565162810
Run 6 7.711488 1945149 11.847263 1266115 1.536313485
Run 7 7.698423 1948451 11.839738 1266919 1.537943290
Run 8 7.707843 1946069 12.133204 1236276 1.574137408
Run 9 7.708424 1945923 11.911222 1259316 1.545221436
Run 10 7.720346 1942918 12.301178 1219395 1.593345428
Run 11 7.694705 1949392 12.188065 1230712 1.583954810
Run 12 7.725098 1941722 11.593513 1293826 1.500759343
Run 13 7.684736 1951921 11.755976 1275946 1.529782676
Run 14 7.706184 1946488 12.038474 1246005 1.562183566
Run 15 7.735034 1939228 12.084654 1241243 1.562327199
-------- ----------------------- -------------------- ----------------------------------- -------------------------------- -------------------------
Med 7.708424 1945923 11.978406 1252253 1.553937095
Avg 7.711326733 1945202.467 12.00817653 1249608.267 1.557212779
Min 7.683132 1932654 11.593513 1191046 1.508956634
Max 7.761347 1952328 12.593965 1293826 1.622651970
20000000 replaces
Apple M1 (wall clock) Apple M1 (ops/sec) Apple M1 (Rosetta 2) (wall clock) Apple M1 (Rosetta 2) (ops/sec) Relation (Rosetta 2/M1)
-------- ----------------------- -------------------- ----------------------------------- -------------------------------- -------------------------
Run 1 10.454208 1913105 15.982102 1251399 1.528772146
Run 2 10.543672 1896872 15.944010 1254389 1.512187595
Run 3 10.456510 1912684 15.730944 1271379 1.504416292
Run 4 10.337435 1934715 16.761880 1193183 1.621473799
Run 5 10.367294 1929143 16.608073 1204233 1.601967977
Run 6 10.340018 1934232 15.909022 1257148 1.538587457
Run 7 10.340294 1934180 16.069270 1244611 1.554043821
Run 8 10.401648 1922772 16.200727 1234512 1.557515405
Run 9 10.364378 1929686 16.016578 1248706 1.545348693
Run 10 10.363388 1929870 16.116791 1240941 1.555166226
Run 11 10.325387 1936973 16.179631 1236122 1.566975746
Run 12 10.351826 1932026 15.725964 1271782 1.519148796
Run 13 10.452252 1913463 16.156782 1237870 1.545770423
Run 14 10.388245 1925252 16.441910 1216403 1.582741839
Run 15 10.387833 1925329 15.754389 1269487 1.516619395
-------- ----------------------- -------------------- ----------------------------------- -------------------------------- -------------------------
Med 10.367294 1929143 16.069270 1244611 1.549996556
Avg 10.39162587 1924686.8 16.1065382 1242144.333 1.549953627
Min 10.325387 1896872 15.725964 1193183 1.523038701
Max 10.543672 1936973 16.76188 1271782 1.589757345

@igormunkin
Copy link
Author

$ sysctl -n machdep.cpu.brand_string
Intel(R) Core(TM) i5-1038NG7 CPU @ 2.00GHz
$ uname -mrs
Darwin 20.6.0 x86_64
$ sw_vers
ProductName:	macOS
ProductVersion:	11.6
BuildVersion:	20G165
$ md5 relay-1mops.lua
MD5 (relay-1mops.lua) = 69e3940e8975a4e29f77ea566f25709e
$ ../src/tarantool -v
Tarantool 2.10.0-beta1-0-g7da4b1438
Target: Darwin-x86_64-RelWithDebInfo
Build options: cmake . -DCMAKE_INSTALL_PREFIX=/usr/local -DENABLE_BACKTRACE=ON
Compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
C_FLAGS: -Wno-unknown-pragmas -fexceptions -funwind-tables -fno-omit-frame-pointer -fno-stack-protector -fno-common -msse2 -std=c11 -Wall -Wextra -Wno-strict-aliasing -Wno-char-subscripts -Wno-gnu-alignof-expression
CXX_FLAGS: -Wno-unknown-pragmas -fexceptions -funwind-tables -fno-omit-frame-pointer -fno-stack-protector -fno-common -msse2 -std=c++11 -Wall -Wextra -Wno-strict-aliasing -Wno-char-subscripts -Wno-invalid-offsetof -Wno-gnu-alignof-expression
$ ../src/tarantool -e 'print(jit.os,jit.arch)'
OSX	x64
$ for n in 1e6 5e6 10e6 15e6 20e6; do for i in $(seq 1 15); do ../src/tarantool relay-1mops.lua $n; done; done
making 1000000 operations, 100 operations per txn using 50 fibers
master done in time: 1.078086, cpu: 1.441896
master speed: 927569 ops/sec
making 1000000 operations, 100 operations per txn using 50 fibers
master done in time: 1.116990, cpu: 1.511190
master speed: 895263 ops/sec
making 1000000 operations, 100 operations per txn using 50 fibers
master done in time: 1.094748, cpu: 1.466973
master speed: 913452 ops/sec
making 1000000 operations, 100 operations per txn using 50 fibers
master done in time: 1.090597, cpu: 1.458207
master speed: 916929 ops/sec
making 1000000 operations, 100 operations per txn using 50 fibers
master done in time: 1.114640, cpu: 1.533273
master speed: 897150 ops/sec
making 1000000 operations, 100 operations per txn using 50 fibers
master done in time: 1.095783, cpu: 1.487613
master speed: 912589 ops/sec
making 1000000 operations, 100 operations per txn using 50 fibers
master done in time: 1.079496, cpu: 1.444364
master speed: 926358 ops/sec
making 1000000 operations, 100 operations per txn using 50 fibers
master done in time: 1.078900, cpu: 1.447987
master speed: 926869 ops/sec
making 1000000 operations, 100 operations per txn using 50 fibers
master done in time: 1.110369, cpu: 1.498742
master speed: 900601 ops/sec
making 1000000 operations, 100 operations per txn using 50 fibers
master done in time: 1.081358, cpu: 1.454200
master speed: 924763 ops/sec
making 1000000 operations, 100 operations per txn using 50 fibers
master done in time: 1.066245, cpu: 1.426832
master speed: 937870 ops/sec
making 1000000 operations, 100 operations per txn using 50 fibers
master done in time: 1.089303, cpu: 1.470655
master speed: 918018 ops/sec
making 1000000 operations, 100 operations per txn using 50 fibers
master done in time: 1.058271, cpu: 1.424584
master speed: 944937 ops/sec
making 1000000 operations, 100 operations per txn using 50 fibers
master done in time: 1.072334, cpu: 1.434280
master speed: 932545 ops/sec
making 1000000 operations, 100 operations per txn using 50 fibers
master done in time: 1.075167, cpu: 1.460369
master speed: 930088 ops/sec
making 5000000 operations, 100 operations per txn using 50 fibers
master done in time: 5.365338, cpu: 7.094546
master speed: 931907 ops/sec
making 5000000 operations, 100 operations per txn using 50 fibers
master done in time: 5.426003, cpu: 7.160997
master speed: 921488 ops/sec
making 5000000 operations, 100 operations per txn using 50 fibers
master done in time: 5.464272, cpu: 7.217848
master speed: 915034 ops/sec
making 5000000 operations, 100 operations per txn using 50 fibers
master done in time: 5.291650, cpu: 7.057934
master speed: 944884 ops/sec
making 5000000 operations, 100 operations per txn using 50 fibers
master done in time: 5.434663, cpu: 7.168030
master speed: 920020 ops/sec
making 5000000 operations, 100 operations per txn using 50 fibers
master done in time: 5.417282, cpu: 7.156694
master speed: 922972 ops/sec
making 5000000 operations, 100 operations per txn using 50 fibers
master done in time: 5.480857, cpu: 7.279844
master speed: 912266 ops/sec
making 5000000 operations, 100 operations per txn using 50 fibers
master done in time: 5.324999, cpu: 7.075412
master speed: 938967 ops/sec
making 5000000 operations, 100 operations per txn using 50 fibers
master done in time: 5.300625, cpu: 7.032333
master speed: 943285 ops/sec
making 5000000 operations, 100 operations per txn using 50 fibers
master done in time: 5.247602, cpu: 6.972393
master speed: 952816 ops/sec
making 5000000 operations, 100 operations per txn using 50 fibers
master done in time: 5.163495, cpu: 6.887207
master speed: 968336 ops/sec
making 5000000 operations, 100 operations per txn using 50 fibers
master done in time: 5.213042, cpu: 6.939031
master speed: 959132 ops/sec
making 5000000 operations, 100 operations per txn using 50 fibers
master done in time: 5.283318, cpu: 7.034796
master speed: 946374 ops/sec
making 5000000 operations, 100 operations per txn using 50 fibers
master done in time: 5.437720, cpu: 7.203053
master speed: 919503 ops/sec
making 5000000 operations, 100 operations per txn using 50 fibers
master done in time: 5.381596, cpu: 7.174760
master speed: 929092 ops/sec
making 10000000 operations, 100 operations per txn using 50 fibers
master done in time: 10.798749, cpu: 14.231064
master speed: 926033 ops/sec
making 10000000 operations, 100 operations per txn using 50 fibers
master done in time: 10.828895, cpu: 14.301153
master speed: 923455 ops/sec
making 10000000 operations, 100 operations per txn using 50 fibers
master done in time: 10.714711, cpu: 14.125515
master speed: 933296 ops/sec
making 10000000 operations, 100 operations per txn using 50 fibers
master done in time: 10.839264, cpu: 14.289900
master speed: 922571 ops/sec
making 10000000 operations, 100 operations per txn using 50 fibers
master done in time: 10.696577, cpu: 14.122867
master speed: 934878 ops/sec
making 10000000 operations, 100 operations per txn using 50 fibers
master done in time: 10.736090, cpu: 14.184479
master speed: 931437 ops/sec
making 10000000 operations, 100 operations per txn using 50 fibers
master done in time: 10.710851, cpu: 14.153043
master speed: 933632 ops/sec
making 10000000 operations, 100 operations per txn using 50 fibers
master done in time: 10.674525, cpu: 14.081225
master speed: 936809 ops/sec
making 10000000 operations, 100 operations per txn using 50 fibers
master done in time: 10.605407, cpu: 14.022934
master speed: 942915 ops/sec
making 10000000 operations, 100 operations per txn using 50 fibers
master done in time: 10.738789, cpu: 14.157755
master speed: 931203 ops/sec
making 10000000 operations, 100 operations per txn using 50 fibers
master done in time: 10.680092, cpu: 14.118046
master speed: 936321 ops/sec
making 10000000 operations, 100 operations per txn using 50 fibers
master done in time: 10.522609, cpu: 13.900426
master speed: 950334 ops/sec
making 10000000 operations, 100 operations per txn using 50 fibers
master done in time: 10.612297, cpu: 14.045949
master speed: 942303 ops/sec
making 10000000 operations, 100 operations per txn using 50 fibers
master done in time: 10.664438, cpu: 14.068861
master speed: 937695 ops/sec
making 10000000 operations, 100 operations per txn using 50 fibers
master done in time: 10.863212, cpu: 14.287467
master speed: 920538 ops/sec
making 15000000 operations, 100 operations per txn using 50 fibers
master done in time: 15.920179, cpu: 21.033215
master speed: 942200 ops/sec
making 15000000 operations, 100 operations per txn using 50 fibers
master done in time: 16.268209, cpu: 21.380859
master speed: 922043 ops/sec
making 15000000 operations, 100 operations per txn using 50 fibers
master done in time: 16.285820, cpu: 21.415234
master speed: 921046 ops/sec
making 15000000 operations, 100 operations per txn using 50 fibers
master done in time: 15.945280, cpu: 21.008641
master speed: 940717 ops/sec
making 15000000 operations, 100 operations per txn using 50 fibers
master done in time: 16.083569, cpu: 21.173547
master speed: 932628 ops/sec
making 15000000 operations, 100 operations per txn using 50 fibers
master done in time: 15.858925, cpu: 20.930795
master speed: 945839 ops/sec
making 15000000 operations, 100 operations per txn using 50 fibers
master done in time: 15.905716, cpu: 20.948465
master speed: 943057 ops/sec
making 15000000 operations, 100 operations per txn using 50 fibers
master done in time: 15.710405, cpu: 20.711412
master speed: 954781 ops/sec
making 15000000 operations, 100 operations per txn using 50 fibers
master done in time: 16.045040, cpu: 21.142873
master speed: 934868 ops/sec
making 15000000 operations, 100 operations per txn using 50 fibers
master done in time: 16.076839, cpu: 21.168112
master speed: 933019 ops/sec
making 15000000 operations, 100 operations per txn using 50 fibers
master done in time: 15.881122, cpu: 20.987646
master speed: 944517 ops/sec
making 15000000 operations, 100 operations per txn using 50 fibers
master done in time: 16.508107, cpu: 21.709523
master speed: 908644 ops/sec
making 15000000 operations, 100 operations per txn using 50 fibers
master done in time: 16.493120, cpu: 21.663989
master speed: 909470 ops/sec
making 15000000 operations, 100 operations per txn using 50 fibers
master done in time: 16.134264, cpu: 21.234363
master speed: 929698 ops/sec
making 15000000 operations, 100 operations per txn using 50 fibers
master done in time: 16.024290, cpu: 21.104762
master speed: 936078 ops/sec
making 20000000 operations, 100 operations per txn using 50 fibers
master done in time: 21.257546, cpu: 27.889241
master speed: 940842 ops/sec
making 20000000 operations, 100 operations per txn using 50 fibers
master done in time: 21.468545, cpu: 28.161993
master speed: 931595 ops/sec
making 20000000 operations, 100 operations per txn using 50 fibers
master done in time: 21.379360, cpu: 28.053694
master speed: 935481 ops/sec
making 20000000 operations, 100 operations per txn using 50 fibers
master done in time: 21.822884, cpu: 28.512005
master speed: 916469 ops/sec
making 20000000 operations, 100 operations per txn using 50 fibers
master done in time: 21.661464, cpu: 28.329287
master speed: 923298 ops/sec
making 20000000 operations, 100 operations per txn using 50 fibers
master done in time: 21.758416, cpu: 28.425663
master speed: 919184 ops/sec
making 20000000 operations, 100 operations per txn using 50 fibers
master done in time: 21.383367, cpu: 28.313236
master speed: 935306 ops/sec
making 20000000 operations, 100 operations per txn using 50 fibers
master done in time: 21.398162, cpu: 28.076717
master speed: 934659 ops/sec
making 20000000 operations, 100 operations per txn using 50 fibers
master done in time: 21.324088, cpu: 27.955555
master speed: 937906 ops/sec
making 20000000 operations, 100 operations per txn using 50 fibers
master done in time: 21.490854, cpu: 28.206381
master speed: 930628 ops/sec
making 20000000 operations, 100 operations per txn using 50 fibers
master done in time: 21.664436, cpu: 28.420061
master speed: 923171 ops/sec
making 20000000 operations, 100 operations per txn using 50 fibers
master done in time: 21.447941, cpu: 28.176676
master speed: 932490 ops/sec
making 20000000 operations, 100 operations per txn using 50 fibers
master done in time: 21.521186, cpu: 28.273360
master speed: 929316 ops/sec
making 20000000 operations, 100 operations per txn using 50 fibers
master done in time: 21.445809, cpu: 28.118842
master speed: 932583 ops/sec
making 20000000 operations, 100 operations per txn using 50 fibers
master done in time: 21.638631, cpu: 28.366392
master speed: 924272 ops/sec

@igormunkin
Copy link
Author

Some stats for wall clock timings and operations per second (Apple M1 vs Intel(R) Core(TM) i5-1038NG7 CPU @ 2.00GHz).

1000000 replaces
Apple M1 (wall clock) Apple M1 (ops/sec) Intel(R) Core(TM) i5-1038NG7 CPU @ 2.00GHz (wall clock) Intel(R) Core(TM) i5-1038NG7 CPU @ 2.00GHz (ops/sec) Relation (i5-1038NG7/M1)
-------- ----------------------- -------------------- --------------------------------------------------------- ------------------------------------------------------ --------------------------
Run 1 0.513485 1947476 1.078086 927569 2.099547212
Run 2 0.515587 1939536 1.11699 895263 2.166443297
Run 3 0.514109 1945113 1.094748 913452 2.129408355
Run 4 0.520584 1920919 1.090597 916929 2.094949134
Run 5 0.518380 1929087 1.11464 897150 2.150237278
Run 6 0.537575 1860205 1.095783 912589 2.038381621
Run 7 0.530633 1884541 1.079496 926358 2.034355195
Run 8 0.533390 1874800 1.0789 926869 2.022722586
Run 9 0.516247 1937057 1.110369 900601 2.150848334
Run 10 0.515243 1940832 1.081358 924763 2.098733995
Run 11 0.517204 1933472 1.066245 937870 2.061555982
Run 12 0.522334 1914484 1.089303 918018 2.085452986
Run 13 0.515059 1941525 1.058271 944937 2.054659757
Run 14 0.530446 1885205 1.072334 932545 2.021570527
Run 15 0.523705 1909471 1.075167 930088 2.053001213
-------- ----------------------- -------------------- --------------------------------------------------------- ------------------------------------------------------ --------------------------
Med 0.518380 1929087 1.081358 924763 2.086033412
Avg 0.521599 1917581.533 1.086819133 920333.4 2.083630699
Min 0.513485 1860205 1.058271 895263 2.060957964
Max 0.537575 1947476 1.11699 944937 2.077831
5000000 replaces
Apple M1 (wall clock) Apple M1 (ops/sec) Intel(R) Core(TM) i5-1038NG7 CPU @ 2.00GHz (wall clock) Intel(R) Core(TM) i5-1038NG7 CPU @ 2.00GHz (ops/sec) Relation (i5-1038NG7/M1)
-------- ----------------------- -------------------- --------------------------------------------------------- ------------------------------------------------------ --------------------------
Run 1 2.583679 1935224 5.365338 931907 2.076627166
Run 2 2.565490 1948945 5.426003 921488 2.114996745
Run 3 2.577809 1939631 5.464272 915034 2.119735015
Run 4 2.578820 1938871 5.29165 944884 2.051965628
Run 5 2.596891 1925379 5.434663 920020 2.092757455
Run 6 2.612779 1913671 5.417282 922972 2.073379341
Run 7 2.583271 1935530 5.480857 912266 2.121673258
Run 8 2.589305 1931020 5.324999 938967 2.05653602
Run 9 2.581282 1937022 5.300625 943285 2.053485439
Run 10 2.583490 1935366 5.247602 952816 2.031206624
Run 11 2.577924 1939545 5.163495 968336 2.00296634
Run 12 2.597693 1924784 5.213042 959132 2.0067968
Run 13 2.583340 1935478 5.283318 946374 2.045150077
Run 14 2.570901 1944843 5.43772 919503 2.115102837
Run 15 2.567064 1947750 5.381596 929092 2.09640118
-------- ----------------------- -------------------- --------------------------------------------------------- ------------------------------------------------------ --------------------------
Med 2.583271 1935530 5.365338 931907 2.076955147
Avg 2.583315867 1935537.267 5.3488308 935071.7333 2.070529148
Min 2.56549 1913671 5.163495 912266 2.012673992
Max 2.612779 1948945 5.480857 968336 2.09771167
10000000 replaces
Apple M1 (wall clock) Apple M1 (ops/sec) Intel(R) Core(TM) i5-1038NG7 CPU @ 2.00GHz (wall clock) Intel(R) Core(TM) i5-1038NG7 CPU @ 2.00GHz (ops/sec) Relation (i5-1038NG7/M1)
-------- ----------------------- -------------------- --------------------------------------------------------- ------------------------------------------------------ --------------------------
Run 1 5.160520 1937789 10.798749 926033 2.092569935
Run 2 5.162725 1936961 10.828895 923455 2.097515363
Run 3 5.325083 1877905 10.714711 933296 2.012120938
Run 4 5.163672 1936606 10.839264 922571 2.099138752
Run 5 5.223807 1914312 10.696577 934878 2.047659303
Run 6 5.188444 1927360 10.73609 931437 2.069231161
Run 7 5.141926 1944796 10.710851 933632 2.083042619
Run 8 5.146730 1942981 10.674525 936809 2.074040216
Run 9 5.175809 1932065 10.605407 942915 2.049033687
Run 10 5.207238 1920403 10.738789 931203 2.062281194
Run 11 5.153160 1940556 10.680092 936321 2.072532582
Run 12 5.167791 1935062 10.522609 950334 2.036190899
Run 13 5.160697 1937722 10.612297 942303 2.056368936
Run 14 5.155869 1939537 10.664438 937695 2.068407479
Run 15 5.233821 1910649 10.863212 920538 2.075579581
-------- ----------------------- -------------------- --------------------------------------------------------- ------------------------------------------------------ --------------------------
Med 5.163672 1936606 10.710851 933632 2.074270209
Avg 5.184486133 1928980.267 10.71243373 933561.3333 2.066247928
Min 5.141926 1877905 10.522609 920538 2.046433379
Max 5.325083 1944796 10.863212 950334 2.040008015
15000000 replaces
Apple M1 (wall clock) Apple M1 (ops/sec) Intel(R) Core(TM) i5-1038NG7 CPU @ 2.00GHz (wall clock) Intel(R) Core(TM) i5-1038NG7 CPU @ 2.00GHz (ops/sec) Relation (i5-1038NG7/M1)
-------- ----------------------- -------------------- --------------------------------------------------------- ------------------------------------------------------ --------------------------
Run 1 7.683132 1952328 15.920179 942200 2.072094948
Run 2 7.719851 1943042 16.268209 922043 2.107321631
Run 3 7.717612 1943606 16.28582 921046 2.110214921
Run 4 7.761347 1932654 15.94528 940717 2.054447508
Run 5 7.695678 1949146 16.083569 932628 2.08994828
Run 6 7.711488 1945149 15.858925 945839 2.05653241
Run 7 7.698423 1948451 15.905716 943057 2.066100551
Run 8 7.707843 1946069 15.710405 954781 2.038236248
Run 9 7.708424 1945923 16.04504 934868 2.08149422
Run 10 7.720346 1942918 16.076839 933019 2.082398768
Run 11 7.694705 1949392 15.881122 944517 2.063902645
Run 12 7.725098 1941722 16.508107 908644 2.13694467
Run 13 7.684736 1951921 16.49312 909470 2.146218165
Run 14 7.706184 1946488 16.134264 929698 2.093677493
Run 15 7.735034 1939228 16.02429 936078 2.071650881
-------- ----------------------- -------------------- --------------------------------------------------------- ------------------------------------------------------ --------------------------
Med 7.708424 1945923 16.04504 934868 2.08149422
Avg 7.711326733 1945202.467 16.076059 933240.3333 2.084733219
Min 7.683132 1932654 15.710405 908644 2.044791759
Max 7.761347 1952328 16.508107 954781 2.126964173
20000000 replaces
Apple M1 (wall clock) Apple M1 (ops/sec) Intel(R) Core(TM) i5-1038NG7 CPU @ 2.00GHz (wall clock) Intel(R) Core(TM) i5-1038NG7 CPU @ 2.00GHz (ops/sec) Relation (i5-1038NG7/M1)
-------- ----------------------- -------------------- --------------------------------------------------------- ------------------------------------------------------ --------------------------
Run 1 10.454208 1913105 21.257546 940842 2.033396121
Run 2 10.543672 1896872 21.468545 931595 2.036154482
Run 3 10.456510 1912684 21.37936 935481 2.044598054
Run 4 10.337435 1934715 21.822884 916469 2.111054048
Run 5 10.367294 1929143 21.661464 923298 2.08940385
Run 6 10.340018 1934232 21.758416 919184 2.104291888
Run 7 10.340294 1934180 21.383367 935306 2.067965089
Run 8 10.401648 1922772 21.398162 934659 2.057189591
Run 9 10.364378 1929686 21.324088 937906 2.057440205
Run 10 10.363388 1929870 21.490854 930628 2.073728591
Run 11 10.325387 1936973 21.664436 923171 2.098171817
Run 12 10.351826 1932026 21.447941 932490 2.071899296
Run 13 10.452252 1913463 21.521186 929316 2.058999917
Run 14 10.388245 1925252 21.445809 932583 2.064430421
Run 15 10.387833 1925329 21.638631 924272 2.083074593
-------- ----------------------- -------------------- --------------------------------------------------------- ------------------------------------------------------ --------------------------
Med 10.367294 1929143 21.468545 931595 2.070795426
Avg 10.39162587 1924686.8 21.51084593 929813.3333 2.070017359
Min 10.325387 1896872 21.257546 916469 2.058765061
Max 10.543672 1936973 21.822884 940842 2.069761275

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment