These are chat archives for ractivejs/ractive

27th
Oct 2017
Joseph
@fskreuz
Oct 27 2017 00:55
I'm for sticking with ES6 syntax unless performance suffers because of transpiled code.
I think it's natural one starts writing with simple syntax first, then optimizing going forward (i.e. write with forEach initially then manually optimize using for loops).
Not sure if related, but the one thing that bugs me is that classes don't tree-shake very well. :D
Chris Reeves
@evs-chris
Oct 27 2017 01:00
I was actually specifically referring to classes and varargs 😁
I saved like 6k on the minified build with a custom buble that makes the class transpile much more minifier friendly
Joseph
@fskreuz
Oct 27 2017 01:02
nice :D
varargs... you mean one function taking in different arguments and do slightly different things? (reminds me of jQuery's multi-purpose $ function)
Chris Reeves
@evs-chris
Oct 27 2017 01:07
nah, foo(arg, *rest)
rest args is the term I was looking for
that one's expensive to transpile
Joseph
@fskreuz
Oct 27 2017 01:12
Ahh, because it uses apply on this end, and usually arguments on the other end (if spreading).
Was never fond of this nor polymorphic functions. :grin:
Chris Reeves
@evs-chris
Oct 27 2017 01:15
especially when internal functions can just pass an array
Joseph
@fskreuz
Oct 27 2017 01:20
Yep, and save a dozen lines both ends. So yeah, I'm good with ES5-ifying, even changing signatures if that's the case.
Chris Reeves
@evs-chris
Oct 27 2017 01:27
shooting for my < 200k goal 😁
there's a ton of stuff that ractive supports that is hard to extricate from core
Joseph
@fskreuz
Oct 27 2017 01:29
Didn't you already break the 200k barrier with that props optimizer? Last time I checked, Ractive shrunk to 176k. :tada:
Chris Reeves
@evs-chris
Oct 27 2017 01:30
there was a good bit of performance impact, so I removed it from the build again
Joseph
@fskreuz
Oct 27 2017 01:30
ahh
Chris Reeves
@evs-chris
Oct 27 2017 01:31
dynamic prop access apparently is not so fast
paulie4
@paulie4
Oct 27 2017 03:52
What prop optimization
was done that was not fast? (first message was sent to early)
I agree with b) es5-ify some of the more expensive es6 bits
Chris Reeves
@evs-chris
Oct 27 2017 04:58
since property access can't minifier, stuff like foo.bar.baz minifier to a.bar.baz. hoist-props will take all of your property accesses in a scope, turn them into shared strings if they meet a heuristic (actually saves space), and you end up with something like a[b][c].
at the top of the scope, you get var b='bar',c='baz';, which is also considered for each prop, so you end up only hoisting props that are used a ton or that are used a few times and are huge
Joseph
@fskreuz
Oct 27 2017 14:19
Is it because for fixed properties, JS engines represent objects as classes with fixed propse while if you do dynamic, it does some hash lookup?
Chris Reeves
@evs-chris
Oct 27 2017 14:54
I think so
Joseph
@fskreuz
Oct 27 2017 14:58
#TIL :D
Joseph
@fskreuz
Oct 27 2017 20:43
:tada: friday! :beers:
Chris Reeves
@evs-chris
Oct 27 2017 20:45
and it's 5 o'clock somewhere
Joseph
@fskreuz
Oct 27 2017 20:45
hahaha