Uploaded image for project: 'Erlang/OTP'
  1. Erlang/OTP
  2. ERL-1181

Increased compilation times on master

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: OTP 23
    • Fix Version/s: OTP-23.0-rc2
    • Component/s: compiler
    • Labels:
      None

      Description

      This is more of a "FYI" than an actual bug report, so feel free to close it if this is already planned to be tackled after the RC is out.

      In a nutshell, the compiler is roughly 30-40% slower for compiling Elixir and Elixir projects. For Elixir itself, I have done this:

      make clean compile
      touch lib/elixir/lib/kernel.ex
      time make compile
      

      The times went from 5.5s to 7.6s.

      Elixir projects show similar slow down. For Phoenix, for example, "time mix compile --force" went from 2.1s to 2.7s.

      The biggest different, however, is in the Unicode module. You can see the time reports below.

      On OTP 22:

      Compiling "/Users/jose/OSS/elixir/lib/elixir/unicode/unicode.ex"
       get_module_name_from_core     :      0.000 s  604346.1 kB
       sys_core_fold                 :      0.761 s  604301.0 kB
       sys_core_alias                :      0.160 s  604301.0 kB
       core_transforms               :      0.000 s  604301.0 kB
       sys_core_bsm                  :      0.221 s  604301.0 kB
       v3_kernel                     :      2.235 s  429066.6 kB
       beam_kernel_to_ssa            :      0.435 s  200271.9 kB
       beam_ssa_share                :      0.455 s   96195.1 kB
       beam_ssa_bsm                  :      0.207 s   96264.4 kB
          %% Sub passes of beam_ssa_bsm from slowest to fastest:
          combine_matches            :      0.112 s  55 %
          accept_context_args        :      0.042 s  20 %
          skip_outgoing_tail_extracti:      0.038 s  19 %
          allow_context_passthrough  :      0.013 s   6 %
          annotate_context_parameters:      0.000 s   0 %
       beam_ssa_funs                 :      0.017 s   96259.7 kB
      Compiling lib/elixir/unicode/unicode.ex (it's taking more than 15s)
       beam_ssa_opt                  :      2.715 s   96207.4 kB
          %% Sub passes of beam_ssa_opt from slowest to fastest:
          ssa_opt_type_continue      :      1.105 s  41 %
          ssa_opt_live               :      0.586 s  22 %
          ssa_opt_type_start         :      0.542 s  20 %
          ssa_opt_dead               :      0.288 s  11 %
          ssa_opt_bsm_units          :      0.048 s   2 %
          ssa_opt_cse                :      0.029 s   1 %
          ssa_opt_tail_phis          :      0.019 s   1 %
          ssa_opt_merge_blocks       :      0.018 s   1 %
          ssa_opt_sink               :      0.012 s   0 %
          ssa_opt_linearize          :      0.009 s   0 %
          ssa_opt_element            :      0.009 s   0 %
          ssa_opt_trim_unreachable   :      0.009 s   0 %
          ssa_opt_split_blocks       :      0.008 s   0 %
          ssa_opt_coalesce_phis      :      0.006 s   0 %
          ssa_opt_float              :      0.003 s   0 %
          ssa_opt_bsm_shortcut       :      0.003 s   0 %
          ssa_opt_bsm                :      0.002 s   0 %
          ssa_opt_record             :      0.002 s   0 %
          ssa_opt_sw                 :      0.002 s   0 %
          ssa_opt_get_tuple_element  :      0.001 s   0 %
          ssa_opt_bs_puts            :      0.001 s   0 %
          ssa_opt_blockify           :      0.001 s   0 %
          ssa_opt_tuple_size         :      0.000 s   0 %
          ssa_opt_type_finish        :      0.000 s   0 %
       beam_ssa_recv                 :      0.014 s   96207.4 kB
       beam_ssa_pre_codegen          :      0.274 s   96934.7 kB
          %% Sub passes of beam_ssa_pre_codegen from slowest to fastest:
          live_intervals             :      0.062 s  23 %
          fix_bs                     :      0.035 s  13 %
          place_frames               :      0.034 s  12 %
          reserve_regs               :      0.032 s  12 %
          number_instructions        :      0.024 s   9 %
          linear_scan                :      0.019 s   7 %
          sanitize                   :      0.018 s   6 %
          use_set_tuple_element      :      0.016 s   6 %
          find_yregs                 :      0.013 s   5 %
          opt_get_list               :      0.008 s   3 %
          assert_no_critical_edges   :      0.008 s   3 %
          reserve_yregs              :      0.002 s   1 %
          turn_yregs                 :      0.001 s   0 %
          fix_receives               :      0.001 s   0 %
          frame_size                 :      0.001 s   0 %
          copy_retval                :      0.000 s   0 %
          legacy_bs                  :      0.000 s   0 %
       beam_ssa_codegen              :      0.144 s   94406.1 kB
       beam_a                        :      0.030 s   94409.6 kB
       beam_block                    :      0.003 s   94686.1 kB
       beam_except                   :      0.003 s   94672.5 kB
       beam_jump                     :      0.066 s   89617.9 kB
       beam_peep                     :      0.006 s   89617.9 kB
       beam_clean                    :      0.002 s   89617.9 kB
       beam_trim                     :      0.000 s   89617.9 kB
       beam_flatten                  :      0.000 s   89594.4 kB
       beam_z                        :      0.000 s   89599.6 kB
       beam_validator                :      0.067 s   89599.6 kB
       beam_asm                      :      0.164 s   88400.8 kB
      

      On master:

      Compiling "/Users/jose/OSS/elixir/lib/elixir/unicode/unicode.ex"
       get_module_name_from_core     :      0.000 s  604987.5 kB
       core_lint_module              :      0.071 s  604987.6 kB
       sys_core_prepare              :      0.350 s  604987.6 kB
       sys_core_fold                 :      0.545 s  604942.2 kB
       sys_core_alias                :      0.171 s  604942.2 kB
       core_transforms               :      0.000 s  604942.2 kB
       sys_core_bsm                  :      0.286 s  604942.2 kB
       v3_kernel                     :      1.330 s  407219.3 kB
       beam_kernel_to_ssa            :      0.500 s  208536.1 kB
      Compiling lib/elixir/unicode/unicode.ex (it's taking more than 15s)
       beam_ssa_bool                 :      1.477 s  208536.1 kB
       beam_ssa_share                :      0.558 s  159229.3 kB
       beam_ssa_bsm                  :      4.154 s  159390.8 kB
          %% Sub passes of beam_ssa_bsm from slowest to fastest:
          combine_matches            :      2.254 s  54 %
          accept_context_args        :      0.954 s  23 %
          skip_outgoing_tail_extracti:      0.536 s  13 %
          allow_context_passthrough  :      0.406 s  10 %
          annotate_context_parameters:      0.000 s   0 %
       beam_ssa_funs                 :      0.220 s  159388.6 kB
       beam_ssa_opt                  :     10.449 s  143166.5 kB
          %% Sub passes of beam_ssa_opt from slowest to fastest:
          ssa_opt_type_start         :      4.052 s  39 %
          ssa_opt_live               :      2.328 s  23 %
          ssa_opt_type_continue      :      1.096 s  11 %
          ssa_opt_dead               :      0.862 s   8 %
          ssa_opt_cse                :      0.371 s   4 %
          ssa_opt_tail_phis          :      0.348 s   3 %
          ssa_opt_merge_blocks       :      0.276 s   3 %
          ssa_opt_element            :      0.184 s   2 %
          ssa_opt_linearize          :      0.159 s   2 %
          ssa_opt_trim_unreachable   :      0.124 s   1 %
          ssa_opt_split_blocks       :      0.114 s   1 %
          ssa_opt_coalesce_phis      :      0.112 s   1 %
          ssa_opt_record             :      0.091 s   1 %
          ssa_opt_float              :      0.039 s   0 %
          ssa_opt_tuple_size         :      0.036 s   0 %
          ssa_opt_sink               :      0.023 s   0 %
          ssa_opt_bsm                :      0.022 s   0 %
          ssa_opt_get_tuple_element  :      0.013 s   0 %
          ssa_opt_blockify           :      0.011 s   0 %
          ssa_opt_bs_puts            :      0.008 s   0 %
          ssa_opt_bsm_shortcut       :      0.008 s   0 %
          ssa_opt_try                :      0.005 s   0 %
          ssa_opt_sw                 :      0.005 s   0 %
          ssa_opt_type_finish        :      0.002 s   0 %
          ssa_opt_unfold_literals    :      0.000 s   0 %
       beam_ssa_recv                 :      0.123 s  143166.5 kB
       beam_ssa_pre_codegen          :      2.617 s  144891.5 kB
          %% Sub passes of beam_ssa_pre_codegen from slowest to fastest:
          live_intervals             :      0.525 s  20 %
          reserve_regs               :      0.396 s  15 %
          place_frames               :      0.319 s  12 %
          fix_bs                     :      0.286 s  11 %
          linear_scan                :      0.262 s  10 %
          use_set_tuple_element      :      0.170 s   6 %
          sanitize                   :      0.150 s   6 %
          exception_trampolines      :      0.138 s   5 %
          assert_no_critical_edges   :      0.121 s   5 %
          number_instructions        :      0.105 s   4 %
          opt_get_list               :      0.050 s   2 %
          find_yregs                 :      0.028 s   1 %
          reserve_yregs              :      0.022 s   1 %
          frame_size                 :      0.015 s   1 %
          turn_yregs                 :      0.012 s   0 %
          match_fail_instructions    :      0.008 s   0 %
          copy_retval                :      0.006 s   0 %
          fix_receives               :      0.002 s   0 %
          legacy_bs                  :      0.000 s   0 %
       beam_ssa_codegen              :      0.804 s  116620.9 kB
       beam_a                        :      0.049 s  116772.2 kB
       beam_block                    :      0.032 s  121097.0 kB
       beam_jump                     :      0.218 s   89406.3 kB
       beam_peep                     :      0.005 s   89406.3 kB
       beam_clean                    :      0.002 s   89406.3 kB
       beam_trim                     :      0.000 s   89406.3 kB
       beam_flatten                  :      0.000 s   89386.5 kB
       beam_z                        :      0.000 s   89390.3 kB
       beam_validator                :      0.079 s   89390.3 kB
       beam_asm                      :      0.173 s   88400.9 kB
      

      Overall is almost twice slower. I haven't done any further profile, I will do so later today and if I have anything more concrete I will follow here or with a PR.

      Thanks for all the work and I am looking forward to OTP 23!

       

       

        Attachments

          Activity

            People

            Assignee:
            john John Högberg
            Reporter:
            josevalim José Valim
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: