Improve analyzer munge performance

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

Environment

None

Attachments

2
  • 31 May 2017, 08:15 PM
  • 31 May 2017, 03:54 PM

Activity

Show:

Mike Fikes June 1, 2017 at 8:17 PM

David Nolen May 31, 2017 at 9:58 PM

Andre R May 31, 2017 at 8:22 PM

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)"

Andre R May 31, 2017 at 8:17 PM

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.

Completed

Details

Assignee

Reporter

Affects versions

Priority

Created May 31, 2017 at 3:54 PM
Updated June 1, 2017 at 8:17 PM
Resolved June 1, 2017 at 8:17 PM