-
Notifications
You must be signed in to change notification settings - Fork 428
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mongoose mam id rework #4412
Mongoose mam id rework #4412
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #4412 +/- ##
==========================================
- Coverage 85.31% 85.30% -0.01%
==========================================
Files 550 550
Lines 33903 33905 +2
==========================================
Hits 28923 28923
- Misses 4980 4982 +2 ☔ View full report in Codecov by Sentry. |
31d8d79
to
4864740
Compare
395aa57
to
bb1ba36
Compare
This comment was marked as outdated.
This comment was marked as outdated.
4864740
to
cd5e55f
Compare
bb1ba36
to
1a17bba
Compare
This comment was marked as outdated.
This comment was marked as outdated.
cd5e55f
to
33fe8d6
Compare
```elixir def next_id() do Benchee.run( %{ "native code" => fn list -> Enum.map(list, fn t -> :mongoose_mam_id.next_unique(t) end) end, "pure erlang" => fn list -> Enum.map(list, fn t -> :mongoose_mam_id_2.next_unique(t) end) end, }, inputs: %{ "1M monotonic" => monotonic_list(100_000_000) }, formatters: [ {Benchee.Formatters.Console, extended_statistics: true} ], parallel: 1, time: 5, warmup: 0 ) end defp monotonic_list(size) do fun = fn(_, [head | _] = acc) -> next = head + :rand.uniform(20) - 1 [next | acc] end :lists.reverse(:lists.foldl(fun, [:rand.uniform(20)], :lists.seq(1, size))) end ``` returns ``` Operating System: macOS CPU Information: Apple M3 Pro Number of Available Cores: 12 Available memory: 36 GB Elixir 1.17.3 Erlang 27.1.2 JIT enabled: true Benchmark suite executing with the following configuration: warmup: 0 ns time: 5 s memory time: 0 ns reduction time: 0 ns parallel: 1 inputs: 1M monotonic Estimated total run time: 10 s Benchmarking native code with input 1M monotonic ... Benchmarking pure erlang with input 1M monotonic ... Calculating statistics... Formatting results... Name ips average deviation median 99th % pure erlang 0.31 3.23 s ±10.49% 3.23 s 3.47 s native code 0.28 3.54 s ±6.26% 3.54 s 3.70 s Comparison: pure erlang 0.31 native code 0.28 - 1.10x slower +0.32 s Extended statistics: Name minimum maximum sample size mode pure erlang 2.99 s 3.47 s 2 None native code 3.39 s 3.70 s 2 None ```
1a17bba
to
761b6ee
Compare
elasticsearch_and_cassandra_27 / elasticsearch_and_cassandra_mnesia / 761b6ee small_tests_27 / small_tests / 761b6ee small_tests_26 / small_tests / 761b6ee small_tests_27_arm64 / small_tests / 761b6ee ldap_mnesia_26 / ldap_mnesia / 761b6ee cluster_commands_SUITE:clustered:init_per_group{'EXIT',
{{verify_result,[],
[{times,20,
[{#{node => mongooseim2@localhost},[mongooseim@localhost],true},
{#{node => mongooseim@localhost},
[mongooseim2@localhost],
true}]}],
ok},
[{mongoose_helper,do_wait_until,2,
[{file,
"/home/circleci/project/big_tests/../test/common/mongoose_helper.erl"},
{line,359}]},
{distributed_helper,verify_result,2,
[{file,
"/home/circleci/project/big_tests/../test/common/distributed_helper.erl"},
{line,72}]},
{distributed_helper,add_node_to_cluster,2,
[{file,
"/home/circleci/project/big_tests/../test/common/distributed_helper.erl"},
{line,36}]},
{cluster_commands_SUITE,init_per_group,2,
[{file,
"/home/circleci/project/big_tests/tests/cluster_commands_SUITE.erl"},
{line,96}]},
{test_server,ts_tc,3,[{file,"test_server.erl"},{line,1793}]},
{test_server,run_test_case_eval1,6,
[{file,"test_server.erl"},{line,1390}]},
{test_server,run_test_case_eval,9,
[{file,"test_server.erl"},{line,1234}]}]}} cluster_commands_SUITE:join_successful_prompt{error,
{{verify_result,[],
[{times,20,
[{#{node => mongooseim2@localhost},[mongooseim@localhost],true},
{#{node => mongooseim@localhost},
[mongooseim2@localhost],
true}]}],
ok},
[{mongoose_helper,do_wait_until,2,
[{file,
"/home/circleci/project/big_tests/../test/common/mongoose_helper.erl"},
{line,359}]},
{distributed_helper,verify_result,2,
[{file,
"/home/circleci/project/big_tests/../test/common/distributed_helper.erl"},
{line,72}]},
{cluster_commands_SUITE,join_successful_prompt,1,
[{file,
"/home/circleci/project/big_tests/tests/cluster_commands_SUITE.erl"},
{line,215}]},
{test_server,ts_tc,3,[{file,"test_server.erl"},{line,1793}]},
{test_server,run_test_case_eval1,6,
[{file,"test_server.erl"},{line,1302}]},
{test_server,run_test_case_eval,9,
[{file,"test_server.erl"},{line,1234}]}]}} ldap_mnesia_27 / ldap_mnesia / 761b6ee dynamic_domains_mysql_redis_27 / mysql_redis / 761b6ee dynamic_domains_pgsql_mnesia_26 / pgsql_mnesia / 761b6ee dynamic_domains_pgsql_mnesia_27 / pgsql_mnesia / 761b6ee internal_mnesia_27 / internal_mnesia / 761b6ee pgsql_cets_27 / pgsql_cets / 761b6ee dynamic_domains_mssql_mnesia_27 / odbc_mssql_mnesia / 761b6ee cockroachdb_cets_27 / cockroachdb_cets / 761b6ee adhoc_SUITE:adhoc:disco_info_sm_commands{error,
{timeout_when_waiting_for_stanza,
[{escalus_client,wait_for_stanza,
[{client,<<"alice_disco_info_sm_commands_43@localhost/res1">>,
escalus_tcp,<0.2530.0>,
[{event_manager,<0.2513.0>},
{server,<<"localhost">>},
{username,<<"alicE_disco_info_sm_commands_43">>},
{resource,<<"res1">>}],
[{event_client,
[{event_manager,<0.2513.0>},
{server,<<"localhost">>},
{username,<<"alicE_disco_info_sm_commands_43">>},
{resource,<<"res1">>}]},
{resource,<<"res1">>},
{username,<<"alice_disco_info_sm_commands_43">>},
{server,<<"localhost">>},
{host,<<"localhost">>},
{port,5222},
{auth,{escalus_auth,auth_plain}},
{wspath,undefined},
{username,<<"alicE_disco_info_sm_commands_43">>},
{server,<<"localhost">>},
{password,<<"matygrysa">>},
{stream_id,<<"d8ad8b5a67a6a3fd">>}]},
5000],
[{file,
"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_client.erl"},
{line,136}]},
{adhoc_SUITE,'-disco_info_sm_commands/1-fun-0-',1,
[{file,"/home/circleci/project/big_tests/tests/adhoc_SUITE.erl"},
{line,131}]},
{escalus_story,story,4,
[{file,
"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
{line,72}]},
{test_server,ts_tc... pgsql_mnesia_27 / pgsql_mnesia / 761b6ee mssql_mnesia_27 / odbc_mssql_mnesia / 761b6ee pgsql_mnesia_26 / pgsql_mnesia / 761b6ee mysql_redis_27 / mysql_redis / 761b6ee small_tests_26 / small_tests / 761b6ee ldap_mnesia_26 / ldap_mnesia / 761b6ee cockroachdb_cets_27 / cockroachdb_cets / 761b6ee |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks ok
Here we rid of all native code, and most critically
Benchmark:
returns