These are chat archives for opal/opal

24th
Oct 2017
Jan Biedermann
@janbiedermann
Oct 24 2017 08:22
how can i use opal 0.11 with opal-rails or sprockets 4 with opal? are there branches for this available?
Jan Biedermann
@janbiedermann
Oct 24 2017 09:32
Oh, i just saw opal-rails master got updated for 0.11 :)
Elia Schito
@elia
Oct 24 2017 10:18
@janbiedermann yeah the current plan is to release once I have opal-{rails,jquery,haml,sprockets,rspec} working with 0.11
@janbiedermann as for sprockets 4.0 it's a bit in stall as it wasn't very clear where the sprockets team was going after moving the repo to the rails org
Jan Biedermann
@janbiedermann
Oct 24 2017 10:32

@elia thanks, i understand. I just tried compiling ruby-hyperloop with opal 0.11. hyperloop brings a lot of code to compile for the client/browser/opal to get going, so this code has to be compiled at once after installing hyperloop and maybe again after changes to the gems and so on. hyperloop relies on sprockets, so sprockets, the opal processor will do the job. Some numbers:
opal-0.10.5:

tc:  62.290000   7.360000  69.650000 ( 69.664902)
tr:   2.750000   0.460000   3.210000 (  3.173351)
ts:  18.900000  30.560000  49.460000 ( 49.552422)

opal-0.11

tc: 207.540000  10.260000 217.800000 (218.658982)
tr:   4.320000   0.410000   4.730000 (  4.778514)
ts:  27.070000  37.370000  64.440000 ( 64.722876)

tc: time spent in the compiler
tr: sprockets processing requires
ts: caching source maps

tc grew with 0.11 around 3 times.
Are there any ideas how to make the processor/compiler faster, that where just not implemented yet?
Or can i change some compiler setting?
Or how can i make this process faster?

numbers are for compiling ~350 files
Elia Schito
@elia
Oct 24 2017 10:37
@janbiedermann the compiler of 0.11 relies on the "parser" gem, which is much more complete, but also does more work, I think would be interesting to see how much of compiler time is spent in parsing, I don't think any compiling option affects compile time (usually the effects are at runtime) except maybe for generating source maps…
Jan Biedermann
@janbiedermann
Oct 24 2017 10:38
ok, i will check that :) parser
Elia Schito
@elia
Oct 24 2017 10:41
@janbiedermann just the other day I was looking at a PR to parser by @alexdowad for a C implementation of its bottleneck that was finally turned down for a number of reasons
Jan Biedermann
@janbiedermann
Oct 24 2017 10:42
interesting, i will look for that, thanks
Jan Biedermann
@janbiedermann
Oct 24 2017 16:29
@elia confirmed, ~85% of the time are spent in Parser::Base.parse