| IRC logs at
Set by AlexDaniel on 12 June 2018.
06:42 Altai-man joined 08:10 sena_kun joined 08:12 Altai-man left
nwc10 good *, #moarvm 09:52
if I look at MVM_box_int (etc) I see: 09:53
box = REPR(type)->allocate(tc, STABLE(type));
if (REPR(box)->initialize)
REPR(box)->initialize(tc, STABLE(box), box, OBJECT_BODY(box));
REPR(box)->box_funcs.set_int(tc, STABLE(box), box,
OBJECT_BODY(box), value);
If I look at what seems to be analagous code in incache.c I see MVMROOT:
if (REPR(obj)->initialize) {
MVMROOT(tc, obj, {
REPR(obj)->initialize(tc, STABLE(obj), obj, OBJECT_BODY(obj));
actually, oops, that is in MVM_repr_alloc_init (which it calls) 09:54
so does that mean that a lot of functions such as MVM_box_int are missing MVMROOT ?
nine nwc10: I think so 11:41
It matters in cases where the REPR(box) is a MVMP6opaque and the type has attributes that would cause allocation of GC objects during initialization - which fortunately none of the common ones do. 11:45
Looking at the initialize functions of the reprs, it's only the SCRef, CompUnit and KnowHOWREPR reprs that allocate GC objects 11:47
12:09 Altai-man joined 12:12 sena_kun left 13:01 MasterDuke joined
dogbert17 nine: so what will you get, a 5900x? 13:33
nine probably a 5950x 13:34
dogbert17 oh, going all out then :-) 13:35
that's a monster
nine The 1800x has served me well for 3 1/2 years. I just don't want to spend the next 3 years wondering how much faster a spec test would finish with those 4 extra cores ;) 13:36
dogbert17 so now you'll have 16 cores instead, the improvement will be immense 13:37
nine I'll now once availability improves and I've picked a fitting board 13:38
MasterDuke how much ram do you have now? 13:39
nine 32g
MasterDuke ah, wouldn't necessarily have to get more
trying to decide if i should get an rx 6800 when it's released in a couple weeks, or wait for the cheaper rx 6700 whenever it's announced/available 13:43
13:46 domidumont joined
MasterDuke timotimo: ah ha again. `./nqp-m -e 'my $a := 0; my $b := -1; my $s := nqp::time_n; while $b++ < 1_000_000 { $a++ if $b ~~ / 123 / }; say(nqp::sub_n(nqp::time_n, $s)); say($a)'` takes 3.8s. sticking `NQP_LIT_REGEX_OPT=1` in front drops that to 0.18s (and gives correct result) 14:24
timotimo oh, wow 14:25
only in nqp, not in raku?
MasterDuke haven't tried raku yet 14:26
yeah, only nqp 14:31
it's looking for a very specific QAST tree. rakudo produces a very different QAST tree for the equivalent code 14:35
i mean what it does now is kind of silly. it turns / 'literal' / into nqp::index && / 'literal' /, when really that should just be nqp::index 14:37 14:39
timotimo ah, i see, you're matching the ~~ invocation now 14:48
that's what i had in mind
MasterDuke yep 14:49
timotimo if the index fails, at least in raku land, we'll also want to set $/ to the failed match object 14:51
but i would think this is a good starting point 14:52
MasterDuke we need to figure out what regex features would invalidate doing this 14:55
timotimo any code blocks that appear before the literal for one 14:56
MasterDuke alternations before the literal 14:59
hm, wait 15:00
timotimo when you have alternations you'll need to take each side individually and either put two index operations with an "or", or check if the literals have any overlap and index for that instead 15:01
that can be handled, whereas code blocks can't without perhaps unreasonable amounts of extra work
MasterDuke yeah
hm, i thought there was a way to stick annotations on any QAST node? 15:59
16:03 MasterDuke left 16:10 sena_kun joined 16:12 Altai-man left
timotimo yeahjust the annotate method to set, annotate_self so that it returns self back so you can chain, and ann to get an annotation't values 16:14
16:29 MasterDuke joined
MasterDuke slight improvement 16:52
`/ 123 \d /` is now also optimized 16:53
Geth_ MoarVM/MVMROOT-in-box-foo: 5482d1f953 | (Nicholas Clark)++ | src/core/coerce.c
MVM_box_{int,num,str,unit} all should MVMROOT the local variable `box`.

This change is for ensuring semantic correctness, and does not fix any current bugs - none of the REPR functions that they call actually cause GC allocations.
MoarVM: nwc10++ created pull request #1378:
MVM_box_{int,num,str,unit} all should MVMROOT the local variable `box`.
MasterDuke well, rakudo compiles with the opt enabled, but building isn't any faster 17:08
it hits during the build, but not in stage parse 17:16
timotimo right, starge parse doesn't make many regexes 17:23
or do you mean hit as in "successfully skips the regex"? 17:24
how many regex matches are actually done at all? we don't have terribly many ~~ invocations, do we?
17:36 MasterDuke left 17:57 domidumont left 18:44 MasterDuke joined
MasterDuke updated to current diff 18:45
hit as in compiles into the optimized form. i'm not tracking how many times the newly-optimized form is called 18:47
19:31 zakharyas joined 19:38 domidumont joined
MasterDuke hm. the QAST from rakudo for my test code has a QAST::WVal in the `if`'s tree, not the raw QAST::Regex. how do i follow that QAST::WVal in nqp to get the QAST::Regex it's referring to? 19:45
19:49 domidumont left 20:09 Altai-man joined 20:11 sena_kun left
timotimo good question, i'd have to check what exact kind of object you get, but i would assume you grab the $!do attribute of Code from it? 20:13
MasterDuke huh. i'll give that a try 20:15
have you looked at the current diff? 20:16
timotimo i skimmed it
20:20 sena_kun joined 20:21 Altai-man left
timotimo oh, but when you follow the WVal to the $!do, you won't get the QAST tree i don't think 20:24
i wonder if we'd need a mechanism like the inline info
where we install a reference to the qast stuff in the code object 20:25
so that even when compilation has finished and we just include the compunit from another script we can get the qast tree again
MasterDuke hm. i only need it to get the literal i stuck in the annotation. i can just use the WVal in the new tree i build 20:26
timotimo i'm not sure i understand, you mean you have the WVal that points at the literal? 20:31
MasterDuke i have a WVal that points at a Regex. i stuck the literal value i'm going to use for the index in an annotation on the Regex 20:32
timotimo oh, i'm not certain whether you'll reach the QRegex object via the Regex object? like i think that might disappear? 20:33
MasterDuke hm. i do see the QRegex with the annotation up in '[children]' 20:35
timotimo ah, is that the list where all the blocks live?
like the child of the compunit i think?
MasterDuke i think 20:36
timotimo now just gotta figure out how to go from one to the other and/or back 20:45
21:46 MasterDuke left 22:55 sena_kun left 23:12 zakharyas left