This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-09-08
Channels
- # 100-days-of-code (1)
- # announcements (7)
- # beginners (63)
- # cljs-dev (39)
- # clojure (78)
- # clojure-dev (40)
- # clojure-italy (4)
- # clojure-nl (22)
- # clojure-russia (5)
- # clojure-spec (5)
- # clojurescript (60)
- # cursive (8)
- # datomic (6)
- # emacs (1)
- # figwheel-main (53)
- # fulcro (19)
- # jobs-discuss (11)
- # mount (1)
- # off-topic (3)
- # om (1)
- # pedestal (9)
- # philosophy (1)
- # re-frame (19)
- # reagent (4)
- # reitit (5)
- # shadow-cljs (66)
- # tools-deps (64)
The optimization I made with CLJS-2894 inadvertently broke Dirac and I captured a ticket in Dirac for now https://github.com/binaryage/dirac/issues/81
A potential 12% compilation gain is in https://dev.clojure.org/jira/browse/CLJS-2895
@mfikes thanks, I will roll a new dirac release later today which will include a future-proof fix. To prevent this from happening in the future, we could introduce a public function in cljs.repl
which would reset source map bindings to start values, I would simply call that function instead of dealing with implementation details of individual bindings…
@darwin This version of the compiler hasn’t yet been released, so there may not be any need to rush with a release or change in Dirac
thanks, I’m aware, but I want to refresh it anyway - to bump chrome devtools codebase to latest
yes, I tested it with both versions of cljs.repl code, btw. how did you find that Dirac broke? you did a github search for that bindings code?
@darwin I was testing https://dev.clojure.org/jira/browse/CLJS-2895 with Dirac. (TL;DR on CJS-2895 is that, if we can reduce the volume of source map information emitted, we can improve compiler perf, but it is not clear yet which source map entries we can remove, and I was simply trying to learn empirically by driving Dirac with some hypothetical changes—in fact, you might have some insight on the subject given your familiarity with how Dirac works.)
I got it down to just emitting source maps for ASTs with these ops:
#{:var :local :js-var :js :binding}
but to be honest that conclusion is only based on light testing with Dirac’s breakpoint example.I found, for example, that if you omit :binding
, Dirac can no longer show let
-bound locals properly in its UI. So it is somewhat unfortunately an open-ended pursuit.
Dirac does not directly work with source-maps, it just has to make sure, that repl js code snippets include proper source maps, I could look into devtools codebase what fields from source-maps they actually use, to confirm your assumptions
also maybe some source-maps info is used by V8, which is much lower level (just speculating here)
Well, the problem is that there are really no fields, it is just a matter of whether a sufficient number of line/col mappings have been emitted in the right places for things to work.
So, it is really difficult to deduce logically which ones we need to keep. (Apart from perhaps arguing that, if you eliminate a tag for, say :throw
it causes such-and-such thing to no longer be done, as an example.)
Right now it is conservative, and spits out a fantastic firehose of line/col information 🙂
an unrelated question: should (declare *something*)
also include ^:dynamic
when doing forward declaration of dynamic vars? I started seeing warnings related to that
In Clojure you need to
(declare ^:dynamic *something*)
to avoid triggering the diagnosticBy the way, Dirac is an awesome tool. I had never delved this deeply into it before. Very nice 🙂
Some work towards inferring parameter types: https://gist.github.com/mfikes/1e2341b48b882587500547f6ba19279d Not quite Hindley–Milner, but it feels like a step towards it. 🙂
Here's the branch containing the code for ^ https://github.com/mfikes/clojurescript/tree/exp-infer-param-types
So, what would be helpful for the annotation/optimization efforts? Find host interop spots (like subs) that pass or receive primitives and annotate them?
Yeah, I would imagine if a change like this makes it into master then we may need to sprinkle some hints at the bottom to fully leverage it.
Would it be possible to retrieve a YourKit license to do some profiling of the compiler? Are there any prerequisites I must meet first?
You can get free licenses of yourkit for oss work afaik
Yeah, we have one for ClojureScript. In the past, David had received some license keys from them.
At #73 with 2 commits in the contributors list, maybe it's not reasonable to get one.
contributors list being: https://github.com/clojure/clojurescript/graphs/contributors