00:10 jnthn joined 00:55 patrickz_ joined 00:59 evalable6 joined 02:16 TimToady joined 02:57 Voldenet joined 02:59 ilbot3 joined 03:25 Voldenet joined 04:29 samcv joined 04:51 BinGOs joined 06:04 releasable6 joined, greppable6 joined 06:05 squashable6 joined 06:17 AlexDaniel joined 06:39 brrt joined 07:09 brrt joined 07:11 domidumont joined 07:16 geospeck joined, domidumont joined 07:35 reportable6 joined 07:47 brrt joined 08:08 lizmat joined
lizmat jnthn: re making let/temp use IterationBuffer: gist.github.com/lizmat/155cc1e437f...054b603099 09:45
alas, this does not do the trick: MVMArray: Can't shift from an empty array 09:46
am I missing something?
afk for a few hours&
jnthn lizmat: Apparently, though I've no guesses about what just looking at the patch. 10:13
lizmat ok, thanks for the sanity check 10:19
apparently I'm not going to be away for a few hours after all 10:20
m: use nqp; my $a := nqp::create(IterationBuffer); Nil while $a # the reason 10:38
camelia (timeout) 10:39
lizmat jnthn: just wondering, is there a reason why "my %h = a => 42; %h.AT-KEY("a") for ^10000000" should not get inlined ? 12:57
lizmat means the call to Hash.AT-KEY of course :-) 12:59
dogbert17 has made some updates to github.com/MoarVM/MoarVM/issues/754 13:09
13:18 arnsholt joined
jnthn lizmat: Yeah, we need to split AT-KEY into a small method that returns the value if the key is ther, and a private method that has the auto-viv closure 13:20
lizmat: We can inline a call *to* a closure. We can't inline something that *takes* a closure. 13:21
lizmat oki
gotcha
jnthn Same for AT-POS in Array fwiw
lizmat yup 13:22
will take that on
jnthn I don't know if we ever can inline something that takes closures
Because the ->outer of the captured code object needs a MVMFrame to point at
Unless we somehow make that MVMFrame + index, but I suspect there's a lot of trickiness there
lizmat ooh, wow, it's now gotten so smart that in a 10M loop, it just stops calling AT-KEY after about 10K times 13:35
my %h = a => 42; %h.AT-KEY("a") for ^10000000 # jnthn: could that be possible ? ^^^
jnthn Just stops calling it? :) 13:38
lizmat well, in --profile it looks like
only 9832 calls to Hash.AT-KEY, and mostly red 13:39
otoh there's a <anon> with 19990168 calls, which is 2M - 9832 13:40
so I guess it's some --profile artefact
fwiw, this makes AT-KEY about 1.7x as fast in this benchmark 13:41
let's see if it survives spectest :-) 13:42
jnthn It should give you an inline ratio also on the first summary page 13:55
lizmat "Inlining eliminated the need to create 9990168 call frames (that's 33.3%)." :-) 14:02
hmmm... although the % seems to be off: 14:03
In total, 20009857 call frames were entered and exited by the profiled code. Inlining eliminated the need to create 9990168 call frames (that's 33.3%).
m: say 9990168 / 20009857
camelia 0.499262339
lizmat m: say (20009857 + 9990168) / 20009857 14:04
camelia 1.499262339
lizmat ok, like that :-)
jnthn yes :) 14:15
dogbert17 more more :) 14:17
lizmat jnthn: looks like Array.AT-POS already abstracted container creation into a separate private method 14:32
jnthn Ah, OK 14:48
lizmat hmmm.. still, AT-POS is not getting inlined :-( 14:52
lizmat looks again
jnthn: ah, probably the $*INDEX ? 14:53
jnthn lizmat: At the top of src/spesh/optimize.c there's a 14:57
#define that you can uncomment
uh, not uncomment 14:58
But turn from 0 to 1
It dumps out on stderr why it could or couldn't inline things
timotimo which AT-POS are we looking at?
since there's multiple multis
lizmat Array.AT-POS
jnthn Just tweak it and then make -j install in the MoarVM folder. No need to rebuild NQP or Rakudo
timotimo looking up a dynamic var shouldn't prevent inlining, or should it? 14:59
jnthn Shouldn't 15:00
Even declaring one wouldn't
timotimo could the my $todo prevent it? 15:01
jnthn oh...what 15:03
That method is giant
lizmat yeah, looking at making the common case smaller :-)
timotimo hm, yeah, there's many invocations, those each cost a couple of instructions
jnthn Yeah, I bet it's over the size limit 15:04
lizmat is working on making the common case smaller :-)
15:06 brrt joined
timotimo maybe CArray can also get a little pass looking at inlinability 15:09
15:42 zakharyas joined 15:49 zakharyas joined 15:54 zakharyas joined 16:03 zakharyas joined 16:06 domidumont joined 16:11 zakharyas joined 16:31 zakharyas joined 17:06 zakharyas joined 18:29 Ven`` joined 19:36 unicodable6 joined, bisectable6 joined, committable6 joined 20:33 benchable6 joined 21:05 zakharyas joined 21:32 TimToady joined 22:48 AlexDaniel joined