Skip to content

Instantly share code, notes, and snippets.

@brunoro
Last active December 18, 2015 15:18
Show Gist options
  • Save brunoro/5803019 to your computer and use it in GitHub Desktop.
Save brunoro/5803019 to your computer and use it in GitHub Desktop.
Profiling results for Lists.duplicate and String.duplicate on the implementation of repeat/2 on wadler.ex
FUNCTION CALLS % TIME [uS / CALLS]
-------- ----- --- ---- [----------]
'Elixir.Wadler':group/1 5 0.00 0 [ 0.00]
'Elixir.Binary.Inspect.Utils':'-group_maybe/2-fun-0-'/1 1 0.00 0 [ 0.00]
'Elixir.Wadler':glue/2 27 0.00 1 [ 0.04]
gen:call/4 1 0.00 1 [ 1.00]
gen:do_call/4 1 0.00 1 [ 1.00]
gen_server:call/3 1 0.00 1 [ 1.00]
'Elixir.Binary.Inspect.Utils':'-group_maybe/3-fun-0-'/1 4 0.00 1 [ 0.25]
code:ensure_loaded/1 9 0.01 2 [ 0.22]
'Elixir.Wadler':render/1 80 0.01 3 [ 0.04]
error_handler:undefined_function/3 9 0.01 4 [ 0.44]
'Elixir.Wadler':break/0 27 0.01 5 [ 0.19]
code:call/1 9 0.01 5 [ 0.56]
error_handler:ensure_loaded/1 9 0.03 10 [ 1.11]
erlang:send/3 1 0.03 11 [ 11.00]
erlang:whereis/1 10 0.03 11 [ 1.10]
erlang:function_exported/3 9 0.03 12 [ 1.33]
'Elixir.Binary.Inspect.Utils':group_maybe/2 52 0.04 13 [ 0.25]
erlang:demonitor/2 1 0.04 13 [ 13.00]
'Elixir.Binary.Inspect.BitString':inspect/2 105 0.04 14 [ 0.13]
'Elixir.Wadler':surround/3 52 0.04 15 [ 0.29]
'Elixir.Wadler':pretty/2 80 0.04 15 [ 0.19]
'Elixir.Binary.Inspect.Tuple':record_inspect/2 76 0.04 15 [ 0.20]
io_lib:printable_latin1_list/1 124 0.05 16 [ 0.13]
io:printable_range/0 124 0.05 16 [ 0.13]
'Elixir.Binary.Inspect.Tuple':inspect/2 76 0.05 18 [ 0.24]
'Elixir.Binary.Inspect.List':inspect/2 124 0.05 18 [ 0.15]
'Elixir.Binary.Inspect.List':join_keywords/2 79 0.05 19 [ 0.24]
erlang:atom_to_binary/2 79 0.06 20 [ 0.25]
erlang:atom_to_list/1 79 0.06 20 [ 0.25]
'Elixir.Binary.Inspect.List':keyword_to_docentity/2 79 0.06 21 [ 0.27]
'Elixir.Keyword':get/3 76 0.07 23 [ 0.30]
'Elixir.Binary.Inspect.Utils':group_maybe_do/4 200 0.07 23 [ 0.12]
'Elixir.Binary.Inspect.Atom':inspect/2 79 0.07 26 [ 0.33]
erlang:tuple_to_list/1 152 0.08 27 [ 0.18]
'Elixir.Wadler':nest/2 200 0.08 28 [ 0.14]
'Elixir.Binary.Inspect.Number':inspect/2 219 0.08 28 [ 0.13]
'Elixir.Wadler':default_nesting/0 200 0.09 30 [ 0.15]
'Elixir.Binary.Inspect.Utils':container_join/4 224 0.09 31 [ 0.14]
'Elixir.Binary.Inspect.Atom':'valid_identifier?'/1 79 0.10 34 [ 0.43]
io_lib:printable_list/1 124 0.11 38 [ 0.31]
'Elixir.Wadler':surround/4 200 0.12 44 [ 0.22]
'Elixir.Binary.Inspect.List':'keyword?'/1 203 0.14 48 [ 0.24]
'Elixir.Binary.Inspect.Utils':group_maybe/3 148 0.14 50 [ 0.34]
erlang:integer_to_binary/1 219 0.14 50 [ 0.23]
code_server:call/2 9 0.15 52 [ 5.78]
'Elixir.Binary.Inspect.Atom':'valid_atom_identifier?'/1 79 0.15 54 [ 0.68]
'Elixir.Binary.Inspect.Utils':inc_depth/1 200 0.16 56 [ 0.28]
'Elixir.Binary.Inspect.Tuple':record_fields/1 76 0.16 57 [ 0.75]
'Elixir.Binary.Inspect.List':key_to_binary/2 79 0.16 57 [ 0.72]
'Elixir.Binary.Inspect.Utils':decrement/1 296 0.16 57 [ 0.19]
erlang:group_leader/0 603 0.18 63 [ 0.10]
io:columns/1 603 0.20 72 [ 0.12]
lists:duplicate/2 722 0.24 83 [ 0.11]
'Elixir.Binary.Inspect.Utils':return/2 603 0.24 85 [ 0.14]
'Elixir.Wadler':glue/3 696 0.26 91 [ 0.13]
'Elixir.Binary.Inspect.Utils':escape/2 105 0.28 97 [ 0.92]
io:execute_request/2 603 0.29 103 [ 0.17]
'Elixir.Binary.Inspect':inspect/2 524 0.32 112 [ 0.21]
'Elixir.Binary.Inspect.Utils':do_container_join/3 444 0.32 113 [ 0.25]
'Elixir.Binary.Inspect.Utils':maxwidth/0 603 0.33 115 [ 0.19]
erlang:iolist_to_binary/1 80 0.33 115 [ 1.44]
'Elixir.Wadler':repeat/2 723 0.34 119 [ 0.16]
'Elixir.Wadler':newline/0 723 0.34 119 [ 0.16]
'Elixir.Wadler':break/1 696 0.37 130 [ 0.19]
'Elixir.Keyword':put_new/3 603 0.43 150 [ 0.25]
'Elixir.String':length/1 1424 0.43 152 [ 0.11]
io:io_request/2 603 0.43 153 [ 0.25]
erlang:min/2 603 0.44 155 [ 0.26]
'Elixir.Keyword':delete/2 1009 0.47 164 [ 0.16]
io:request/2 603 0.48 168 [ 0.28]
io:columns/0 603 0.49 174 [ 0.29]
'Elixir.Wadler':'fits?'/2 329 0.51 178 [ 0.54]
io:default_output/0 603 0.53 186 [ 0.31]
'Elixir.Access.List':access/2 1535 0.55 195 [ 0.13]
'Elixir.Binary.Inspect':'__raw_impl__'/1 524 0.62 220 [ 0.42]
'Elixir.Keyword':put/3 1009 0.64 227 [ 0.22]
'Elixir.Wadler':strlen/1 1345 0.67 235 [ 0.17]
'Elixir.Wadler':text/1 1205 0.67 236 [ 0.20]
erlang:demonitor/1 603 0.73 256 [ 0.42]
'Elixir.Wadler':concat/2 1848 0.79 277 [ 0.15]
lists:keyfind/3 2214 0.86 302 [ 0.14]
'Elixir.Access':access/2 1535 0.93 329 [ 0.21]
'Elixir.Wadler':do_render/1 2008 0.97 341 [ 0.17]
'Elixir.Access':'__raw_impl__'/1 1535 1.03 364 [ 0.24]
io:wait_io_mon_reply/2 603 1.05 369 [ 0.61]
lists:duplicate/3 4332 1.19 418 [ 0.10]
erlang:monitor/2 604 1.32 464 [ 0.77]
'Elixir.Keyword':'-delete/2-lc$^0/1-0-'/2 5026 2.36 832 [ 0.17]
'Elixir.Wadler':format/3 4141 2.41 849 [ 0.21]
'Elixir.Binary.Inspect.Utils':do_escape/3 10533 7.68 2704 [ 0.26]
'Elixir.String':'printable?'/1 21112 9.65 3398 [ 0.16]
'Elixir.String.Unicode':next_grapheme/1 25195 10.77 3792 [ 0.15]
'Elixir.String':do_length/1 25195 10.98 3867 [ 0.15]
'Elixir.String':next_grapheme/1 25195 11.28 3970 [ 0.16]
'Elixir.String.Unicode':next_codepoint/1 23771 21.45 7550 [ 0.32]
FUNCTION CALLS % TIME [uS / CALLS]
-------- ----- --- ---- [----------]
'Elixir.Wadler':group/1 5 0.00 0 [ 0.00]
'Elixir.Binary.Inspect.Utils':'-group_maybe/2-fun-0-'/1 1 0.00 0 [ 0.00]
gen_server:call/3 1 0.00 1 [ 1.00]
'Elixir.Binary.Inspect.Utils':'-group_maybe/3-fun-0-'/1 4 0.00 1 [ 0.25]
gen:call/4 1 0.00 2 [ 2.00]
gen:do_call/4 1 0.00 2 [ 2.00]
code:ensure_loaded/1 10 0.01 4 [ 0.40]
code:call/1 10 0.01 4 [ 0.40]
error_handler:undefined_function/3 10 0.01 5 [ 0.50]
'Elixir.Wadler':break/0 27 0.01 5 [ 0.19]
'Elixir.Wadler':glue/2 27 0.01 5 [ 0.19]
erlang:demonitor/2 1 0.02 10 [ 10.00]
'Elixir.Wadler':surround/3 52 0.02 14 [ 0.27]
erlang:send/3 1 0.02 14 [ 14.00]
error_handler:ensure_loaded/1 10 0.02 15 [ 1.50]
'Elixir.Binary.Inspect.Utils':group_maybe_do/4 200 0.02 15 [ 0.07]
erlang:function_exported/3 10 0.02 15 [ 1.50]
'Elixir.Wadler':render/1 80 0.03 17 [ 0.21]
'Elixir.Binary.Inspect.Utils':group_maybe/2 52 0.03 17 [ 0.33]
erlang:whereis/1 11 0.03 18 [ 1.64]
'Elixir.Binary.Inspect.List':join_keywords/2 79 0.03 20 [ 0.25]
'Elixir.Binary.Inspect.BitString':inspect/2 105 0.04 24 [ 0.23]
'Elixir.Keyword':get/3 76 0.04 24 [ 0.32]
'Elixir.Binary.Inspect.Tuple':inspect/2 76 0.04 25 [ 0.33]
'Elixir.Wadler':pretty/2 80 0.04 26 [ 0.33]
'Elixir.Binary.Inspect.List':keyword_to_docentity/2 79 0.04 26 [ 0.33]
'Elixir.Binary.Inspect.Tuple':record_inspect/2 76 0.04 27 [ 0.36]
'Elixir.Wadler':default_nesting/0 200 0.04 28 [ 0.14]
code_server:call/2 10 0.04 29 [ 2.90]
'Elixir.Binary.Inspect.Utils':group_maybe/3 148 0.05 30 [ 0.20]
'Elixir.Binary.Inspect.List':inspect/2 124 0.05 31 [ 0.25]
'Elixir.Wadler':nest/2 200 0.05 32 [ 0.16]
io:printable_range/0 124 0.05 34 [ 0.27]
erlang:atom_to_binary/2 79 0.05 34 [ 0.43]
'Elixir.Binary.Inspect.Atom':'valid_identifier?'/1 79 0.05 35 [ 0.44]
'Elixir.Binary.Inspect.Number':inspect/2 219 0.06 36 [ 0.16]
io_lib:printable_latin1_list/1 124 0.06 38 [ 0.31]
erlang:atom_to_list/1 79 0.06 38 [ 0.48]
'Elixir.Binary.Inspect.Atom':inspect/2 79 0.07 46 [ 0.58]
io_lib:printable_list/1 124 0.08 50 [ 0.40]
'Elixir.Wadler':surround/4 200 0.08 53 [ 0.27]
'Elixir.Binary.Inspect.List':'keyword?'/1 203 0.09 57 [ 0.28]
'Elixir.Binary.Inspect.Utils':container_join/4 224 0.10 63 [ 0.28]
erlang:tuple_to_list/1 152 0.10 67 [ 0.44]
'Elixir.Binary.Inspect.Utils':inc_depth/1 200 0.11 70 [ 0.35]
erlang:integer_to_binary/1 219 0.11 71 [ 0.32]
lists:duplicate/2 722 0.11 74 [ 0.10]
'Elixir.List':duplicate/2 722 0.12 79 [ 0.11]
'Elixir.Wadler':'fits?'/2 329 0.13 84 [ 0.26]
'Elixir.Binary.Inspect.Atom':'valid_atom_identifier?'/1 79 0.13 85 [ 1.08]
'Elixir.Binary.Inspect.List':key_to_binary/2 79 0.13 86 [ 1.09]
io:columns/1 603 0.14 89 [ 0.15]
erlang:group_leader/0 603 0.14 91 [ 0.15]
'Elixir.Binary.Inspect.Utils':decrement/1 296 0.14 93 [ 0.31]
'Elixir.Wadler':glue/3 696 0.16 102 [ 0.15]
'Elixir.Binary.Inspect.Utils':return/2 603 0.16 105 [ 0.17]
'Elixir.Binary.Inspect.Tuple':record_fields/1 76 0.17 112 [ 1.47]
'Elixir.Wadler':break/1 696 0.17 114 [ 0.16]
'Elixir.Binary.Inspect.Utils':escape/2 105 0.18 116 [ 1.10]
'Elixir.Wadler':newline/0 723 0.19 125 [ 0.17]
'Elixir.Wadler':repeat/2 723 0.20 130 [ 0.18]
io:execute_request/2 603 0.22 144 [ 0.24]
'Elixir.Binary.Inspect':inspect/2 524 0.22 145 [ 0.28]
'Elixir.Binary.Inspect.Utils':do_container_join/3 444 0.23 148 [ 0.33]
erlang:min/2 603 0.23 152 [ 0.25]
'Elixir.Binary.Inspect.Utils':maxwidth/0 603 0.26 167 [ 0.28]
io:default_output/0 603 0.26 172 [ 0.29]
io:io_request/2 603 0.28 182 [ 0.30]
'Elixir.String':length/1 1424 0.29 187 [ 0.13]
io:columns/0 603 0.29 189 [ 0.31]
'Elixir.Keyword':put_new/3 603 0.30 198 [ 0.33]
'Elixir.Binary.Inspect':'__raw_impl__'/1 524 0.38 247 [ 0.47]
'Elixir.Wadler':concat/2 1848 0.42 275 [ 0.15]
'Elixir.Access.List':access/2 1535 0.43 280 [ 0.18]
'Elixir.Wadler':strlen/1 1345 0.47 309 [ 0.23]
'Elixir.Wadler':text/1 1205 0.50 325 [ 0.27]
erlang:demonitor/1 603 0.52 337 [ 0.56]
'Elixir.Keyword':delete/2 1009 0.53 343 [ 0.34]
'Elixir.Keyword':put/3 1009 0.65 423 [ 0.42]
lists:keyfind/3 2214 0.65 427 [ 0.19]
io:wait_io_mon_reply/2 603 0.66 428 [ 0.71]
'Elixir.Access':access/2 1535 0.67 438 [ 0.29]
'Elixir.Wadler':do_render/1 2008 0.70 454 [ 0.23]
'Elixir.Access':'__raw_impl__'/1 1535 0.74 484 [ 0.32]
io:request/2 603 0.82 534 [ 0.89]
erlang:monitor/2 604 0.91 593 [ 0.98]
'Elixir.Wadler':format/3 4141 1.35 881 [ 0.21]
'Elixir.Keyword':'-delete/2-lc$^0/1-0-'/2 5026 2.19 1426 [ 0.28]
erlang:iolist_to_binary/1 80 4.76 3101 [ 38.76]
'Elixir.String.Unicode':next_grapheme/1 25195 5.84 3811 [ 0.15]
'Elixir.Binary.Inspect.Utils':do_escape/3 10533 6.25 4076 [ 0.39]
'Elixir.String':next_grapheme/1 25195 7.02 4577 [ 0.18]
'Elixir.String':do_length/1 25195 7.24 4721 [ 0.19]
'Elixir.String':'printable?'/1 21112 8.26 5384 [ 0.26]
'Elixir.String.Unicode':next_codepoint/1 23771 10.18 6638 [ 0.28]
lists:duplicate/3 144436 31.21 20355 [ 0.14]
FUNCTION CALLS % TIME [uS / CALLS]
-------- ----- --- ---- [----------]
'Elixir.Wadler':group/1 5 0.00 0 [ 0.00]
gen:call/4 1 0.00 0 [ 0.00]
'Elixir.Binary.Inspect.Utils':'-group_maybe/2-fun-0-'/1 1 0.00 0 [ 0.00]
gen:do_call/4 1 0.00 1 [ 1.00]
gen_server:call/3 1 0.00 1 [ 1.00]
code:call/1 9 0.01 2 [ 0.22]
'Elixir.Binary.Inspect.Utils':'-group_maybe/3-fun-0-'/1 4 0.01 2 [ 0.50]
'Elixir.Wadler':glue/2 27 0.01 4 [ 0.15]
code:ensure_loaded/1 9 0.01 4 [ 0.44]
error_handler:undefined_function/3 9 0.01 5 [ 0.56]
'Elixir.Wadler':break/0 27 0.03 9 [ 0.33]
erlang:send/3 1 0.03 10 [ 10.00]
erlang:function_exported/3 9 0.03 10 [ 1.11]
error_handler:ensure_loaded/1 9 0.03 11 [ 1.22]
'Elixir.Wadler':pretty/2 80 0.03 11 [ 0.14]
erlang:whereis/1 10 0.03 11 [ 1.10]
'Elixir.Wadler':render/1 80 0.04 12 [ 0.15]
'Elixir.Binary.Inspect.Tuple':inspect/2 76 0.04 12 [ 0.16]
'Elixir.Binary.Inspect.Utils':group_maybe/2 52 0.04 12 [ 0.23]
erlang:demonitor/2 1 0.04 13 [ 13.00]
'Elixir.Binary.Inspect.Atom':'valid_identifier?'/1 79 0.05 16 [ 0.20]
'Elixir.Keyword':get/3 76 0.05 16 [ 0.21]
'Elixir.Binary.Inspect.List':keyword_to_docentity/2 79 0.05 16 [ 0.20]
'Elixir.Binary.Inspect.Tuple':record_inspect/2 76 0.05 17 [ 0.22]
'Elixir.Wadler':surround/3 52 0.06 19 [ 0.37]
'Elixir.Binary.Inspect.BitString':inspect/2 105 0.06 19 [ 0.18]
io:printable_range/0 124 0.06 19 [ 0.15]
'Elixir.Binary.Inspect.List':join_keywords/2 79 0.06 20 [ 0.25]
code_server:call/2 9 0.06 20 [ 2.22]
erlang:atom_to_binary/2 79 0.06 20 [ 0.25]
io_lib:printable_latin1_list/1 124 0.06 21 [ 0.17]
erlang:atom_to_list/1 79 0.06 21 [ 0.27]
'Elixir.Binary.Inspect.Utils':group_maybe_do/4 200 0.07 23 [ 0.12]
'Elixir.Wadler':default_nesting/0 200 0.08 27 [ 0.14]
'Elixir.Binary.Inspect.Number':inspect/2 219 0.08 27 [ 0.12]
'Elixir.Binary.Inspect.Utils':group_maybe/3 148 0.08 27 [ 0.18]
'Elixir.Binary.Inspect.List':inspect/2 124 0.08 28 [ 0.23]
'Elixir.Binary.Inspect.Atom':inspect/2 79 0.09 29 [ 0.37]
io_lib:printable_list/1 124 0.10 32 [ 0.26]
'Elixir.Binary.Inspect.Utils':container_join/4 224 0.10 32 [ 0.14]
'Elixir.Binary.Inspect.Utils':inc_depth/1 200 0.10 34 [ 0.17]
'Elixir.Wadler':nest/2 200 0.11 37 [ 0.18]
'Elixir.Binary.Inspect.List':key_to_binary/2 79 0.11 38 [ 0.48]
erlang:tuple_to_list/1 152 0.12 40 [ 0.26]
'Elixir.Binary.Inspect.List':'keyword?'/1 203 0.12 41 [ 0.20]
'Elixir.Wadler':surround/4 200 0.14 47 [ 0.23]
erlang:integer_to_binary/1 219 0.15 49 [ 0.22]
io:columns/1 603 0.15 52 [ 0.09]
'Elixir.Binary.Inspect.Atom':'valid_atom_identifier?'/1 79 0.16 53 [ 0.67]
'Elixir.Binary.Inspect.Utils':decrement/1 296 0.19 64 [ 0.22]
'Elixir.Wadler':'fits?'/2 329 0.20 66 [ 0.20]
'Elixir.Binary.Inspect.Utils':escape/2 105 0.20 67 [ 0.64]
erlang:group_leader/0 603 0.20 68 [ 0.11]
'Elixir.Binary.Inspect.Utils':return/2 603 0.22 73 [ 0.12]
'Elixir.Binary.Inspect.Tuple':record_fields/1 76 0.24 82 [ 1.08]
'Elixir.Wadler':glue/3 696 0.27 89 [ 0.13]
'Elixir.String':duplicate/2 722 0.29 98 [ 0.14]
'Elixir.Binary.Inspect':inspect/2 524 0.30 102 [ 0.19]
'Elixir.Binary.Inspect.Utils':do_container_join/3 444 0.31 104 [ 0.23]
'Elixir.Wadler':newline/0 723 0.32 107 [ 0.15]
io:execute_request/2 603 0.32 109 [ 0.18]
'Elixir.Binary.Inspect.Utils':maxwidth/0 603 0.34 114 [ 0.19]
'Elixir.Wadler':break/1 696 0.35 119 [ 0.17]
'Elixir.String':length/1 1424 0.41 137 [ 0.10]
io:io_request/2 603 0.43 145 [ 0.24]
erlang:min/2 603 0.43 146 [ 0.24]
erlang:iolist_to_binary/1 80 0.44 147 [ 1.84]
io:default_output/0 603 0.45 151 [ 0.25]
'Elixir.Wadler':repeat/2 723 0.46 154 [ 0.21]
'Elixir.Keyword':put_new/3 603 0.46 154 [ 0.26]
'Elixir.Binary.Inspect':'__raw_impl__'/1 524 0.46 154 [ 0.29]
io:columns/0 603 0.46 156 [ 0.26]
io:request/2 603 0.48 162 [ 0.27]
'Elixir.Access.List':access/2 1535 0.61 206 [ 0.13]
'Elixir.Wadler':text/1 1205 0.67 224 [ 0.19]
'Elixir.Keyword':delete/2 1009 0.67 224 [ 0.22]
'Elixir.Keyword':put/3 1009 0.77 260 [ 0.26]
erlang:demonitor/1 603 0.78 262 [ 0.43]
'Elixir.Wadler':strlen/1 1345 0.80 270 [ 0.20]
'Elixir.Wadler':concat/2 1848 0.82 276 [ 0.15]
'Elixir.Access':access/2 1535 0.97 326 [ 0.21]
'Elixir.Wadler':do_render/1 2008 0.99 333 [ 0.17]
io:wait_io_mon_reply/2 603 1.01 338 [ 0.56]
'Elixir.Access':'__raw_impl__'/1 1535 1.03 346 [ 0.23]
lists:keyfind/3 2214 1.03 346 [ 0.16]
erlang:monitor/2 604 1.27 426 [ 0.71]
'Elixir.Wadler':format/3 4141 2.30 772 [ 0.19]
binary:copy/2 722 2.31 775 [ 1.07]
'Elixir.Keyword':'-delete/2-lc$^0/1-0-'/2 5026 2.57 863 [ 0.17]
'Elixir.Binary.Inspect.Utils':do_escape/3 10533 8.25 2770 [ 0.26]
'Elixir.String.Unicode':next_grapheme/1 25195 10.15 3407 [ 0.14]
'Elixir.String':'printable?'/1 21112 10.53 3534 [ 0.17]
'Elixir.String':do_length/1 25195 11.52 3866 [ 0.15]
'Elixir.String':next_grapheme/1 25195 11.82 3966 [ 0.16]
'Elixir.String.Unicode':next_codepoint/1 23771 17.99 6037 [ 0.25]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment