Perl 6 - the future is here, just unevenly distributed

IRC log for #moarvm, 2017-02-14

| Channels | #moarvm index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:44 `_^gk`_^1wm`_^ joined #moarvm
01:01 pyrimidine joined #moarvm
01:26 pyrimidine joined #moarvm
02:48 ilbot3 joined #moarvm
02:48 Topic for #moarvm is now https://github.com/moarvm/moarvm | IRC logs at  http://irclog.perlgeek.de/moarvm/today
02:51 pyrimidine joined #moarvm
02:54 pyrimidi_ joined #moarvm
03:57 pyrimidine joined #moarvm
04:11 zakharyas joined #moarvm
04:34 MasterDuke samcv: re https://github.com/samcv/UCD/blob/master/UCD-gen.p6#L808-L857, a quick test on my machine shows that Int hash keys were slightly faster
04:34 MasterDuke m: my %h; for ^100_000 { %h{$_} = 1; }; say %h.keys.sort(*.Int).elems; say now - INIT now
04:34 camelia rakudo-moar aac9ef: OUTPUT«100000␤3.63051851␤»
04:34 MasterDuke m: my %h{Int}; for ^100_000 { %h{$_} = 1; }; say %h.keys.sort.elems; say now - INIT now
04:34 camelia rakudo-moar aac9ef: OUTPUT«100000␤2.89883963␤»
04:50 pyrimidine joined #moarvm
04:55 pyrimidine joined #moarvm
05:07 Geth ¦ MoarVM: MasterDuke17++ created pull request #537: Del unused var, don't call MVM_string_graphs twice
05:07 Geth ¦ MoarVM: review: https://github.com/MoarVM/MoarVM/pull/537
05:13 pyrimidine joined #moarvm
06:59 pyrimidine joined #moarvm
08:17 samcv MasterDuke, how does that make any sense... it has to look up them in other hashes
08:17 samcv so it'd have to convert back to a string. or do you just mean the sort operation
08:17 samcv the sort operation is fairly fast. the issue is all the rest
08:18 samcv it would slow it down a lot to do that, because it'd slow down the rest of the things in the code
08:23 samcv timotimo, it's been moved to its own sub now, just pushed
08:23 samcv https://github.com/samcv/UCD/blob/master/UCD-gen.p6#L755
08:24 samcv at least it doesn't take like 8 minutes anymore at least
08:24 samcv or probably much longer than that, not sure
08:36 agentzh joined #moarvm
09:03 pyrimidine joined #moarvm
09:16 zakharyas joined #moarvm
10:04 pyrimidine joined #moarvm
10:17 pyrimidine joined #moarvm
11:00 Ven joined #moarvm
11:07 agentzh joined #moarvm
11:17 pyrimidine joined #moarvm
11:41 zakharyas joined #moarvm
12:05 zakharyas joined #moarvm
12:22 pyrimidine joined #moarvm
12:34 brrt joined #moarvm
12:34 brrt .tell samcv that yes, to correctly step in a C-language program, you need to compile with --optimize=0
12:34 yoleaux2 brrt: I'll pass your message to samcv.
12:35 samcv but that defaults the point :P
12:35 yoleaux2 12:34Z <brrt> samcv: that yes, to correctly step in a C-language program, you need to compile with --optimize=0
12:35 brrt why?
12:35 samcv since i really only care about the final compiled stuff
12:35 brrt if that's what you want, use si to step individual instructions
12:35 samcv if an ugly if else chain with tons of -= is faster then that's faster (turned out to be 20% slower than linear search)
12:36 samcv ok thanks
12:36 samcv maybe more than 20% slower, forget
12:36 brrt i'm typically setting display /10i $rip
12:36 samcv ?
12:36 brrt if i'm stepping through machine code
12:36 brrt but to be fair, i try to avoid that nowadays
12:36 brrt takes a long time and provides very little insight
12:38 timotimo i should steal that display line
12:38 brrt and interpreting register values is .. nearly impossible
12:38 timotimo if i ever need to si
12:38 timotimo if i ever need to "si" the machine code
12:38 brrt it is from memory, so may not be 100%correct
12:38 samcv k
12:38 samcv i am off to bed. night all
12:38 brrt sleep well
12:38 ggoebel joined #moarvm
12:39 timotimo nite sam
12:39 timotimo oh
12:39 timotimo i still need to write the "from codepoint to name" code, right?
12:39 samcv yes :P
12:39 timotimo right
12:39 timotimo oh, look, a squirrel
12:39 * timotimo chases
12:40 samcv for some reason it gets off track but i'm not sure if it's the code or if it's something else being off
12:42 samcv will need to write some testing harness for it so i can check at what point it messes up
12:42 samcv but it's like thousands of cp's in at least
12:43 timotimo what's "it" here? the stuff you've been working on in C code with if/elseif vs the table, yes?
12:43 samcv oh no, talking about the names here
12:43 samcv but also need to do the same for the bitfield file
12:44 samcv going to be outlining the project plan tomorrow, so I think that's a good partial way point that needs to be done before adapting the code to the mvm base and other thing sthat need to happen before integration
12:44 samcv gotta write out the 'inch stones' as the pod template calls them
12:44 timotimo mhm
12:44 timotimo i wonder if we can have any benefit from the many 0 fields in the bitfield rows at all
12:44 samcv night though o/
12:44 timotimo yeah, night!
12:45 samcv the many 0 fields?
12:45 timotimo i seem to recall seeing many 0 entries
12:45 samcv well those are mostly boolean. the size of the bitfield is really not that big
12:45 timotimo oh!
12:45 samcv they only take 1 bit width
12:45 timotimo well, that makes a big difference, then :)
12:45 samcv :)
12:46 samcv may eventually pack them into bigger integers but that would be after some other things happen first
12:46 samcv but at least as far as i've tested it up several hundred cp's the bitfield works perfectly
12:46 samcv and grabbing enum values etc
12:46 samcv pretty happy with progress so far
12:47 samcv night!
13:13 pyrimidine joined #moarvm
13:18 pyrimidine joined #moarvm
13:40 agentzh joined #moarvm
14:20 pyrimidine joined #moarvm
14:40 Geth joined #moarvm
14:46 SmokeMachine joined #moarvm
14:52 BinGOs joined #moarvm
15:03 pyrimidine joined #moarvm
15:19 agentzh joined #moarvm
16:03 pyrimidine joined #moarvm
16:08 brrt joined #moarvm
16:41 pyrimidine joined #moarvm
17:00 pyrimidine joined #moarvm
18:33 ggoebel joined #moarvm
19:21 agentzh joined #moarvm
19:29 samcv timotimo, you around
19:32 timotimo yup
19:33 samcv ok so i put that sub that makes/dedups the bitfield rows in its own sub
19:33 timotimo yup, i saw
19:33 samcv what are the steps needed to check on speshalization or JITing?
19:33 timotimo i started a perf run and then promptly forgot about it
19:34 samcv heh
19:34 timotimo set the env vars MVM_SPESH_LOG and MVM_JIT_LOG to a filename
19:35 timotimo you ought to see the name of the sub show up there
19:37 timotimo in the spesh log you'll see three stages for each instance of a given candidate for a given frame to show up in
19:38 timotimo "inserting log instructions" (oslt) gives you the raw bytecode in its "before" and tells you where it grabs registers for closer inspection in the "after" section
19:40 timotimo there's tools/graph_spesh.p6 or so that'll eat a single frame copy-pasted into its stdin and spit out a .dot that you can put into the "dot" command
19:40 timotimo like graph spesh | dot -Tsvg > speshgraph.svg
19:40 timotimo or -Tpng
19:41 timotimo actually, -Tx11 is best, because you can scroll around in it
19:45 samcv hmm k
19:53 timotimo gonna go pick up a bit of food for me, my friend, and our cats
19:53 timotimo well, the food isn't meant for the cats, but they end up getting their will one way or the other
19:54 samcv kk
19:54 samcv i'll brb too
19:54 timotimo maybe you can get me inspired to finally build the cp-to-name code …
19:56 IOninja Was there any conversation vis-á-vis merging the coverage branch into master?
19:56 IOninja Like what's stopping it from occuring.
19:58 IOninja I wanna use it, but don't know how to unbust it when it gets busted by new stuff in master making master unmergeable
20:19 agentzh joined #moarvm
20:27 agentzh joined #moarvm
20:57 timotimo someone has to review it
21:26 agentzh joined #moarvm
21:30 * jnthn did leave a comment on it
21:30 jnthn I forgot that I wrote :)
21:49 timotimo oh? i think i didn't even notice that :s
21:55 ggoebel joined #moarvm
21:56 samcv hmm i don't see dedupe-rows in the spesh log or the jit log
21:57 samcv kate is saying both contain invalid UTF-8 characters :P
21:57 samcv do we utf-8 encode it before writing?
21:58 samcv weird
22:18 jnthn Did you try --profile also? That shows some stats on spesh/JIT
22:21 samcv no
22:21 jnthn In fact, half of the reason I wrote the profiler was to understand how those two behaved on code ;)
22:22 jnthn And to try and give others insight into that, of course :)
22:22 samcv can i look at how spesh/jit perform on a single sub?
22:22 jnthn On the routines tab, it should show how many calls were interpreted, spesh'd, and JIT'd.
22:23 jnthn (In the --profile output, that is)
22:23 samcv i remember in this section it was JIT'd a lot when it was in pure perl6
22:23 samcv writing it in nqp made it orders of magnitude faster, but would still like it faster than 70s
22:23 jnthn In the next iteration of spesh, I'd like to get it to be able to explain more of the stuff it goes
22:23 samcv to do that section
22:23 jnthn *it does
22:24 samcv running profile now
22:24 jnthn Suspect it'll be late spring before I dig into that though
22:26 * jnthn will be doing Perl 6 stuffs tomorrow o/
22:37 hoelzro_ joined #moarvm
22:43 BinGOs joined #moarvm
22:46 mst joined #moarvm
22:47 geekosaur joined #moarvm
22:52 BinGOs joined #moarvm
22:58 leedo joined #moarvm
23:23 samcv so it's totally red, the spesh/jit bar
23:24 timotimo oh crap
23:24 samcv is that bad
23:25 timotimo it means it didn't even go through the spesh at all
23:25 timotimo what other things are all red?
23:27 samcv push is mostly red
23:27 samcv 90% red
23:27 samcv one other push is all red
23:27 jnthn Sleep time for me.
23:27 timotimo the red things, do they have few invocations?
23:27 samcv some anon things are all red
23:27 jnthn Will be interested to backlog this tomorrow :)
23:27 jnthn 'night
23:27 samcv night jnthn
23:28 samcv uh the first push has 419657
23:28 samcv and 90% red
23:28 samcv tiny bit of yellow
23:29 timotimo hmm ... i think if you have interpolation in calls and such that'll usually prevent spesh?
23:29 samcv post circumfix { } looks like 40% red, 30% yellow and 15% green or something
23:29 timotimo but other than that ... not being called often enough will prevent it
23:29 samcv like string interpolation?
23:29 timotimo no
23:29 timotimo only argument interpolation
23:30 timotimo string interpolation gets compiled to a bunch of ~ calls
23:30 samcv map is half red 868842 entries
23:30 timotimo like flattening with |@foo or |%bar
23:30 samcv ah ok
23:30 timotimo map itself hardly does anything
23:30 timotimo can you sort by exclusive time and look at what's up top?
23:30 samcv SETTING::src/core/Any-iterable-methods.pm:454
23:30 samcv at 20%
23:31 samcv idk if that's accurate?
23:31 timotimo sink-all, ok
23:31 samcv i mean dedupe rows has  40% inclusive time
23:32 samcv 0% exclusive
23:32 timotimo that's not the one you pulled out, is it?
23:32 samcv that is
23:32 timotimo oh, OK
23:32 timotimo so a good potential win
23:32 samcv and it's basically all nqp
23:32 timotimo does the "call graph" tab show anything much?
23:33 timotimo also, if it has 0% exclusive time that'd mean it does all of its work via other subs
23:33 timotimo is that the case at all?
23:33 samcv it is just nqp
23:33 samcv and those don't seem to show up
23:33 samcv doesn't do any work through other subs. that's the nqp section i pulled out
23:33 agentzh joined #moarvm
23:33 timotimo right, nqp stuff aren't calls to subs or something
23:35 samcv uh callgraph for dedupe-rows
23:35 timotimo it surprises me that it could even reach 0% exclusive time. could be calculating stuff wrong perhaps?
23:35 samcv shows 83% in sink
23:35 timotimo OK, so there's a loop in there?
23:35 timotimo can you tell what file/line the sink is from?
23:35 samcv yeah
23:35 timotimo as we have like 100 methods "sink"
23:35 timotimo maybe 500
23:35 samcv SETTING::src/core/Seq.pm:183
23:36 samcv that shows all green
23:36 timotimo OK, that's mostly "please do this for loop now k?"
23:36 samcv and only one call
23:36 samcv yeah
23:36 timotimo it should have hardly any time spent iside itself and do all of its work via the block that you have in your code fro the for loop
23:36 samcv well it's all nqp
23:36 samcv and that's why i don't think it shows up
23:37 timotimo weird. it shouldn't prevent it in any case
23:37 samcv want to see the profile?
23:38 timotimo yeah sure
23:38 samcv https://cry.nu/profile-1487111206.48787.html
23:39 timotimo oh jesus
23:39 timotimo how big is it btw?
23:39 samcv 3.5 MB
23:39 timotimo OK
23:39 timotimo that's passable
23:39 timotimo does it spend a lot of time in GC in total?
23:40 timotimo oh!
23:40 timotimo hahaha
23:40 samcv hmm?
23:40 timotimo i still had the build where the nursery is tiny
23:40 timotimo so in my profile it shows ~60% in just the hash gc_mark function
23:40 samcv lol
23:41 timotimo you have 15% in GC which isn't good, but it's not out of the ordinary
23:41 timotimo 600ms full collection time is impressive
23:43 timotimo 21% of time spent inside sorting stuff
23:43 timotimo have you considered doing something to make that not as bad?
23:44 samcv possibly
23:44 samcv i could do something for that
23:47 timotimo it might not go away fully, but 20% is a juicy target either way
23:47 timotimo what's line 766 about? from the ucd-gen script ...
23:48 timotimo ah, inside dedupe-rows
23:48 timotimo that's good, though
23:48 timotimo that one's fully jitted
23:48 timotimo you can find it in the speshlog by searching for "UCD-gen.p6:766"
23:49 samcv ok i see it
23:49 samcv the whole function is JIT'd?
23:50 timotimo well, that's only the innermost for-looped block
23:51 timotimo the *outer* for-looped block is also 100% jitted
23:51 timotimo that's the entry with line number 763
23:53 timotimo say ... can you turn one of the hashes into an array perhaps? are these hashes keyed by int?
23:54 samcv no
23:54 samcv i already removed that before
23:54 samcv they'ed keyed with strings
23:54 samcv aside from the %points hash, which i can't make an array because there's gaps
23:55 Geth joined #moarvm
23:55 timotimo the gaps are huge?
23:55 timotimo i'm not very happy that the allocations tab broke :(
23:56 samcv some are
23:57 timotimo if it were a native int or num array, then we could rely on the kernel to just leave the gaps out of memory
23:57 timotimo but you probably have objects in there, which means the GC has to go through on every major collection

| Channels | #moarvm index | Today | | Search | Google Search | Plain-Text | summary