<adambeynon>
elia: completely missed that HN post on Opal
<elia>
adambeynon, caught that on twitter
<elia>
adambeynon, I'd like to know if MRI does anything in that regard (optimising non-overwritten math ops)…
<elia>
adambeynon, otherwise is just bulls… trolling
<adambeynon>
elia: I think they do, IIRC there is some rb_add_op() type method which handles it. of course, doing that in opal would involve having a function which would be just as slow as the way we are doing it now
<adambeynon>
also, a math op being "264x slower" is a bit meaningless. If you have 100 other method calls in the same event loop, all it means is that with opal you have 101 method calls
<adambeynon>
if we are working out some very complex math thing, then fair enough, but my math stuff is pretty small parts of general app stuffs
<elia>
adambeynon, yeah, the fact that he says he's not "singling on Opal" means in fact the opposite with the clear aim of praising dart
<elia>
the pan on store.prada.com products seems to work fine after all and they're not that ugly ;)
<elia>
*seem
<adambeynon>
looking good
<adambeynon>
btw, is that an older version of opal?
<elia>
adambeynon, yeah, I think around 0.3.6 or .36…
<elia>
opal (0.3.42)
elia has quit [Quit: Computer has gone to sleep.]
<adambeynon>
elia: any reason your sticking with that version? (curiosity)
elia has joined #opal
<elia>
adambeynon, the QA+dev costs basically
<adambeynon>
elia: I do wonder if it would ever make sense to go back to the old method dispatching (self.foo || $mm('foo')).call(...)
<adambeynon>
obviosuly when sourcemaps work better etc
<adambeynon>
there was something really nice about not having to use Native()
<elia>
I tried calling functions on node instead of using bare operations
<meh`>
elia, bare functions or methods?
<meh`>
there's a huge difference
<elia>
meh`, funcs
<meh`>
brb
<adambeynon>
bundle exec ./bin/opal -e 's = Time.now.to_f; a = 0; 30000000.times { a = a + 1 }; e = Time.now.to_f; puts e - s'
<adambeynon>
3.200000047683716
<adambeynon>
^^ that is if we compile '+' as a normal js operator
<elia>
there we go, 13sec on node with method call
<adambeynon>
elia: if I compile with "optimized ops" (so it generates a ternary statement), then it comes at 3.4 seconds
<adambeynon>
(typeof(a) === "number" ? a + b : a['$+'](b))
<elia>
ha! that could be good response
meh` has quit [Ping timeout: 240 seconds]
<elia>
adambeynon, not sure how it's handled in MRI, but maybe we can try keeping track of method definition and have a flag that stays true unless is overwritten
<elia>
adambeynon, but probably not worth it
<adambeynon>
elia: Im not against reintroducing the optimized code (ugly, but faster). If it was a compiler option it could then just be enabled by those that want it
<adambeynon>
or in production builds, for example
<elia>
yeah, I don't think ppl usually redefines Numeric#+
<elia>
*redefine
<adambeynon>
elia: (on my laptop) opal master: 3.2300000190734863
<adambeynon>
ruby: 2.370970058441162
<elia>
thubsup
<elia>
:(
<elia>
*thumbsup
<elia>
:)
<adambeynon>
:D
<elia>
adambeynon, you gonna reply on HN?
<adambeynon>
elia: going through looking at other possible optimizations first ;) It looks like we are also calling a lot of functions for each block call/yield
<adambeynon>
so trying to remeber why we needed such a complex routine :)
<adambeynon>
I think it was to support blocks in define_method
<elia>
heheh
<adambeynon>
in which case I would rather make blocks faster by default, and make define_method do any reworking of params to suit
<elia>
+1
<adambeynon>
1.5988201976002722
<adambeynon>
oh yeahhhhhhh
<elia>
<elia>
lol
meh` has joined #opal
<meh`>
that wasn't quick at all
<meh`>
elia, does dart have open classes?
<elia>
no idea
<elia>
looked at it once, and immediately shut my eyes and closed the browser window…
<meh`>
you can't
<meh`>
what the fuck is he talking about then
<meh`>
"duh they don't optimize 1 + 1"
<meh`>
"1 + 1" can mean whatever in Ruby
<meh`>
bah
<elia>
yeah, they don't even have a "try it online" page…
<meh`>
they do, but it's broken
<meh`>
even more broken than ours
<elia>
lol, I think I'll reply that dart is a toy :trollface:
<meh`>
I'd just reply that they should understand a bit more about Ruby before talking
<meh`>
they designed Dart around what JS engines can make run fast