Perl 6 - the future is here, just unevenly distributed

IRC log for #moarvm, 2017-01-26

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

All times shown according to UTC.

Time Nick Message
00:04 timotimo gnite jnthn
00:34 MasterDuke timotimo, dogbert17_: how do you get a perl6 level backtrace in gdb?
00:49 timotimo call MVM_dump_backtrace(tc)
00:50 timotimo will probably have to "up" a few times until you find a frame that has "tc" in it
00:50 timotimo MasterDuke: ^
00:50 timotimo oh, you already found out
01:02 pyrimidine joined #moarvm
01:13 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:53 pyrimidine joined #moarvm
03:28 MasterDuke how do i create an MVMString that's just the null char (e.g., '\0')?
03:55 pyrimidine joined #moarvm
05:07 geekosaur joined #moarvm
05:08 pyrimidine joined #moarvm
05:11 samcv uhm MasterDuke
05:11 samcv there's uh
05:12 samcv one i added recently could do it
05:14 MasterDuke some function you added?
05:14 samcv MVM_unicode_codepoints_c_array_to_nfg_string
05:14 MasterDuke thanks, i'll take a look
05:14 samcv yeah i added it for my MVM_unicode_string_from_name "\c[unicode sequence here]"
05:15 samcv here's how i called it MVM_unicode_codepoints_c_array_to_nfg_string(tc, (MVMCodepoint *) pointerto 32bit int, array_size);
05:16 samcv err actually MasterDuke you may want to look at chr?
05:16 samcv but the one i just said will work for sure
05:17 samcv MasterDuke, yeah here MVM_string_chr(tc, MVMGrapheme32);
05:17 samcv will give you back an MVM_string
05:18 MasterDuke what's the codepoint for '\0'?
05:18 samcv 0
05:18 MasterDuke doh
05:18 samcv (MVMGrapheme32) 0
05:18 samcv think that shuld work
05:20 MasterDuke seems to do what i want so far, thanks
05:20 samcv \o/
05:25 MasterDuke it worked, but what i tried is slower than the existing code. oh well
05:30 MasterDuke samcv: do you happen to know if there's a way in moar to catch exceptions thrown in moar?
05:30 samcv no i do not know
05:30 samcv what are you working on?
05:31 MasterDuke playing around with radix, trying to make it faster in the case of calling it with base = 10 and all ascii chars
05:33 MasterDuke but few MVMStrings actually have a body.storage_type of ascii
05:34 MasterDuke so converting them to ascii (regular char *) so strtoll can be called on them is actually slower
05:37 samcv strtoll what base are you converting?
05:37 MasterDuke the one passed in an nqp::radix() call
05:38 samcv is this arbitrary base?
05:38 MasterDuke yeah
05:38 samcv ok
05:38 MasterDuke well, up to 36
05:38 samcv cause i have a fast atoi function but that's just base 10
05:38 samcv so we used strtoll before?
05:38 MasterDuke yeah
05:38 MasterDuke this is the radix function: https://github.com/MoarVM/MoarVM/blob/master/src/core/coerce.c#L352
05:39 MasterDuke it's what gets called by nqp::radix()
05:39 samcv #define strtoll _strtoi64
05:40 MasterDuke but doing +"1234" calls coerce_s_[i,n], which is faster
05:40 MasterDuke but that dies if it gets a Unicode Nd
05:40 samcv so coerce is faster than radix?
05:40 samcv ah
05:40 MasterDuke coerce just calls strtoll
05:41 samcv you're just trying to make it faster for base 10 right?
05:41 samcv see my fast_atoi function
05:41 MasterDuke well, faster for everything would be even better, but base 10 is the most common, so gains there would be great also
05:41 samcv https://github.com/MoarVM/MoarVM/blob/master/src/strings/normalize.c#L330
05:42 samcv was like at least 4x faster than strtol
05:43 MasterDuke hm, doesn't do much error checking though. i'll have to think if i can guarantee when i could use that
05:43 samcv yeah
05:44 samcv i don't use it on user inputted data tho, just cause the canonical combining class is stored an ascii
05:44 samcv well i have to get the ascii string because the enum isn't in order
05:44 samcv so sped up slurping a big file
05:44 samcv by 15%
05:44 MasterDuke yeah, radix can get called with anything though
05:45 MasterDuke but maybe we can quickly figure out if the string is safe
05:45 samcv yeah
05:46 pyrimidine joined #moarvm
05:47 MasterDuke essentially what i'm doing to test now is convert from MVMString to ascii, replacing any non-ascii chars with '\0', and then checking if strlen == chars of the MVMString
05:47 samcv ah
05:49 MasterDuke but that conversion to ascii seems to be where the performance is lost
05:50 MasterDuke MVM_string_ascii_encode_substr
05:54 samcv hm
05:54 samcv does it need to be substr or can it just do the whole string?
05:56 samcv oh nvm MVM_string_ascii_encode just calls the substr one
05:56 MasterDuke an offset is passed to radix. also MVM_string_ascii_encode (without the substr) doesn't do the non-ascii replacement, it just dies if it sees any non-ascii char
05:56 MasterDuke dies because it passes NULL as the replacement to the substr one
05:57 samcv make MVM_string_ascii_encode_substr faster?
05:57 samcv or find some way to check the cp's of the string before converting
05:58 MasterDuke i don't see anything obvious to try in MVM_string_ascii_encode_substr
05:58 samcv you can get the graphemes at each point in the strings
05:59 samcv and see if they're all in the ascii range
05:59 MasterDuke well, that's pretty much what radix does. just walk the string looking at each char
06:05 MasterDuke if MVM_STRING_GRAPHEME_ASCII's were created instead of the other types, we could fast-path them without all the expensive conversion and checking
06:05 MasterDuke but none are created during a compile of nqp or rakudo
06:07 MasterDuke any idea how expensive it is to convert/upgrade a MVM_STRING_GRAPHEME_ASCII string to a MVM_STRING_GRAPHEME_32?
06:08 MasterDuke ahh, so late! off to sleep. later...
06:13 samcv night!
06:13 samcv i may be going to sleep soon too
06:17 TimToady joined #moarvm
06:47 pyrimidine joined #moarvm
07:08 domidumont joined #moarvm
07:15 domidumont joined #moarvm
07:53 brrt joined #moarvm
08:28 zakharyas joined #moarvm
08:44 geekosaur joined #moarvm
10:21 dalek joined #moarvm
11:00 pyrimidine joined #moarvm
11:06 pyrimidine joined #moarvm
11:15 brokenchicken oh cool, lizmat is part of TPF too
11:16 brokenchicken call for new TPF grants committee member: http://news.perlfoundation.org/2017/01/grants-committee-needs-a-new-m.html
11:18 timotimo that post already has a spam reply :\
11:24 pyrimidine joined #moarvm
11:29 brokenchicken heh
11:49 FROGGS joined #moarvm
12:02 lizmat brokenchicken: I'm not part of TPF, I'm just a member of the grants committee
12:03 brokenchicken Oh, I thought one implied the other...
12:03 lizmat nope  :-)
12:49 moritz lizmat: how much time do you invest in grant commitee work?
13:04 [Coke] lizmat: I mean, if you squint, we might be considered part of the TPF. but we really have zero exposure to anything outside of "please vote on this grant."
13:04 [Coke] (that last part to not-lizmsat.)
13:04 [Coke] *lizmat. (wow, typo'd it AGAIN with the s)
13:05 moritz lizmsat sounds like a cool name for a satellite :-)
13:05 [Coke] if you just vote and don't manage grants, the time committment is pretty small. (at most a few hours every few months, and that's if there's a large number (or number of contentious) grants.
13:06 [Coke] secretary is a much bigger time commitment, and I'm sure makoto would be happy to discuss that.
13:06 [Coke] (I am of course answering your lizmat-directed question for me, not liz. :)
13:08 moritz [Coke]: ok, thanks
13:09 moritz [Coke]: would you like to nominate me as a member (not secretary)?
13:13 lizmat moritz: what [Coke] said
13:33 [Coke] moritz: I would.
13:34 * lizmat would second that :-)
13:35 [Coke] Done.
13:36 moritz thanks
15:09 FROGGS joined #moarvm
15:58 domidumont joined #moarvm
18:01 samcv joined #moarvm
19:01 pyrimidine joined #moarvm
19:19 pyrimidine joined #moarvm
19:36 pyrimidine joined #moarvm
19:56 pyrimidine joined #moarvm
20:31 zakharyas joined #moarvm
21:37 pyrimidine joined #moarvm
21:54 pyrimidine joined #moarvm
22:11 pyrimidine joined #moarvm
23:03 MasterDuke samcv: managed to make radix take fewer instructions according to callgrind, but it still takes the same amount of time
23:03 MasterDuke so far i've accomplished both one step forward and two steps back, and one step forward and one step back
23:04 * MasterDuke is not the best person to be doing this
23:06 timotimo you can decrease the amount of instructions, but reduce the number of instructions per cycle
23:06 pyrimidine joined #moarvm
23:07 timotimo i *think* time -v could display that
23:07 timotimo aha, perf can give you an IPC measurement
23:07 timotimo perf stat -B dd if=/dev/zero of=/dev/null count=1000000
23:07 timotimo [...]
23:07 timotimo 1,403,561,257 instructions             #      0.679 IPC   (scaled from 50.23%)
23:07 timotimo 2,066,201,729 cycles                   #   2160.227 M/sec (scaled from 66.67%)
23:08 timotimo ^- there you can see it
23:08 timotimo MasterDuke: you think this can help you?
23:11 MasterDuke timotimo: cool
23:12 timotimo tbh i don't know what this "scaled from" thing is about
23:13 MasterDuke my output of perf stat -B looks kind of different
23:13 MasterDuke what os are you on?
23:14 timotimo https://perf.wiki.kernel.org/index.php/Tutorial
23:14 timotimo i copy-pasted it from here
23:14 timotimo 254,043,038      cycles:u                  #    2.641 GHz
23:14 timotimo 416,806,930      instructions:u            #    1.64  insn per cycle
23:14 timotimo this is what i get locally
23:14 timotimo the :u means it measured at user-level rather than kernel-level, i believe
23:14 MasterDuke 2,173,434,367      instructions:u            #    1.73  insn per cycle
23:15 MasterDuke the IPC doesn't seem terribly different between my two versions, but i guess even a small change can add up
23:15 MasterDuke afk for a bit
23:16 timotimo don't have a clue ;)
23:32 timotimo perf record -e cache-misses gives something entirely unsurprising
23:32 timotimo 7.6% in MVM_serialization_read_int is the highest bidder
23:32 timotimo followed closely by 6.8% in MVM_gc_gen2_allocate
23:33 timotimo and 6.13% in MVM_bytecode_unpack
23:34 timotimo oooh neat
23:34 timotimo perf stat has a -r flag that makes it run the same command multiple times and give you stats about the values it outputs
23:45 ggoebel joined #moarvm
23:47 Geth MoarVM/line_based_coverage_pr: a66e2475c5 | (Timo Paulssen)++ | 16 files
23:47 Geth MoarVM/line_based_coverage_pr: Merge the line based coverage functionality.
23:47 Geth MoarVM/line_based_coverage_pr: review: https://github.com/MoarVM/MoarVM/commit/a66e2475c5
23:49 samcv MasterDuke, curious about what you changed to get a few less instructions
23:49 Geth MoarVM: timo++ created pull request #512: Line based coverage pr
23:49 Geth MoarVM: review: https://github.com/MoarVM/MoarVM/pull/512
23:49 pyrimidine joined #moarvm
23:50 timotimo how's the roadmap towards putting the compressed list of names into moarvm master branch?
23:50 pyrimidi_ joined #moarvm
23:50 timotimo will it go in as a part of a complete ucd2c.pl rewrite?
23:51 samcv uhm if people want it i can try and de it before
23:51 samcv but it was going to go in as part of the rewrite, but we can do it sooner, and phase in the sections, which may be smart
23:54 samcv or at least have it in another branch at first
23:56 timotimo i don't know if it'd be a good idea. might be wasted effort
23:56 timotimo IMO either way would be totally fine
23:57 samcv it wouldn't be the hardest thing to do
23:57 samcv so i think it may be worth doing
23:57 timotimo optimize for fun :)
23:57 samcv easier than the other parts

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