ClojureScript

Improve analyzer munge performance

Details

  • Type: Enhancement Enhancement
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Completed
  • Affects Version/s: 1.9.293
  • Fix Version/s: None
  • Component/s: None
  • Labels:

Description

Profiling shows that munge in cljs.analyzer is a bottlenck.

Approach:

  1. Get rid of string/split and replace with indexOf
  2. Memoize ns-first-segments

Activity

Hide
A. R added a comment -

In case somebody is wondering & just for the records:

Memoizing munge didn't work. The compiler never finished. Not sure if memory pressure or some other issue. Could be investigated at some point. But a simple memoize definitely didn't work.

Show
A. R added a comment - In case somebody is wondering & just for the records: Memoizing munge didn't work. The compiler never finished. Not sure if memory pressure or some other issue. Could be investigated at some point. But a simple memoize definitely didn't work.
Hide
A. R added a comment -

Results of the patch:

  • 17k LOC project went from 21s to 11.9s for a full recompile (optimizations none)

Via Mike Fikes on slack:

Self hosted Plank: "(require 'cljs.core.async): 48 seconds without the change, 28 seconds with the change."

Self hosted Lumo: "(require 'cljs.core.async) from 52 seconds to 37 seconds. (29% faster)"

Show
A. R added a comment - Results of the patch:
  • 17k LOC project went from 21s to 11.9s for a full recompile (optimizations none)
Via Mike Fikes on slack: Self hosted Plank: "(require 'cljs.core.async): 48 seconds without the change, 28 seconds with the change." Self hosted Lumo: "(require 'cljs.core.async) from 52 seconds to 37 seconds. (29% faster)"
Hide
David Nolen added a comment -
Show
David Nolen added a comment - patch looks great! fixed in master https://github.com/clojure/clojurescript/commit/dd7403f8f513c1e774b9a65cade2037451fe7565
Hide
Mike Fikes added a comment -

See related regression CLJS-2067

Show
Mike Fikes added a comment - See related regression CLJS-2067

People

  • Assignee:
    Unassigned
    Reporter:
    A. R
Vote (0)
Watch (4)

Dates

  • Created:
    Updated:
    Resolved: