-
Notifications
You must be signed in to change notification settings - Fork 429
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
Cache router, filter, and process handlers into funs #4068
Conversation
34876bc
to
d464a70
Compare
This comment was marked as outdated.
This comment was marked as outdated.
6c0b647
to
da68910
Compare
This comment was marked as outdated.
This comment was marked as outdated.
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #4068 +/- ##
=======================================
Coverage 83.89% 83.90%
=======================================
Files 526 526
Lines 33168 33172 +4
=======================================
+ Hits 27826 27832 +6
+ Misses 5342 5340 -2
☔ View full report in Codecov by Sentry. |
Following the advise from https://www.erlang.org/doc/efficiency_guide/functions.html#function-calls > Caching callback functions into funs may be more efficient in the long run than apply calls for frequently-used callbacks.
da68910
to
c7074ee
Compare
elasticsearch_and_cassandra_25 / elasticsearch_and_cassandra_mnesia / c7074ee small_tests_24 / small_tests / c7074ee small_tests_25 / small_tests / c7074ee small_tests_25_arm64 / small_tests / c7074ee ldap_mnesia_24 / ldap_mnesia / c7074ee dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / c7074ee ldap_mnesia_25 / ldap_mnesia / c7074ee mod_global_distrib_SUITE:hosts_refresher:test_host_refreshing{error,
{{trees_for_connections_present,true,[{times,100,false}],ok},
[{mongoose_helper,do_wait_until,2,
[{file,"/home/circleci/project/big_tests/tests/mongoose_helper.erl"},
{line,357}]},
{mod_global_distrib_SUITE,test_host_refreshing,1,
[{file,
"/home/circleci/project/big_tests/tests/mod_global_distrib_SUITE.erl"},
{line,384}]},
{test_server,ts_tc,3,[{file,"test_server.erl"},{line,1782}]},
{test_server,run_test_case_eval1,6,
[{file,"test_server.erl"},{line,1291}]},
{test_server,run_test_case_eval,9,
[{file,"test_server.erl"},{line,1223}]}]}} dynamic_domains_mssql_mnesia_25 / odbc_mssql_mnesia / c7074ee dynamic_domains_pgsql_mnesia_25 / pgsql_mnesia / c7074ee dynamic_domains_mysql_redis_25 / mysql_redis / c7074ee pgsql_mnesia_24 / pgsql_mnesia / c7074ee internal_mnesia_25 / internal_mnesia / c7074ee pgsql_mnesia_25 / pgsql_mnesia / c7074ee mysql_redis_25 / mysql_redis / c7074ee mssql_mnesia_25 / odbc_mssql_mnesia / c7074ee ldap_mnesia_25 / ldap_mnesia / c7074ee mod_global_distrib_SUITE:hosts_refresher:test_host_refreshing{error,
{{trees_for_connections_present,true,[{times,100,false}],ok},
[{mongoose_helper,do_wait_until,2,
[{file,"/home/circleci/project/big_tests/tests/mongoose_helper.erl"},
{line,357}]},
{mod_global_distrib_SUITE,test_host_refreshing,1,
[{file,
"/home/circleci/project/big_tests/tests/mod_global_distrib_SUITE.erl"},
{line,384}]},
{test_server,ts_tc,3,[{file,"test_server.erl"},{line,1782}]},
{test_server,run_test_case_eval1,6,
[{file,"test_server.erl"},{line,1291}]},
{test_server,run_test_case_eval,9,
[{file,"test_server.erl"},{line,1223}]}]}} ldap_mnesia_25 / ldap_mnesia / c7074ee |
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.
yea, probably marginally faster.
but only because we store it in a persistent term.
If it was in ETS table than copying a bigger term would defeat the gains :D
Following the advise from https://www.erlang.org/doc/efficiency_guide/functions.html#function-calls
Similar logic was applied in OTP itself in
erlang/otp#5831
erlang/otp#7419