Skip to content

Instantly share code, notes, and snippets.

@scohen
Last active November 2, 2016 21:19
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 scohen/cd99453854a1461941ccd29877a36417 to your computer and use it in GitHub Desktop.
Save scohen/cd99453854a1461941ccd29877a36417 to your computer and use it in GitHub Desktop.
CNT ACC (ms) OWN (ms)
Total 9819441 31339.117 31211.263
:suspend 5401 31466.805 0.000
:fprof.apply_start_stop/4 0 31339.117 0.011
anonymous fn/0 in :elixir_compiler_1.__FILE__/1 1 31339.104 0.009
:proc_lib.init_p/5 1 31338.951 0.009
:proc_lib.init_p_do_apply/3 1 31338.915 0.002
:gen.init_it/6 1 31338.913 0.002
:gen.init_it2/7 1 31338.911 0.002
Connection.init_it/6 1 31338.909 0.007
Connection.enter_connect/5 1 31338.711 0.005
MysqlPerfTest.MariaEx.query/2 1 31338.246 0.006
Mariaex.query/4 1 31338.237 0.009
DBConnection.prepare_execute/4 1 31338.218 0.009
Connection.enter_loop/6 1 31332.294 0.003
:gen_server.enter_loop/4 1 31332.291 0.003
:gen_server.enter_loop/5 1 31332.288 0.013
:gen_server.loop/6 25 31332.268 0.213
:gen_server.decode_msg/8 24 31332.265 0.081
:gen_server.handle_msg/5 24 31332.263 0.169
:gen_server.handle_common_reply/6 23 31332.100 0.091
DBConnection.decode/6 1 22445.959 0.029
DBConnection.Query.decode/3 1 22383.218 0.006
DBConnection.Query.Mariaex.Query.decode/3 1 22383.207 14.956
Enum.reduce/3 6 22368.172 0.014
Enum."-reduce/3-lists^foldl/2-0-"/3 315749 22368.158 1711.204
DBConnection.Query.Mariaex.Query.do_decode/3 1 22368.070 0.009
anonymous fn/4 in DBConnection.Query.Mariaex.Query.do_decode 315708 20644.558 1960.014
Mariaex.RowParser.decode_bin_rows/2 315708 18131.202 905.991
Mariaex.RowParser.decode_bin_rows/3 315708 17156.084 954.524
Mariaex.RowParser.decode_bin_rows/4 2841372 16118.575 7956.820
Mariaex.RowParser.decode_int64/5 631416 15182.336 1783.635
Mariaex.RowParser.decode_int8/5 947124 13369.971 2590.793
Mariaex.RowParser.decode_string/5 315708 9618.416 920.604
DBConnection.run_prepare_execute/4 1 8892.221 0.002
DBConnection.run_meter/3 1 8892.219 0.008
DBConnection.run_meter/5 1 8892.200 0.003
DBConnection.run/3 1 8892.197 0.007
DBConnection.run_begin/3 1 8886.079 0.012
anonymous fn/4 in DBConnection.run_meter/5 1 8886.002 0.010
anonymous fn/4 in DBConnection.run_prepare_execute/4 1 8885.987 0.005
DBConnection.handle/4 2 8885.948 0.026
DBConnection.describe_execute/4 1 8884.896 0.007
Mariaex.Protocol.handle_execute/4 1 8884.814 0.005
Mariaex.Protocol.binary_query_recv/2 315719 8884.751 1422.581
Mariaex.Protocol.handle_binary_query/3 315719 8883.169 819.096
Mariaex.Protocol.msg_recv/1 315753 6829.290 743.801
Mariaex.Protocol.msg_recv/3 315821 6069.555 1083.885
Mariaex.Protocol.msg_decode/2 315821 4650.816 1268.542
Mariaex.Messages.decode/2 315753 3293.307 1194.888
Mariaex.Messages.decode_msg/2 315753 1994.209 766.770
:lists.reverse/1 315739 1979.482 1256.152
:garbage_collect 323 1626.482 1626.482
Mariaex.Messages.__decode__/2 315753 1174.298 696.541
:lists.reverse/2 315715 514.236 514.236
anonymous fn/1 in DBConnection.Query.Mariaex.Query.decode/3 315708 494.778 494.778
Mariaex.Messages.decode_bin_row/1 315708 474.036 439.018
Mariaex.Protocol.msg_recv/4 68 296.250 2.749
Mariaex.Connection.Tcp.recv/3 68 289.039 0.192
:gen_tcp.recv/3 68 288.847 0.412
:inet_tcp.recv/3 68 287.980 0.190
:prim_inet.recv/3 68 287.790 0.170
:prim_inet.recv0/3 68 287.620 0.480
:gen_server.try_dispatch/3 23 282.329 0.068
:gen_server.try_dispatch/4 23 282.261 0.142
Connection.handle_info/2 21 282.063 0.067
Connection.handle_async/3 23 282.046 0.229
DBConnection.Connection.handle_info/2 21 281.734 0.180
Mariaex.Protocol.ping/1 21 281.510 0.212
Mariaex.Protocol.ping_recv/2 21 279.159 0.203
DBConnection.decode_log/5 1 62.712 0.009
DBConnection.log/6 1 62.701 0.011
DBConnection.log/2 1 62.642 0.003
IO.inspect/1 1 62.639 0.002
IO.inspect/2 1 62.637 0.005
IO.inspect/3 1 62.630 0.015
Inspect.Algebra.to_doc/2 420 46.898 0.978
Inspect.inspect/2 420 46.892 1.778
Inspect.Any.inspect/2 20 46.882 0.320
Inspect.Map.inspect/3 20 46.774 0.140
Inspect.Algebra.surround_many/5 62 46.688 0.138
Inspect.Algebra.surround_many/6 62 46.685 0.157
Inspect.Algebra.do_surround_many/7 62 46.682 0.278
Inspect.Algebra.do_surround_many/5 428 46.666 3.182
Inspect.List.keyword/2 95 46.509 0.693
Inspect.List.inspect/2 44 38.921 0.372
Inspect.Tuple.inspect/2 1 35.356 0.007
Inspect.BitString.inspect/2 77 21.011 0.446
Inspect.BitString.escape/2 77 17.467 0.155
Inspect.BitString.escape/3 1369 17.312 7.956
Inspect.Algebra.format/2 1 15.327 0.005
Inspect.Algebra.format/3 2761 15.321 8.373
:prim_inet.async_recv/3 68 9.497 0.557
:prim_inet.ctl_cmd/3 77 8.754 0.363
:erlang.port_control/3 77 8.391 0.474
:erts_internal.port_control/3 77 7.881 7.881
String.printable?/1 3953 7.798 7.798
Inspect.Algebra.fits?/2 3026 6.486 6.462
DBConnection.Connection.connect/2 1 6.412 0.011
Mariaex.Protocol.connect/1 1 6.382 0.029
DBConnection.checkout/2 1 6.095 0.008
DBConnection.Connection.checkout/2 1 6.079 0.009
Connection.call/3 1 6.051 0.001
:gen_server.call/3 1 6.050 0.004
:gen.call/4 1 6.046 0.003
:gen.do_for_proc/2 1 6.043 0.001
anonymous fn/4 in :gen.call/4 1 6.042 0.004
:gen.do_call/4 1 6.038 0.014
Inspect.Algebra.do_join/3 366 5.839 1.486
Inspect.BitString.append/2 2584 4.609 4.543
Inspect.Atom.inspect/1 187 4.172 1.045
Inspect.Algebra.glue/2 366 3.827 2.159
Mariaex.Protocol.handshake_recv/2 2 3.092 0.007
Inspect.List.key_to_binary/1 95 2.976 0.315
Mariaex.Connection.Tcp.connect/4 1 2.951 0.009
:gen_tcp.connect/4 1 2.769 0.007
:gen_tcp.connect1/4 1 2.749 0.007
Inspect.Integer.inspect/2 204 2.744 1.215
Mariaex.Protocol.handle_handshake/3 2 2.683 0.035
Mariaex.Protocol.msg_send/3 50 2.382 0.253
Inspect.Algebra.concat/2 1317 2.029 2.029
Inspect.Atom.valid_identifier?/1 899 1.916 1.916
Inspect.Atom.valid_atom_identifier?/1 102 1.900 0.234
Inspect.impl_for!/1 420 1.875 1.325
Mariaex.Connection.Tcp.send/2 25 1.739 0.078
Inspect.Atom.inspect/2 92 1.706 0.195
Inspect.Atom.valid_atom_piece?/1 102 1.666 0.331
:gen_tcp.send/2 25 1.661 0.196
:inet_tcp.getaddrs/2 1 1.553 0.002
:inet.getaddrs_tm/3 1 1.551 0.005
:inet.gethostbyname_tm/3 1 1.498 0.004
:inet.gethostbyname_tm/4 1 1.484 0.002
:inet.gethostbyname_tm_native/4 1 1.482 0.003
:inet_gethost_native.gethostbyname/2 1 1.478 0.001
:inet_gethost_native.getit/4 1 1.477 0.002
:inet_gethost_native.getit/2 1 1.475 0.020
:inet_tcp.send/2 25 1.263 0.077
:prim_inet.send/3 25 1.186 0.173
:gen_tcp.try_connect/6 1 1.161 0.004
:inet_tcp.connect/4 1 1.153 0.002
:inet_tcp.do_connect/4 1 1.151 0.006
Mariaex.Protocol.handle_prepare/3 2 1.048 0.014
:erlang.port_command/3 25 1.013 0.218
Inspect.Atom.valid_ref_identifier?/1 122 0.985 0.185
:erlang.integer_to_binary/2 204 0.982 0.678
Mariaex.Protocol.password/3 1 0.947 0.002
Mariaex.Protocol.mysql_native_password/2 1 0.945 0.012
Inspect.Algebra.surround/3 62 0.939 0.523
Mariaex.Protocol.prepare_recv/2 10 0.931 0.036
Mariaex.Protocol.bxor_binary/2 1 0.854 0.009
MysqlPerfTest.MariaEx.start/0 1 0.846 0.023
Mariaex.start_link/1 1 0.815 0.002
DBConnection.start_link/2 1 0.813 0.006
DBConnection.Connection.start_link/2 1 0.802 0.002
Inspect.Atom.valid_ref_piece?/1 60 0.800 0.219
DBConnection.Connection.start_link/3 1 0.800 0.002
DBConnection.Connection.start_link/4 1 0.798 0.003
:erts_internal.port_command/3 25 0.795 0.795
:prim_inet.connect/4 2 0.759 0.006
Connection.start_link/3 1 0.747 0.001
Connection.start/4 1 0.746 0.002
:prim_inet.connect0/3 1 0.744 0.005
:gen.start/5 1 0.737 0.002
:gen.do_spawn/5 1 0.735 0.004
List.zip/1 1 0.729 0.002
List.do_zip/2 21 0.727 0.140
:proc_lib.start_link/5 1 0.724 0.005
Inspect.Map.traverse_fun/1 20 0.716 0.107
Version.match?/2 1 0.690 0.002
Version.match?/3 2 0.688 0.010
:proc_lib.sync_wait/2 1 0.680 0.006
:inet_db.lookup_socket/1 93 0.657 0.445
Inspect.List.keyword?/1 156 0.630 0.484
Mariaex.Protocol.handle_prepare_send/3 10 0.627 0.056
Mariaex.Protocol.prepare_may_recv_more/2 10 0.624 0.020
Mariaex.Messages.decode_column_definition_41/1 16 0.604 0.204
Version.parse_requirement/1 1 0.576 0.002
Version.Parser.parse_requirement/1 1 0.574 0.004
Inspect.impl_for/1 420 0.550 0.550
Version.Parser.to_matchspec/1 1 0.519 0.007
Inspect.Algebra.decrement/1 366 0.512 0.512
Version.Parser.to_condition/1 4 0.498 0.037
Inspect.Algebra.break/0 366 0.462 0.462
List."-do_zip/2-lists^mapfoldl/2-0-"/3 63 0.453 0.204
Inspect.Algebra.indent/1 86 0.413 0.289
IO.puts/2 1 0.383 0.004
:io.put_chars/2 1 0.379 0.003
Mariaex.Coder.Utils.length_encoded_string/1 96 0.377 0.256
:io.o_request/3 1 0.376 0.004
Mariaex.Messages.encode/2 25 0.374 0.135
:io.request/2 1 0.372 0.005
Mariaex.Messages.decode_ok_resp/1 23 0.347 0.217
Version.Parser.parse_version/2 5 0.346 0.066
:erlang.integer_to_binary/1 211 0.312 0.312
Version.Parser.parse_condition/2 4 0.300 0.010
Inspect.Integer.base_to_value/1 204 0.287 0.287
:io.execute_request/2 1 0.283 0.014
:prim_inet.setopts/2 5 0.280 0.022
Inspect.Integer.prepend_prefix/2 204 0.260 0.260
Mariaex.Protocol.text_query_recv/2 1 0.257 0.004
anonymous fn/2 in List.do_zip/2 42 0.249 0.146
:inet.open/8 1 0.248 0.008
Mariaex.Messages.encode_msg/1 25 0.239 0.068
Mariaex.Coder.Utils.length_encoded_integer/1 159 0.239 0.239
Version.Parser.parse_condition/1 3 0.235 0.008
:prim_inet.encode_opt_val/1 5 0.207 0.018
Mariaex.Protocol.get_command/1 4 0.202 0.046
:erlang.port_get_data/1 93 0.197 0.197
Access.get/2 21 0.196 0.039
:prim_inet.enc_opt_val/2 11 0.189 0.018
DBConnection.Connection.init/1 1 0.185 0.010
:prim_inet.enc_opt_val/4 5 0.180 0.044
:erlang.atom_to_binary/2 124 0.180 0.180
Mariaex.Messages.__encode__/1 25 0.171 0.087
:inet.setopts/2 3 0.160 0.011
Access.get/3 21 0.157 0.060
Mariaex.Protocol.default_opts/1 1 0.156 0.017
DBConnection.Backoff.new/1 1 0.151 0.005
:erlang.atom_to_list/1 95 0.146 0.146
:prim_inet.enc_time/1 69 0.145 0.145
Enum.map/2 1 0.145 0.003
Enum."-map/2-lists^map/1-0-"/2 9 0.142 0.056
Mariaex.Protocol.ping_handle/3 21 0.141 0.056
:inet.connect_options/2 1 0.138 0.009
Version.Parser.matchable_to_string/1 2 0.135 0.020
:inet_gethost_native.parse_address/2 1 0.132 0.010
:gen_server.try_handle_call/4 1 0.130 0.005
:binary.copy/2 88 0.129 0.129
Connection.handle_call/3 1 0.125 0.009
Regex.run/2 5 0.123 0.008
Keyword.get/3 23 0.121 0.081
String.Chars.to_string/1 9 0.118 0.031
String.downcase/1 5 0.117 0.013
Mariaex.Protocol.setopts/3 2 0.116 0.008
:inet.getopts/2 1 0.115 0.004
Regex.run/3 5 0.115 0.036
DBConnection.Connection.handle_call/3 1 0.115 0.006
:inet.con_opt/3 4 0.113 0.006
:inet_gethost_native.pick_names/1 1 0.112 0.003
:inet.con_add/5 3 0.111 0.011
:inet_gethost_native.pick_names/2 2 0.109 0.013
Mariaex.Connection.Tcp.setopts/2 2 0.108 0.004
DBConnection.Connection.handle_checkout/5 1 0.106 0.010
String.Casing.downcase/1 5 0.104 0.018
:prim_inet.getopts/2 1 0.103 0.004
Mariaex.Protocol.get_3_digits_version/1 1 0.102 0.009
:prim_inet.type_value/3 10 0.100 0.015
Inspect.Algebra.group/1 62 0.099 0.099
Access.fetch/2 21 0.097 0.064
:erlang.make_fun/3 63 0.096 0.096
:inet_gethost_native.ndx/2 1 0.093 0.003
:inet.add_opt/4 3 0.093 0.015
List.to_tuple/1 20 0.093 0.060
Inspect.Algebra.nest/2 62 0.091 0.091
:inet_gethost_native.ndx/4 30 0.090 0.080
Kernel.Utils.destructure/2 5 0.090 0.009
Mariaex.Messages.decode_handshake/1 1 0.089 0.022
Mariaex.Protocol.checkout/1 1 0.088 0.007
DBConnection.Backoff.new/3 1 0.087 0.007
String.Casing.downcase/2 31 0.086 0.086
anonymous fn/1 in DBConnection.Query.Mariaex.Query.do_decode 8 0.086 0.060
:prim_inet.type_value_default/3 10 0.085 0.017
:unicode.characters_to_binary/2 4 0.084 0.084
:io.io_request/2 1 0.084 0.007
Kernel.Utils.destructure_list/2 26 0.081 0.067
Mariaex.Messages.encode_text_cmd/1 23 0.079 0.079
DBConnection.Backoff.seed/0 1 0.079 0.018
String.split/3 2 0.073 0.010
:prim_inet.open/4 1 0.072 0.001
:prim_inet.open/6 1 0.071 0.012
:lists.keyfind/3 56 0.070 0.070
:prim_inet.enc_value/3 7 0.069 0.015
:prim_inet.type_value_1/3 10 0.068 0.015
Mariaex.Protocol.send_text_query/2 1 0.066 0.003
Inspect.Atom.only_elixir?/1 40 0.066 0.066
DBConnection."-run_begin/3-after$^0/0-0-"/2 1 0.065 0.006
:maps.remove/2 40 0.064 0.064
Version.to_matchable/2 1 0.064 0.007
System.get_env/1 4 0.064 0.017
Inspect.List.printable?/1 41 0.063 0.063
Mariaex.Coder.Utils.auth_plugin_data2/1 1 0.060 0.006
:prim_inet.async_connect0/3 1 0.059 0.006
DBConnection.run_end/2 1 0.059 0.008
:erlang.setelement/3 28 0.057 0.057
Version.Parser.parse_version/1 1 0.057 0.001
DBConnection.put_info/3 3 0.056 0.028
Connection.handle_cast/2 2 0.056 0.006
:maps.keys/1 40 0.055 0.055
:prim_inet.enc_value_default/3 7 0.054 0.010
:prim_inet.type_value_2/2 14 0.053 0.030
:prim_inet.is_sockopt_val/2 3 0.053 0.013
String.strip/2 1 0.053 0.002
List.to_list/1 42 0.053 0.053
Version.Parser.lexer/2 8 0.051 0.019
String.trim/2 1 0.051 0.005
:inet_parse.visible_string/1 1 0.048 0.001
DBConnection.Connection.start_opts/2 1 0.048 0.002
:prim_inet.encode_opts/1 1 0.047 0.003
:inet_parse.is_vis1/1 30 0.047 0.047
Inspect.Reference.inspect/2 2 0.047 0.015
Keyword.take/2 1 0.046 0.001
DBConnection.LogEntry.new/5 1 0.046 0.004
DBConnection.Connection.handle_timeout/1 22 0.046 0.046
:re.run/3 6 0.045 0.045
List.do_zip_each/2 42 0.045 0.045
Keyword.put_new/3 8 0.045 0.029
Keyword."-take/2-lists^filter/1-0-"/2 6 0.045 0.018
:prim_inet.enc_value_1/3 7 0.044 0.012
:prim_inet.enc_opts/1 4 0.044 0.007
String.split_each/4 3 0.044 0.014
:prim_inet.enc_opts/2 3 0.042 0.019
:prim_inet.decode_opt_val/1 1 0.042 0.003
DBConnection.LogEntry.parse_times/2 1 0.042 0.007
Connection.cast/2 2 0.042 0.005
:inet.bind/3 1 0.041 0.002
:binary.split/2 6 0.041 0.041
Mariaex.Protocol.activate/2 1 0.041 0.003
:crypto.hash/2 2 0.040 0.011
Version.Parser.parse_pre/1 5 0.040 0.010
String.Chars.impl_for!/1 9 0.040 0.028
:prim_inet.dec_opt_val/1 4 0.039 0.013
:prim_inet.bind/3 2 0.039 0.007
String.Chars.Integer.to_string/1 7 0.037 0.021
Keyword.update/4 8 0.037 0.025
GenServer.cast/2 2 0.037 0.011
anonymous fn/3 in DBConnection.Query.Mariaex.Query.decode/3 8 0.037 0.029
:prim_inet.type_opt/2 14 0.036 0.020
String.to_charlist/1 5 0.036 0.014
:proc_lib.spawn_opt/4 1 0.035 0.004
anonymous fn/2 in Mariaex.Protocol.bxor_binary/2 20 0.035 0.028
DBConnection.checkin/3 1 0.035 0.005
:prim_inet.enum_val/2 26 0.034 0.034
:ets.test_ms/2 1 0.034 0.005
:rand.seed_s/1 1 0.033 0.006
:prim_inet.enc_value_2/2 7 0.032 0.018
:prim_inet.dec_opt_val/3 3 0.031 0.012
DBConnection.Connection.handle_cast/2 2 0.031 0.005
Mariaex.Protocol.handle_text_query/3 1 0.030 0.002
DBConnection.Connection.checkin/3 1 0.030 0.003
:erlang.match_spec_test/3 1 0.029 0.029
DBConnection.Backoff.min_max/1 1 0.029 0.005
DBConnection.parse/4 1 0.029 0.003
Mariaex.Protocol.handle_ok_packet/3 1 0.028 0.010
Enum.filter/2 1 0.028 0.003
DBConnection.Backoff.rand_module/0 1 0.028 0.005
:maps.to_list/1 20 0.027 0.027
:inet.tcp_module/2 1 0.027 0.002
:crypto.hash_update/2 2 0.027 0.009
String.trim_trailing/2 1 0.027 0.003
Process.put/2 4 0.027 0.018
anonymous fn/2 in Keyword.take/2 5 0.027 0.009
DBConnection.Query.parse/2 1 0.026 0.006
DBConnection.Connection.handle_next/2 1 0.026 0.012
:inet.tcp_module_1/2 1 0.025 0.002
:crypto.hash/4 2 0.025 0.007
String.replace_trailing/3 1 0.024 0.003
String.do_splitter/3 2 0.024 0.016
:inet.mod/4 1 0.023 0.001
:erlang.ref_to_list/1 2 0.023 0.023
Version.Parser.parse_pre/2 2 0.023 0.012
Mariaex.Protocol.add_column/2 16 0.023 0.023
GenServer.do_send/2 2 0.023 0.008
Enum.join/2 1 0.023 0.005
:unicode.characters_to_list/1 5 0.022 0.014
:lists.keydelete/3 3 0.022 0.004
:inet.mod/6 4 0.022 0.010
Module.concat/2 1 0.022 0.002
Mariaex.Protocol.capabilities/1 1 0.022 0.004
Enum.member?/2 6 0.022 0.016
String.replace_trailing/6 1 0.021 0.013
:rand.seed_s/2 1 0.020 0.005
:erlang.list_to_tuple/1 20 0.020 0.020
:elixir_aliases.concat/1 1 0.020 0.004
:application.get_key/2 1 0.019 0.002
String.trim_leading/2 1 0.019 0.002
Mariaex.Protocol.count_down/2 16 0.019 0.019
Mariaex.Column.__struct__/0 16 0.019 0.019
DBConnection.Query.impl_for!/1 4 0.019 0.014
:lists.keydelete3/3 8 0.018 0.018
Mariaex.Protocol.cache_insert/2 1 0.018 0.003
DBConnection.Query.encode/3 1 0.018 0.004
:erlang.spawn_opt/4 1 0.017 0.003
:erlang.iolist_to_binary/1 9 0.017 0.017
:erlang.binary_to_integer/1 16 0.017 0.017
:erlang.binary_to_atom/2 5 0.017 0.017
:application_controller.get_key/2 1 0.017 0.005
String.replace_leading/3 1 0.017 0.002
String.duplicate/2 2 0.017 0.012
String.capitalize/1 1 0.017 0.006
List.to_string/1 2 0.017 0.006
DBConnection.fetch_info/1 2 0.017 0.005
:prim_inet.type_opt_1/1 14 0.016 0.016
:crypto.hash_nif/2 2 0.016 0.016
DBConnection.delete_info/1 1 0.016 0.008
:unicode.characters_to_binary/1 3 0.015 0.008
:erlang.send/2 2 0.015 0.015
:erlang.open_port/2 1 0.015 0.003
String.replace_leading/6 1 0.015 0.006
Mariaex.Messages.__type__/2 8 0.015 0.015
Mariaex.LruCache.insert/4 1 0.015 0.006
Keyword.get/2 2 0.015 0.005
:ets.lookup/2 5 0.014 0.014
:erlang.spawn_opt/1 1 0.014 0.014
:crypto.hash_update/4 2 0.014 0.006
Kernel.Utils.destructure_nil/1 8 0.014 0.014
DBConnection.Query.Mariaex.Query.parse/2 1 0.014 0.011
:erlang.put/2 6 0.013 0.013
:elixir_aliases.do_concat/1 2 0.013 0.004
anonymous fn/1 in :rand.mk_alg/1 1 0.012 0.001
:lists.member/2 12 0.012 0.012
:inet."-setopts/2-lc$^0/1-0-"/1 6 0.012 0.012
:erts_internal.open_port/2 1 0.012 0.012
:erlang.demonitor/2 3 0.012 0.012
String.Chars.impl_for/1 9 0.012 0.012
anonymous fn/3 in Enum.filter/2 3 0.012 0.009
anonymous fn/2 in DBConnection.LogEntry.parse_times/2 3 0.012 0.008
DBConnection.get_info/1 2 0.012 0.007
:rand.exsplus_seed/1 1 0.011 0.011
:ets.new/2 2 0.011 0.011
Version.Parser.nillify/1 10 0.011 0.011
Mariaex.Protocol.set_initial_ssl_conn_state/1 1 0.011 0.003
anonymous fn/3 in Enum.join/2 1 0.011 0.002
DBConnection.Query.Mariaex.Query.type_to_atom/1 8 0.011 0.011
:os.getenv/1 4 0.010 0.010
:erlang.monitor/2 3 0.010 0.010
String.to_char_list/1 1 0.010 0.002
Mariaex.defaults/1 1 0.010 0.003
DBConnection.Query.Mariaex.Query.encode/3 1 0.010 0.004
:proc_lib.get_my_name/0 1 0.009 0.003
:inet_db.res_option/1 1 0.009 0.004
:inet_db.db_get/1 2 0.009 0.005
:erlang.monotonic_time/0 4 0.009 0.009
String.Chars.List.to_string/1 1 0.009 0.001
Mariaex.Protocol.digits/1 1 0.009 0.002
Mariaex.Protocol.cache_lookup/2 1 0.009 0.004
Mariaex.Cache.new/0 1 0.009 0.002
Keyword.delete/2 1 0.009 0.001
Kernel.=~/2 1 0.009 0.002
DBConnection.Query.describe/2 1 0.009 0.004
DBConnection.Connection.demonitor/1 1 0.009 0.004
DBConnection.key/1 6 0.009 0.009
:unicode.characters_to_list/2 5 0.008 0.008
:prim_inet.enc_opt/1 8 0.008 0.008
:inet_gethost_native.pick_addresses_v4/2 2 0.008 0.008
:inet."-getopts/2-lc$^0/1-0-"/1 4 0.008 0.008
Keyword."-delete/2-lists^filter/1-0-"/2 2 0.008 0.006
DBConnection.Query.Mariaex.Query.column_name/2 8 0.008 0.008
:inet_db.tcp_module/0 1 0.007 0.002
:inet_db.register_socket/2 1 0.007 0.003
:inet.start_timer/1 1 0.007 0.003
:erlang.make_ref/0 5 0.007 0.007
:elixir_aliases.do_concat/2 2 0.007 0.006
:crypto.notsup_to_error/1 6 0.007 0.007
:application.get_env/2 1 0.007 0.002
Version.Parser.valid_requirement?/1 1 0.007 0.002
String.split/2 1 0.007 0.001
Regex.match?/2 1 0.007 0.003
Mariaex.Protocol.digits/2 3 0.007 0.005
Mariaex.LruCache.new/1 1 0.007 0.003
Keyword.pop/2 1 0.007 0.001
Kernel.struct/2 1 0.007 0.002
Connection.reply/2 1 0.007 0.002
:proc_lib.proc_info/2 1 0.006 0.003
:inet.stop_timer/1 1 0.006 0.003
:erlang.binary_to_list/1 3 0.006 0.006
:crypto.hash_init/1 1 0.006 0.002
:crypto.hash_final/1 1 0.006 0.003
Process.delete/1 1 0.006 0.004
Mariaex.Protocol.clean_state/1 3 0.006 0.006
Keyword.pop/3 1 0.006 0.003
Enum.drop/2 1 0.006 0.002
DBConnection.Connection.get_idle/1 1 0.006 0.002
:gen_server.reply/2 1 0.005 0.005
:gen.debug_options/2 1 0.005 0.004
:ets.insert/2 1 0.005 0.005
:crypto.hash_update_nif/2 2 0.005 0.005
:binary.part/3 4 0.005 0.005
:application_controller.get_env/2 1 0.005 0.003
Version.Parser.valid_requirement?/2 2 0.005 0.005
Version.Parser.main_condition/2 5 0.005 0.005
String.maybe_compile_pattern/1 1 0.005 0.003
Mariaex.LruCache.lookup/2 1 0.005 0.002
Kernel.struct/3 1 0.005 0.004
Enum.zip/2 1 0.005 0.002
DBConnection.Query.impl_for/1 4 0.005 0.005
:proc_lib.ensure_link/1 1 0.004 0.003
:proc_lib.check_for_monitor/1 1 0.004 0.003
:prim_inet.dec_value/2 3 0.004 0.004
:prim_inet.dec_opt/1 3 0.004 0.004
:inet_gethost_native.ensure_started/0 1 0.004 0.002
:inet.timeout/1 1 0.004 0.002
:gen.spawn_opts/1 1 0.004 0.003
:erlang.start_timer/3 1 0.004 0.004
:erlang.port_set_data/2 1 0.004 0.004
:erlang.max/2 4 0.004 0.004
:crypto.max_bytes/0 4 0.004 0.004
Mariaex.Messages.decode_eof_resp/1 3 0.004 0.004
Mariaex.Messages.decode_column_count/1 1 0.004 0.002
Enum.do_drop/2 3 0.004 0.004
DBConnection.LogEntry.parse_time/2 3 0.004 0.004
:rand.mk_alg/1 1 0.003 0.003
:prim_inet.type_value/2 3 0.003 0.003
:prim_inet.ip4_to_bytes/1 2 0.003 0.003
:prim_inet.enc_value/2 3 0.003 0.003
:inet_tcp.translate_ip/1 1 0.003 0.002
:gen.timeout/1 1 0.003 0.002
:erlang.process_info/2 1 0.003 0.003
:erlang.phash2/1 1 0.003 0.003
:erlang.list_to_binary/1 1 0.003 0.003
:erlang.cancel_timer/1 1 0.003 0.003
:erlang.++/2 2 0.003 0.003
:crypto.hash_init_nif/1 1 0.003 0.003
:binary.split/3 1 0.003 0.003
:binary.match/2 2 0.003 0.003
Version.Parser.pre_condition/2 2 0.003 0.003
anonymous fn/1 in Version.Parser.lexer/2 3 0.003 0.003
Process.get/2 2 0.003 0.003
MysqlPerfTest.ConnectionParams.password/0 1 0.003 0.003
MysqlPerfTest.query/0 1 0.003 0.003
anonymous fn/1 in Mariaex.Protocol.default_opts/1 1 0.003 0.002
Mariaex.Messages.encode_handshake_resp/1 1 0.003 0.003
Keyword.fetch/2 1 0.003 0.002
GenServer.cast_msg/1 2 0.003 0.003
Enum.do_zip/3 1 0.003 0.002
:proc_lib.init_ack/2 1 0.002 0.002
:os.timestamp/0 1 0.002 0.002
:inet_gethost_native.expand_default_name/2 1 0.002 0.002
:fprof."-apply_start_stop/4-after$^0/0-0-"/3 1 0.002 0.002
:ets.info/2 1 0.002 0.002
:erlang.whereis/1 1 0.002 0.002
:erlang.unique_integer/0 1 0.002 0.002
:erlang.tuple_to_list/1 1 0.002 0.002
:erlang.system_time/0 1 0.002 0.002
:erlang.send/3 1 0.002 0.002
:erlang.read_timer/1 1 0.002 0.002
:erlang.group_leader/0 1 0.002 0.002
:erlang.erase/1 1 0.002 0.002
:crypto.hash_final_nif/1 1 0.002 0.002
:binary.compile_pattern/1 1 0.002 0.002
String.Casing.titlecase_once/1 1 0.002 0.002
String.parts_to_index/1 1 0.002 0.002
MysqlPerfTest.ConnectionParams.username/0 1 0.002 0.002
Mariaex.Result.__struct__/0 1 0.002 0.002
Mariaex.Query.__struct__/0 2 0.002 0.002
Mariaex.Protocol.request_type/1 1 0.002 0.002
Mariaex.Messages.encode_stmt_execute/1 1 0.002 0.002
Mariaex.Messages.decode_stmt_prepare_ok/1 1 0.002 0.002
Mariaex.Connection.Tcp.recv_active/3 1 0.002 0.002
anonymous fn/2 in Keyword.delete/2 1 0.002 0.002
DBConnection.LogEntry.__struct__/0 1 0.002 0.002
DBConnection.Connection.cancel_timer/1 1 0.002 0.002
DBConnection.Backoff.reset/1 1 0.002 0.002
:queue.out/1 1 0.001 0.001
:queue.new/0 1 0.001 0.001
:proc_lib.trans_init/3 1 0.001 0.001
:proc_lib.get_ancestors/0 1 0.001 0.001
:prim_inet.protocol2drv/1 1 0.001 0.001
:prim_inet.enc_type/1 1 0.001 0.001
:prim_inet.enc_family/1 1 0.001 0.001
:inet_tcp.getserv/1 1 0.001 0.001
:inet_db.res_optname/1 1 0.001 0.001
:inet.translate_ip/2 1 0.001 0.001
:inet.gethostbyname_tm/5 1 0.001 0.001
:inet.connect_options/0 1 0.001 0.001
:gen.get_proc_name/1 1 0.001 0.001
:gen.get_parent/0 1 0.001 0.001
:elixir_aliases.to_partial/1 1 0.001 0.001
Version.Parser.to_condition/2 1 0.001 0.001
Version.Parser.no_pre_condition/1 1 0.001 0.001
Version.Parser.approximate_upper/1 1 0.001 0.001
String.Chars.Atom.to_string/1 1 0.001 0.001
MysqlPerfTest.ConnectionParams.port/0 1 0.001 0.001
MysqlPerfTest.ConnectionParams.host/0 1 0.001 0.001
MysqlPerfTest.ConnectionParams.database/0 1 0.001 0.001
Mariaex.Protocol.normalize_port/1 1 0.001 0.001
Mariaex.Protocol.handle_recv_buffer/2 1 0.001 0.001
Mariaex.Protocol.connected/1 1 0.001 0.001
Inspect.Opts.__struct__/0 1 0.001 0.001
Inspect.Algebra.default_mode/1 1 0.001 0.001
DBConnection.Query.Mariaex.Query.parameters_to_binary/2 1 0.001 0.001
DBConnection.Query.Mariaex.Query.describe/2 1 0.001 0.001
DBConnection.Connection.start_timer/2 1 0.001 0.001
DBConnection.log_result/1 1 0.001 0.001
DBConnection.entry_result/1 1 0.001 0.001
@fishcakez
Copy link

@scohen I am off but I meant this pattern. It ensures continuous use of binary as first argument (for bin_opt_info optimisations), and uses integers/Bitwise for the null map. I copied string because maybe wasn't clear for that one.

def decode_bin_rows(packet, fields, nullbin_size) do
  << 0 :: 8, nullint :: size(nullbin_size)-little-unit(8), rest :: binary >> = packet
  decode_bin_rows(rest, fields, nullint, 1 <<< 2 , [])
end

def decode_bin_rows(<<rest::bits>>, [_ | fields], nullint, idx, acc) when (nullint &&& idx) === idx do
  decode_bin_rows(rest, fields, nullint, idx <<< 1, [nil | acc])
end
def decode_bin_rows(<<rest::bits>>, [:string | fields], nullint, idx, acc) do
  decode_string(rest, fields, nullint, idx <<< 1, acc)
end

def decode_string(<<len::8, string::size(len)-binary, rest::bits>>, fields, nullint, idx, acc) when len <= 250 do
  decode_bin_rows(rest, fields, nullint, idx, [string | acc])
end
def decode_string(<<252::8, len::16-little, string::size(len)-binary, rest::bits>>, fields, nullint, idx, acc) do
  decode_bin_rows(rest, fields, nullint, idx, [string | acc])
end
def decode_string(<<253::8, len::24-little, string::size(len)-binary, rest::bits>>, fields, nullint, idx, acc) do
  decode_bin_rows(rest, fields, nullint, idx, [string | acc])
end
def decode_string(<<254::8, len::64-little, string::size(len)-binary, rest::bits>>, fields, nullint, idx, acc) do
  decode_bin_rows(rest, fields, nullint, idx, [string | acc])
end

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