Perl 6 - the future is here, just unevenly distributed

IRC log for #moarvm, 2017-06-16

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

All times shown according to UTC.

Time Nick Message
03:30 lizmat joined #moarvm
05:43 domidumont joined #moarvm
05:50 domidumont joined #moarvm
06:34 brrt1 joined #moarvm
06:36 domidumont joined #moarvm
07:25 brrt1 .ask jnthn, i need two operators, get_lex_type and get_reg_type, for  a spesh graph
07:25 yoleaux brrt1: What kind of a name is "jnthn,"?!
07:45 timotimo brrt: what, run-time instructions?
07:47 timotimo the spesh graph has a local_types and lexical_types that are valid if there has been inlining
07:47 timotimo otherwise you'd probably go via the staticframe
07:48 brrt hmm yeah
07:51 timotimo yeah, staticframe also has local_types and lexical_types
07:51 timotimo gotta go~
07:51 brrt see you
08:25 Geth ¦ MoarVM/even-moar-jit: 5d0db25c7b | (Bart Wiegmans)++ | 6 files
08:25 Geth ¦ MoarVM/even-moar-jit: Collect types for expr nodes
08:25 Geth ¦ MoarVM/even-moar-jit:
08:25 Geth ¦ MoarVM/even-moar-jit: We need this to ensure that we can mark object / string values as such
08:25 Geth ¦ MoarVM/even-moar-jit: when we spill them to memory. Also, unify handling of read/write
08:25 Geth ¦ MoarVM/even-moar-jit: operands, bailing if we have a non-zero write operand. bindlex is a
08:25 Geth ¦ MoarVM/even-moar-jit: destructive template.
08:25 Geth ¦ MoarVM/even-moar-jit: review: https://github.com/MoarVM/MoarVM/commit/5d0db25c7b
08:42 * jnthn wonders if brrt is still in need of anything
08:43 brrt nah, i'm good
08:43 brrt well, maybe check if my assumptions are correct
08:43 brrt especially: https://github.com/MoarVM/MoarVM/commit/5d0db25c7b#diff-885757d740208fb28d246519b3975f86R33
08:44 jnthn Looks sensible to me
08:47 Geth ¦ MoarVM: gerd++ created pull request #607: add help text for environment variables
08:47 Geth ¦ MoarVM: review: https://github.com/MoarVM/MoarVM/pull/607
08:48 brrt thanks for checking
08:56 Geth ¦ MoarVM: 755404c915 | gerd++ | Configure.pl
08:56 Geth ¦ MoarVM: add help text for environment variables
08:56 Geth ¦ MoarVM: review: https://github.com/MoarVM/MoarVM/commit/755404c915
08:56 Geth ¦ MoarVM: 093ae97e7b | (Jonathan Worthington)++ (committed using GitHub Web editor) | Configure.pl
08:56 Geth ¦ MoarVM: Merge pull request #607 from gerd/master
08:56 Geth ¦ MoarVM:
08:56 Geth ¦ MoarVM: add help text for environment variables
08:56 Geth ¦ MoarVM: review: https://github.com/MoarVM/MoarVM/commit/093ae97e7b
09:27 jnthn m: say 16226602756 - 16068523935
09:28 camelia rakudo-moar 5facb2: OUTPUT: «Resource temporarily unavailable»
09:28 timotimo that looks like a cycle count
09:28 jnthn wat
09:28 jnthn m: say 16226602756 - 16068523935
09:28 camelia rakudo-moar 5facb2: OUTPUT: «158078821␤»
09:28 timotimo c: 16068523935 / 16226602756
09:28 committable6 timotimo, ¦1606852: «Cannot find this revision (did you mean “ff63582”?)»
09:28 timotimo c: say 16068523935 / 16226602756
09:28 committable6 timotimo, Seems like you forgot to specify a revision (will use “v6.c” instead of “say”)
09:28 timotimo c: HEAD say 16068523935 / 16226602756
09:28 committable6 timotimo, ¦v6.c (19 commits): «0.990258045792»
09:28 committable6 timotimo, ¦HEAD(5facb26): «0.990258045792»
09:28 timotimo *cough*
09:28 Geth ¦ MoarVM: 0a83384545 | (Jonathan Worthington)++ | 3 files
09:28 Geth ¦ MoarVM: Move NFG initialization into nfg.c.
09:28 Geth ¦ MoarVM: review: https://github.com/MoarVM/MoarVM/commit/0a83384545
09:28 Geth ¦ MoarVM: 5814822f13 | (Jonathan Worthington)++ | 3 files
09:28 Geth ¦ MoarVM: Cache CRLF grapheme.
09:28 Geth ¦ MoarVM:
09:28 Geth ¦ MoarVM: Saves us resolving it every single time. This, on a read a million
09:28 Geth ¦ MoarVM: lines benchmark in Perl 6, saves 158 million cycles.
09:28 Geth ¦ MoarVM: review: https://github.com/MoarVM/MoarVM/commit/5814822f13
09:29 * timotimo BBL again
09:41 jnthn m: say 16068523935 - 15989524161
09:41 camelia rakudo-moar 5facb2: OUTPUT: «78999774␤»
09:42 Geth ¦ MoarVM: f0854ac46d | (Jonathan Worthington)++ | 2 files
09:42 Geth ¦ MoarVM: Cache maximum separator length.
09:42 Geth ¦ MoarVM:
09:42 Geth ¦ MoarVM: Meaning that we need not calculate it every time we want to look for
09:42 Geth ¦ MoarVM: a line separator. On a read a million lines benchmark in Perl 6, saves
09:42 Geth ¦ MoarVM: 79 million instructions.
09:42 Geth ¦ MoarVM: review: https://github.com/MoarVM/MoarVM/commit/f0854ac46d
09:44 dogbert17_ How fast are we now?
09:47 dogbert17_ is it perl5 speed?
09:47 jnthn Not yet
09:47 jnthn m: 1.793 / 1.134
09:47 camelia rakudo-moar 5facb2: OUTPUT: «WARNINGS for <tmp>:␤Useless use of "/" in expression "1.793 / 1.134" in sink context (line 1)␤»
09:47 jnthn m: say 1.793 / 1.134
09:48 camelia rakudo-moar 5facb2: OUTPUT: «1.581129␤»
09:48 jnthn We still take 1.6x longer
10:02 jnthn m: say 15989524161 - 15569412274
10:02 camelia rakudo-moar 5facb2: OUTPUT: «420111887␤»
10:02 dogbert17_ not too bad
10:13 Geth ¦ MoarVM: a8f2ac74fa | (Jonathan Worthington)++ | 2 files
10:13 Geth ¦ MoarVM: Cache a list of final separator graphemes.
10:13 Geth ¦ MoarVM:
10:13 Geth ¦ MoarVM: This makes it cheaper to check if the current grapheme we have just
10:13 Geth ¦ MoarVM: decoded/normalized is a stopper. On a read a million lines benchmark
10:13 Geth ¦ MoarVM: in Perl 6, this saves 420 million instructions.
10:13 Geth ¦ MoarVM: review: https://github.com/MoarVM/MoarVM/commit/a8f2ac74fa
10:18 geekosaur joined #moarvm
10:19 geekosaur joined #moarvm
10:23 jnthn Turns out trying to use memmem as a filter makes things worse
10:23 jnthn Incredibly so
10:39 jnthn m: say 15569412274 - 14724412255
10:39 camelia rakudo-moar 5facb2: OUTPUT: «845000019␤»
10:41 Geth ¦ MoarVM: 8fa1857837 | (Jonathan Worthington)++ | 2 files
10:41 Geth ¦ MoarVM: Introduce a max final grapheme codepoint filter.
10:41 Geth ¦ MoarVM:
10:41 Geth ¦ MoarVM: This means we can usually avoid a separator search loop entirely in
10:41 Geth ¦ MoarVM: the common case where separators are control chars. In the Perl 6
10:41 Geth ¦ MoarVM: million line file benchmark, where each line is 60 chars long, this
10:41 Geth ¦ MoarVM: saves 845 million cycles. (How much it helps will depend on line
10:41 Geth ¦ MoarVM: length; the longer the line, the more it will help.)
10:42 Geth ¦ MoarVM: review: https://github.com/MoarVM/MoarVM/commit/8fa1857837
10:45 jnthn That helped rather more
11:03 Geth ¦ MoarVM: 8972ab2ee2 | (Jonathan Worthington)++ | 4 files
11:03 Geth ¦ MoarVM: We never have both separator and char limit.
11:03 Geth ¦ MoarVM:
11:03 Geth ¦ MoarVM: So use an `else if` to save an extra check/branch. Gets 56 million
11:03 Geth ¦ MoarVM: instructions off the Perl 6 million lines/60 chars per line benchmark.
11:03 Geth ¦ MoarVM: review: https://github.com/MoarVM/MoarVM/commit/8972ab2ee2
11:03 jnthn And that one's a case of "every little helps", I guess :)
11:04 jnthn Remembering to have lunch will also help...bbl
11:31 brrt joined #moarvm
11:42 AlexDaniel joined #moarvm
12:07 jnthn Righty, let's try and squeeze some more out of this :)
12:11 timotimo i have a local patch on my laptop that moves a "if (!result.o) { result.o = tc->instance->VMNull }" from one if branch inside MVMIter's MVM_iterval out to the end
12:12 timotimo i think i did that to fix a crashbug involved with iterating over something - likely an array?
12:12 timotimo but i never committed it?
12:13 timotimo but that'd require an atpos to be able to return a low-level null; is that possible?
12:13 jnthn I don't think that happens anywhere
12:14 timotimo yeah, doesn't seem so
12:14 timotimo i have no idea from what date/time that patch is %)
13:06 robertle joined #moarvm
13:08 jnthn Grrr
13:08 * jnthn managed to achieve "fast and wrong"
13:09 lizmat .oO( now for the sequel: quick fix and right :-)
13:30 * jnthn feeds attempt two to the test suite
13:32 timotimo i wonder if it'd be helpful to use the FSA for the buffers we have in decodestream and such
13:33 jnthn Depends which ones you mean
13:33 timotimo i don't know what the buffer sizes typically are
13:33 timotimo i'm just seeing a bunch of malloc calls from MVM_decodestream :)
13:33 jnthn I'm aware of one possible change in that area that may help, though
13:33 timotimo cool
13:37 jnthn m: say 1.365 / 1.691
13:37 camelia rakudo-moar 5facb2: OUTPUT: «0.807215␤»
13:37 jnthn Think I've got another 20% off
13:37 timotimo wow
13:40 timotimo gah, i can no longer just "nqp::sayfh(nqp::getstderr(), "foo bar")" in nqp code because the char API is gone :)
13:40 jnthn But NQP has a note(...) sub :P
13:40 eveo note("foo bar")
13:40 jnthn And has for a long while :P
13:41 timotimo that's fair, i suppose
13:41 timotimo i was afraid of using something as high level as a sub inside the methods method of MethodContainer :P
13:41 jnthn m: say 14668412249 - 11451760612
13:41 camelia rakudo-moar 5facb2: OUTPUT: «3216651637␤»
13:43 timotimo can't use note, it's VMNull at that time
13:43 nwc10 jnthn: 20% off, but then taxes, booking fee, admin fee and all the small print and it's actually still slower? :-/
13:44 nwc10 (or the result arrives a terminal 200km from where you actually wanted it, and after you factor in the cost of travel from there to here, it's more expensive)
13:45 timotimo with a try { } around the note it actually never even runs once
13:49 Geth ¦ MoarVM: a6abd3c665 | (Jonathan Worthington)++ | src/strings/utf8.c
13:49 Geth ¦ MoarVM: Add a UTF-8 decoding fast-path.
13:49 Geth ¦ MoarVM:
13:49 Geth ¦ MoarVM: In many cases, we are reading things that are already in normal form
13:49 Geth ¦ MoarVM: thanks to being in the ASCII/Latin-1 range, which we can very cheaply
13:49 Geth ¦ MoarVM: check. Add a fast path to the UTF-8 decoder for this case. It doesn't
13:49 Geth ¦ MoarVM: actually skip anything UTF-8 related, but rather can take a shortcut
13:49 Geth ¦ MoarVM: on the full normalizer. On the benchmark reading a million lines using
13:49 brrt joined #moarvm
13:49 Geth ¦ MoarVM: <…commit message has 8 more lines…>
13:49 Geth ¦ MoarVM: review: https://github.com/MoarVM/MoarVM/commit/a6abd3c665
13:50 jnthn nwc10: No, that was after paying the taxes. The first attempt was a bit more off but also wrong.
13:50 timotimo cool. i was able to put atan2_n in the function and count occurences with a breakpoint in gdb :D
13:51 timotimo by virtue of gdb counting up from $1 for each "print 'methods called'" i also get a nice little sum at the end
13:52 timotimo huh, i expected more than three calls to method methods during the core setting compilation
13:52 * timotimo BBL
13:54 [Coke] jnthn: nifty commit.
14:04 jnthn [Coke]: Yeah, was a bit fiddly to get right, though. Glad we have lots of tests :)
14:21 timotimo nice.
14:26 Geth ¦ MoarVM: 9c5ea41cc7 | (Jonathan Worthington)++ | 2 files
14:26 Geth ¦ MoarVM: Keep last freed chars buffer handy for re-use.
14:26 Geth ¦ MoarVM:
14:26 Geth ¦ MoarVM: In steady state, we will often have just one of these at a time (for
14:26 Geth ¦ MoarVM: example, when reading lines or chunks). By keeping it around for
14:26 Geth ¦ MoarVM: re-use, we can save quite a lot of malloc/free. Gets another 446
14:26 Geth ¦ MoarVM: million instructions off the Perl 6 million lines benchmark.
14:26 Geth ¦ MoarVM: review: https://github.com/MoarVM/MoarVM/commit/9c5ea41cc7
14:36 timotimo yes! \o/
15:14 Geth ¦ MoarVM: aaffa714af | (Jonathan Worthington)++ | 6 files
15:14 Geth ¦ MoarVM: Make a smarter guess at decode result buffer size.
15:14 Geth ¦ MoarVM:
15:14 Geth ¦ MoarVM: Previously we took the bytes available to decode, but when reading
15:14 Geth ¦ MoarVM: lines there may be a thousand lines worth in the buffer. This avoids
15:14 Geth ¦ MoarVM: allocating huge chunks of memory only to throw them away again soon
15:14 Geth ¦ MoarVM: afterwards. It also is a prerequisite for just using those buffers in
15:14 Geth ¦ MoarVM: the result string rather than doing copying.
15:14 Geth ¦ MoarVM: review: https://github.com/MoarVM/MoarVM/commit/aaffa714af
15:16 Geth ¦ MoarVM: e48266b5e7 | (Jonathan Worthington)++ | src/strings/decode_stream.c
15:16 Geth ¦ MoarVM: Don't copy when we can steal decoder output.
15:16 Geth ¦ MoarVM:
15:16 Geth ¦ MoarVM: When reading lines or chunks of chars, the decoder will often produce
15:16 Geth ¦ MoarVM: a single buffer with the required content. In this case, just take it
15:16 Geth ¦ MoarVM: and use it as the string's body, instead of copying it to another
15:16 Geth ¦ MoarVM: buffer. This saves around 400 million instructions on the Perl 6 read
15:16 Geth ¦ MoarVM: a million lines benchmark.
15:16 Geth ¦ MoarVM: review: https://github.com/MoarVM/MoarVM/commit/e48266b5e7
15:36 Geth ¦ MoarVM: ea1f506170 | (Jonathan Worthington)++ | src/strings/utf8.c
15:36 Geth ¦ MoarVM: Lift read of lagging codepoint out of hot loop.
15:36 Geth ¦ MoarVM:
15:36 Geth ¦ MoarVM: This saves 237 million instructions in the Perl 6 read 100 lines
15:36 Geth ¦ MoarVM: benchmark, and arguably makes the code clearer, if a little longer,
15:36 Geth ¦ MoarVM: by handling the lack of lagging codepoint up front rather than mixed
15:36 Geth ¦ MoarVM: in with the rest of the decode logic. It also saves a branch on the
15:36 Geth ¦ MoarVM: hot path.
15:36 Geth ¦ MoarVM: review: https://github.com/MoarVM/MoarVM/commit/ea1f506170
15:48 timotimo ooooh
15:49 timotimo okay we have about ten thousand million instructions
15:49 timotimo so half a thousand isn't even bad at all
15:52 Geth ¦ MoarVM: b885d996d6 | (Jonathan Worthington)++ | src/strings/utf8.c
15:52 Geth ¦ MoarVM: Save a deref by introducing a local variable.
15:52 Geth ¦ MoarVM:
15:52 Geth ¦ MoarVM: The C compiler can't see (somewhat reasonably so) that it can avoid
15:52 Geth ¦ MoarVM: the dereference every time. Saves 57 million instructions from the
15:52 Geth ¦ MoarVM: benchmark, so effectively one instruction per decoded char.
15:52 Geth ¦ MoarVM: review: https://github.com/MoarVM/MoarVM/commit/b885d996d6
15:52 eveo Soon enough we'll start reading lines in negative time, at this rate :)
15:53 eveo hmmm
15:55 jnthn We're really edging in on the Perl 5 time by now. Like, our lowest outlier and it's highest outlier are now equal.
15:55 jnthn On average we're still a tad above
16:08 Geth ¦ MoarVM: 369c0c5ca6 | (Jonathan Worthington)++ | src/strings/utf8.c
16:08 Geth ¦ MoarVM: Only update last accepted position when needed.
16:08 Geth ¦ MoarVM:
16:08 Geth ¦ MoarVM: Saves a bunch of writes during the UTF-8 hot loop. Saves another 180
16:08 Geth ¦ MoarVM: million instructions, or 2 per character decoded in the fast path.
16:08 Geth ¦ MoarVM: review: https://github.com/MoarVM/MoarVM/commit/369c0c5ca6
16:11 eveo That's great. Overtaking perl5 in perf for some common operation would make some noise
16:11 eveo jnthn++
16:12 timotimo we'll be able to read lines as fast as perl5, but not do stuff with 'em as fast for the most part
16:13 timotimo i mean, some things we'll be able to do faster i expect
16:13 jnthn We're at 41 instructions per char we decode and normalize and stopper-filter by this point.
16:14 jnthn Well, amortizing in the fixed overhead and so on
16:14 jnthn And assuming we can take the fast path :)
16:14 timotimo right. it's probably a whole lot more when our file's only got 100 lines
16:14 timotimo not complainin' ;)
16:15 jnthn No, I'm just talking about instructions actually spent in the MVM_string_utf8_decodestream function :)
16:15 timotimo oh!
16:15 timotimo okay, that's nicer than i thought
16:15 timotimo cool beans
16:23 jnthn Anyways, I think I'll call it a day working on speedups for this :)
16:23 jnthn More next week, I guess :)
16:24 jnthn Though we're getting to the point where spesh will need some deeper attention to be able to make a better job of the loop itself
16:25 jnthn Also worth noting that if you take off the UTF-8 decoding, Perl 5 still beats us handily
16:25 eveo Cool. I'll bump versions and start pre-release stresstesting then after I hunt down that windows bug
16:26 nwc10 jnthn++
16:27 jnthn eveo: About the proc stuff - this month's MoarVM release did not actually drop support for the old synchronous proc ops
16:28 jnthn eveo: So if you feel that you'd prefer the Proc issues from before over the Proc issues now, a revert is possible
16:29 eveo Noted. So far I prefer Proc issues now :)
16:29 jnthn Yeah, the deadlocks from before were pretty icky
16:30 jnthn I'll address the fd plumbing thing that was reported on RT, probably next week or so
16:30 jnthn Wasn't keen to try and rush in a fix beforehand as it'd end up, well, rushed
16:33 * jnthn heads home; bbl
17:02 buggable joined #moarvm
17:29 robertle joined #moarvm
17:46 Geth joined #moarvm
18:11 robertle joined #moarvm
19:29 Geth joined #moarvm
19:38 Geth joined #moarvm
19:44 AlexDaniel joined #moarvm
19:46 colomon joined #moarvm
19:48 Geth joined #moarvm
19:51 ZofBot joined #moarvm
21:14 japhb jnthn++  # So many plusses for so many major perf improvements!
21:15 jnthn :)
21:15 jnthn Hoping to keep them coming :)
21:16 japhb Ditto that.
21:21 jnthn Fingers crossed http://news.perlfoundation.org/2017/06/grant-extension-request-perl-6.html goes through
21:22 timotimo why did i just see this for the first time today?
21:22 jnthn I dunno, I've linked it at least once before :)
21:24 * timotimo posted a comment
21:25 jnthn Thanks...I figure the more of those the merrier
21:33 ilmari[m] joined #moarvm
21:33 * lizmat refrains from commenting, but will vote  :-)
21:36 jnthn I hope I'll like the results more than in the last couple of votes I've participated in :P
21:40 eveo m: my @a = 1..3; my @b = 4..5; my %h = :42a, :70b; my @d; @d.append: %h; dd @d
21:40 camelia rakudo-moar 6e2e4f: OUTPUT: «Array @d = [:a(42), :b(70)]␤»
21:40 eveo m: my @a = 1..3; my @b = 4..5; my %h = :42a, :70b; my @d; @d.append: @b; dd @d
21:40 camelia rakudo-moar 6e2e4f: OUTPUT: «Array @d = [4, 5]␤»
21:41 eveo Well, I'm kinda leaning towards calling it a bug that .append doesn't just use normal .flat semantics
21:41 eveo m: my @d; my @b = (1, 2, 3), (4, 5, 6); @d.append: @b; dd @d
21:41 camelia rakudo-moar 6e2e4f: OUTPUT: «Array @d = [(1, 2, 3), (4, 5, 6)]␤»
21:41 eveo But probably a ton of stuff now depends on that :(
21:42 eveo m: my @d; my @b = (1, 2, 3), (4, 5, 6); @d.append: @b».List; dd @d # this I mean. I'd expect this to just get flattened
21:42 camelia rakudo-moar 6e2e4f: OUTPUT: «Array @d = [(1, 2, 3), (4, 5, 6)]␤»
21:42 eveo Ooops. Wrong channel
23:21 leedo_ joined #moarvm
23:21 mst_ joined #moarvm
23:28 jnthn joined #moarvm

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