00:34 pyrimidine joined
samcv well i fixed my bug with the bitfield row code for UCD-gen.p6, had an off by one, and was looking up the bitfield row index at the wrong point in the process, so moved that into the get_bitfield_offset function, and only calls that when the letter isn't part of a range 00:53
01:55 FiveBroDeepBook joined, FiveBroDeepBook left 02:36 pyrimidine joined 02:37 colomon_ joined 02:39 colomon joined 02:46 colomon joined 02:57 pyrimidine joined 03:17 geekosaur joined 04:35 pyrimidine joined
MasterDuke .tell jnthn well, after some distractions, i'm currently trying to get Parameter.named_names to be useful. i can't `for @!named_names { }`, which isn't surprising, but i also can't `my $i := nqp::iterator(@!named_names); while $iter { nqp::shift_s($iter)) }`, which is 06:27
yoleaux2 MasterDuke: I'll pass your message to jnthn.
MasterDuke .tell jnthn i'm probably just not thinking because it's late, with that i'm off... 06:28
yoleaux2 MasterDuke: I'll pass your message to jnthn.
06:48 FiveBroDeepBook joined, FiveBroDeepBook left 09:58 pyrimidine joined 11:19 ggoebel joined 12:03 patrickz joined
jnthn .tell MasterDuke Just use nqp::elems and loop over indices 12:09
yoleaux2 jnthn: I'll pass your message to MasterDuke.
06:27Z <MasterDuke> jnthn: well, after some distractions, i'm currently trying to get Parameter.named_names to be useful. i can't `for @!named_names { }`, which isn't surprising, but i also can't `my $i := nqp::iterator(@!named_names); while $iter { nqp::shift_s($iter)) }`, which is
06:28Z <MasterDuke> jnthn: i'm probably just not thinking because it's late, with that i'm off... 12:10
MasterDuke jnthn: hm, i see in my vim undo history that i had tried .elems, which gives `Cannot find method 'elems': no method cache and no .^find_method`, and nqp::elems(), which gives `This type (Array) does not support elems` 12:32
yoleaux2 12:10Z <jnthn> MasterDuke: Just use nqp::elems and loop over indices
MasterDuke but completely forgot to mention that 12:33
hm, wait, may be something else 12:36
timotimo if you have an Array, you need to get at its $!storage 12:40
12:41 FiveBroDeepBook joined, FiveBroDeepBook left
MasterDuke turns out i was trying to stick an Array in $!refied. converting it into an nqp::list() worked 12:42
timotimo oh, hehe. 12:43
yeah, $!reified is for low-level lists, usually we use ReificationTarget, which is a very thin wrapper around what nqp::list also is
MasterDuke initially i tried sticking my nqp::list_s in $!reified, but then some Rakudo::Iterator complained it needed to use atpos_s 12:46
timotimo right 12:48
that won't fly unless all parts agree on the list_s-ness, though ReificationTarget is a class which means you could derive from it and use _s everywhere for it maybe 12:49
MasterDuke i'm just creating a list and sticking all the elements of the list_s in it 12:50
timotimo i wonder, can nqp::splice do that for you?
or does it complain because nqp::list and nqp::list_s don't match up and it'd have to box?
MasterDuke m: use nqp; my $a := nqp::list_s("ab", "cd"); my $b := nqp::list(); nqp::splice($b, $a, 0, nqp::elems($a)) 12:54
jnthn Probably, yeah
camelia rakudo-moar 266f34: OUTPUT«MVMArray: atpos expected string register␤ in block <unit> at <tmp> line 1␤␤»
jnthn You'd have to write a loop
timotimo OK :(
jnthn Which shouldn't be so hard? :) 12:55
timotimo let's build a combination of splice for every combination of _o, _i, _n, _s :)
but but but performance ;)
code size!
MasterDuke jnthn: you'd be surprised what i couldn't get right last night
13:08 pyrimidi_ joined
MasterDuke now spectests clean, that took *way* longer than it should have 15:00
timotimo seems like your changes to the code made rakudo a bit slower? :P 15:01
oh, you don't mean it's been doing a spec test run since you last rote 15:02
wrote*
MasterDuke ha, no. it took me way longer than it should have to get the changes correct 15:03
timotimo i know that feeling all too well 15:04
MasterDuke is there any speed difference between `while nqp::iterator { nqp::shift }` and `for nqp::elems { nqp::atpos }`? 15:06
timotimo good question 15:07
MasterDuke m: use nqp; my $n := nqp::list_i(2, 4, 6, 8, 10, 12, 14, 16, 18, 20); my int $s = 0; for ^100_000 { my $i := nqp::iterator($n); while $i { $s += nqp::shift_i($i) }; }; say $s; say now - INIT now 15:12
camelia rakudo-moar 266f34: OUTPUT«11000000␤0.38052691␤»
MasterDuke m: use nqp; my $n := nqp::list_i(2, 4, 6, 8, 10, 12, 14, 16, 18, 20); my int $s = 0; for ^100_000 { my int $i = nqp::elems($n); for ^$i { $s += nqp::atpos_i($n, $i) }; }; say $s; say now - INIT now 15:13
camelia rakudo-moar 266f34: OUTPUT«0␤3.322353␤»
MasterDuke wow, wasn't expecting that big of a difference
`for nqp::elems { nqp::atpos }` 10x slower 15:15
timotimo wow
well, the iterator has something basically better than native int for going through the array
interestingly, the second one gives 0 15:16
what's that all about?
MasterDuke oh hey, odd 15:17
timotimo oh
you're using $i there
should be using $_
so you're always accessing out of bounds?
MasterDuke m: use nqp; my $n := nqp::list_i(2, 4, 6, 8, 10, 12, 14, 16, 18, 20); my int $s = 0; for ^100_000 { my int $i = nqp::elems($n); for ^$i { $s += nqp::atpos_i($n, $_) }; }; say $s; say now - INIT now
camelia rakudo-moar 266f34: OUTPUT«11000000␤3.36412964␤»
MasterDuke still slow 15:18
moritz
.oO( it's easy to give the wrong answer in O(1) )
timotimo i guess that means our iterators are cool
moritz: unless you want to always give the wrong answer! :)
in which case you'll have to be careful not to accidentally give the right answer
15:20 pyrimidine joined
MasterDuke is pondering investigating all uses of nqp::elems in NQP and Rakudo to see if they're being used for looping and could be replaced with iteratoring (which by the way sounds awesome, even if not correct) 15:21
timotimo might be worth a shot
MasterDuke 169 of them in NQP, 675 in Rakudo 15:22
interesting, in nqp, elems+atpos is just slightly faster 15:36
nqp: my num $t := nqp::time_n(); my $n := nqp::list_i(2, 4, 6, 8, 10, 12, 14, 16, 18, 20); my int $s := 0; my int $c := 0; while ++$c < 5_000_000 { my $i := nqp::iterator($n); while $i { $s := $s + nqp::shift_i($i) }; }; say($s); say(nqp::time_n() - $t) 15:39
camelia nqp-moarvm: OUTPUT«549999890␤2.32571053504944␤»
MasterDuke nqp: my num $t := nqp::time_n(); my $n := nqp::list_i(2, 4, 6, 8, 10, 12, 14, 16, 18, 20); my int $s := 0; my int $c := 0; while ++$c < 5_000_000 { my int $i := nqp::elems($n); while --$i >= 0 { $s := $s + nqp::atpos_i($n, $i) }; }; say($s); say(nqp::time_n() - $t)
camelia nqp-moarvm: OUTPUT«549999890␤2.22173023223877␤»
moritz please don't rely on camelia for benchmarks
it runs in a VM on a multi-user system
and has other features (like background compilation/updates) that make it *very* unsuitable for benchmarks 15:40
MasterDuke moritz: just demoing for the channel, i'm running a little bit more rigorous tests on my machine
moritz MasterDuke: ok, good
15:53 colomon_ joined 15:58 pyrimidi_ joined 16:02 camelia joined
Geth MoarVM: timo++ created pull request #536:
vmhealth op that spits out some stats
16:32
timotimo ^- opened for discussion 16:33
and review and such
17:34 geekosaur joined 17:59 nine joined 18:01 camelia joined 18:02 geekosaur joined 18:11 colomon joined 18:16 colomon joined 18:21 colomon joined 18:26 colomon joined 19:12 ilmari[m] joined 19:29 agentzh joined 19:32 colomon_ joined 20:16 pyrimidine joined 20:29 agentzh joined 21:40 colomon_ joined 22:14 lucasb joined 22:27 agentzh joined
samcv what does anybody think of this brainstormed idea gist.github.com/samcv/fca0ba6e76db...d50ad124ca 23:09
for storing the bitfield indexes. right now in UCD-gen.p6 i make a huge if else chain
but this is something i came up with today 23:10
and we could use binary search or something more complex to know where in the sorted_table to look first 23:13
without having to go through a huge if else chain
not sure how big it would end up being though
looks like would take 16kb currently 23:17