ClojureScript

cljs.js: Memory perf on JSC for first defn evaluation

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Duplicate
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None

Description

If you evaluate something like (defn f []) via cljs.js/eval-str with JavaScriptCore, a spike in memory will occur and it will take several seconds to complete the evaluation. After this, subsequent evaluations don't exhibit this behavior. Also, this doesn't occur for Firefox or Chrome.

Additionally, it did not occur previously with bootstrapped ClojureScript when we were building things outside of `cljs.js` (it doesn't occur in Replete, for example, nor the earlier versions of Planck: https://youtu.be/AMT63rxK4E8).

You can see it for yourself at http://ClojureScript.net (you can see the slowness in desktop Safari, and on an iPhone it exhausts memory).

Activity

Hide
Mike Fikes added a comment -

Attached memory.png, which shows what happens in Planck when you do (defn f [])

Show
Mike Fikes added a comment - Attached memory.png, which shows what happens in Planck when you do (defn f [])
Hide
Mike Fikes added a comment -

This is the same as CLJS-910. An easy workaround is :static-fns true.

Show
Mike Fikes added a comment - This is the same as CLJS-910. An easy workaround is :static-fns true.

People

Vote (0)
Watch (3)

Dates

  • Created:
    Updated:
    Resolved: