Geth | rakudo: AlexDaniel++ created pull request #1032: Add ≤ ≥ ≠ unicode ops |
01:54 | |
roast/≤≥≠: 91a781f207 | (Aleks-Daniel Jakimenko-Aleksejev)++ | S03-operators/misc.t Tests for ≤ ≥ ≠ unicode ops |
|||
roast: AlexDaniel++ created pull request #249: Tests for ≤ ≥ ≠ unicode ops |
01:55 | ||
naxieAlDle | IOninja: hm, Geth reports the name inconsistently ↑ | 01:56 | |
TimToady back home in his own bed | 06:45 | ||
unfortunately, furnace broke while we were away | 06:48 | ||
fortunately, we live in California :) | |||
lizmat | Files=1178, Tests=55979, 196 wallclock secs (11.70 usr 4.65 sys + 1169.29 cusr 111.25 csys = 1296.89 CPU) | 09:46 | |
[Tux] | This is Rakudo version 2017.02-167-ge114d5204 built on MoarVM version 2017.02-20-g773711e1 | 09:50 | |
csv-ip5xs 2.875 | |||
test 12.538 | |||
test-t 4.995 - 5.154 | |||
csv-parser 13.214 | |||
MasterDuke | IOninja: did you ever submit a PR for rt.perl.org/Ticket/Display.html?id=72820 ? | 13:46 | |
irclog.perlgeek.de/perl6/2016-07-06#i_12795893 suggests you did | 13:47 | ||
IOninja | Nope. The change interfered with interpolation of &foo(whatever) in strings | ||
MasterDuke | ok, mind if i mention so in the ticket (and link to here in the log)? | 13:50 | |
Geth | rakudo/nom: d04c47fd63 | (Elizabeth Mattijsen)++ | src/core/metaops.pm Make triangle reduce right op with 2+ params 1.5x as fast |
||
MasterDuke | so someone reading the ticket and log doesn't think it's already been fixed | 13:51 | |
lizmat | m: sub infix:<f>(\a,\b,\c) is assoc<right> { a~b~c }; say [\f] ^5 | 13:52 | |
camelia | (4 234 01234) | ||
lizmat | ZofBot: hi | ||
ZofBot_: hi | |||
IOninja | ? | ||
lizmat | there seem to be 2 ? | ||
IOninja | oh | ||
MasterDuke | m: my $a = class { has $.b }; say $a.new(b => 1).perl; | 14:22 | |
camelia | <anon|65402160>.new(b => 1) | ||
MasterDuke | would `class { has $.a }.new(a => 1)` be a better output in that ^^^ case? | 14:24 | |
* s/a/b/g | |||
moritz | better, yes | ||
but certainly not perfect, because it might reference outer lexical symbols | 14:25 | ||
MasterDuke | well, that's true for any .perl, right? | ||
moritz | m: my $x = do { class A { has $.x }; class :: is B { has $.y }.new(x => 1, y => 2) }; say $x.perl | ||
camelia | 5===SORRY!5=== Error while compiling <tmp> '<anon|49526768>' cannot inherit from 'B' because it is unknown. at <tmp>:1 |
||
moritz | m: my $x = do { class A { has $.x }; class :: is A { has $.y }.new(x => 1, y => 2) }; say $x.perl | 14:26 | |
camelia | <anon|69579408>.new(y => 2, x => 1) | ||
MasterDuke | m: my $a = class A { has $.b }; say $a.new(b => 1).perl; | ||
camelia | A.new(b => 1) | ||
MasterDuke | i was just comparing it to ^^^ | ||
moritz | yes | ||
and you're right, .perl typically reference a symbol which must be in scope to work | |||
MasterDuke | and fyi, i'm asking for rt.perl.org/Ticket/Display.html?id=77026 | 14:27 | |
nine | Given module A which requires module B. Should after "require A;" B be available through indirect lookup? | 14:28 | |
IOninja | m: my $x = class {}; my @a = $x, $x; @a.perl.say | ||
camelia | [<anon|50504976>, <anon|50504976>] | ||
IOninja | MasterDuke: ^ in your version, those two will be different classes too | ||
MasterDuke | ah. could do something like `class <anon|50504976> { has $.a }.new(a => 1)`? | 14:31 | |
IOninja | Don't really know how you're going to retrieve the guts either. | ||
If you're just sticking public attributes into a `class {}`, it's really just as useless as <anon|432423432> thing we currently have | 14:32 | ||
MasterDuke | can always reject the ticket | ||
anybody have an idea for what a better .perl would look like? fwiw, i'll at least link to this discussion in the ticket | 14:41 | ||
Geth | rakudo/nom: 9cec31afee | (Elizabeth Mattijsen)++ | src/core/metaops.pm Make reduce chain op about 5% faster Typical use case: 'say "numericall sorted" if [<] @a' |
15:22 | |
IOninja | nqp::chars got some sort of magic for strings fewer than 15 chars? | 15:45 | |
lizmat | IOninja: not that I know, but that's generally out of my view :-) | 15:49 | |
timotimo | that sounds unlikely. what symptoms are you experiencing? | 16:03 | |
IOninja | Got a 60% perf improvement by avoiding using nqp::chars, but it kicks in only for strings with 15+ chars. I'm thinking maybe those strings can fit into a CPU register and that's why? | 16:04 | |
I tested with using 'a' as the char FWIW | 16:05 | ||
timotimo | how do you create the longer strings? | ||
IOninja | oh.... 'a' x 15 | ||
timotimo | haha | ||
IOninja | :) | 16:06 | |
How to make it use proper string instead of the rope stuff? | |||
timotimo | you can use nqp::indexingoptimized to create a proper string from a rope | ||
(be sure to use the return value) | |||
m: "a" x 1000000000 | |||
camelia | WARNINGS for <tmp>: Useless use of "x" in expression "\"a\" x 1000000000" in sink context (line 1) |
||
timotimo | m: use nqp; nqp::indexingoptimized("a" x 1000000000) | ||
camelia | MoarVM panic: Memory allocation failed; could not allocate 4000000000 bytes | ||
IOninja | m: use nqp; say nqp::indexingoptimized("a" x 10) | 16:07 | |
camelia | aaaaaaaaaa | ||
IOninja | m: use nqp; my @s = 'a' x 10; @s .= map: {nqp::indexingoptimized($_)}; say @s | ||
camelia | [aaaaaaaaaa] | ||
IOninja | same thing | 16:08 | |
timotimo | what do you mean? | ||
IOninja | I got a smaller boost: 50% instead of 65% now, but it's still kicks in only for strings 15+ chars | 16:09 | |
ZOFVM: Files=1227, Tests=132953, 122 wallclock secs (21.86 usr 3.24 sys + 2412.20 cusr 247.86 csys = 2685.16 CPU) | |||
timotimo | interesting | ||
but "a cpu register" isn't going to have much to do with it | 16:10 | ||
IOninja | hm | ||
timotimo | cache lines, however. there's something that could help you | ||
but L1 cache ought to be big enough for 15+ chars? maybe? | |||
Geth | rakudo/nom: 22f43d20ef | (Zoffix Znet)++ | src/core/Str.pm Make Str.Bool 30%–65% faster for strings 15+ chars long Boost sunk results by ~65% and unsunk results by ~30% Improvement is 5-10 percentage points smaller for strings with flattened ropes (as opposed to one roped char). Makes Tux's bench ~5% faster. Unsure why no improvement is seen for strings smaller than 15 chars: irclog.perlgeek.de/perl6-dev/2017-...i_14208922 |
16:13 | |
IOninja | This is my benching script FWIW: gist.github.com/zoffixznet/1b1d001...03c1357c48 | 16:15 | |
and here's the result of the run: gist.github.com/zoffixznet/e60c029...b99ef0ec90 | |||
Before 15chars results flop around zero, but 15+ steadily in 30-65 percent | 16:16 | ||
timotimo | impressive difference | ||
huh | 16:17 | ||
how can the difference between 100, 1000, 100000 1000000 and 10000000 be so insignificant? | |||
i.e. why does the time hardly increase? | 16:18 | ||
also, what happens if you randomize the order of the tests? | |||
IOninja | m: say [<a b c d e f>].shuffle | 16:19 | |
camelia | No such method 'shuffle' for invocant of type 'Array' in block <unit> at <tmp> line 1 |
||
IOninja | ...thought we did have it :/ | ||
timotimo | nope, it's .pick(*) | ||
IOninja | Thanks. | ||
timotimo | m: .chars.say for '.pick(*)', '.shuffle()' | ||
camelia | 8 10 |
||
timotimo | look it's even shorter | ||
m: .chars.say for '.pick(*)', '.shuffle' | |||
camelia | 8 8 |
||
timotimo | or the same length if you drop the parens | 16:20 | |
IOninja | rendomization don't do anything: gist.github.com/zoffixznet/cb4b6db...5f2ba01617 | 16:22 | |
timotimo | that's fucking weird yo. | 16:23 | |
i'll look at it in more detail with a profiler or something, but for now i've gotta AFK | |||
Geth | rakudo/nom: bdd472bd8d | (Zoffix Znet)++ | src/core/IO/Spec/Unix.pm Remove Perl-5-isms in string comparisons The Str.Bool is also ~2x faster than doing Str.defined && Str.chars |
16:31 | |
timotimo | maybe that code was from back when "0" would boolify to false | 16:32 | |
IOninja | Ah, right. | 16:34 | |
That was changed pretty close to Christmas, I recall | |||
timotimo | i think it was changed much earlier than that | ||
IOninja | Hm | ||
Well, I was already around when it changed :) | 16:35 | ||
c: all say "0".Bool | |||
committable6 | IOninja, gist.github.com/36dee8c548522b0275...3643c5f7c1 | ||
timotimo | um | ||
wordpress are you okay | |||
IOninja | 2015.04 | ||
timotimo | it's doing a roulette right now | ||
RIP my ram | 16:36 | ||
i wanted to type "string bool" into the search field | 16:37 | ||
and it started putting four different values into the search field over and over and over and over and over | |||
also, it became slower the more often it did that | |||
"putting in" as in "replaced the content with" | 16:38 | ||
and it also updated the URL to go along with the search term | |||
but what the flying fuck was that all about | |||
how did it end up in an infinite loop like that? | |||
IOninja | You owe a dollar into the swear jar. | 16:39 | |
timotimo | ho-hum. | 16:42 | |
Geth | rakudo/lexical_require: 175151e0a8 | (Stefan Seifert)++ | src/Perl6/Actions.nqp Create lexical stub package for nested required module. require Foo::Bar; will now create a lexically scoped package "Foo" containing the nested stub package "Bar" to be replaced by the loaded module's package at runtime. With this, "require Foo::Bar; Foo::Bar::baz();" works again. |
16:46 | |
MasterDuke | IOninja: do you see numbers with unicode chars in the strings? | 17:56 | |
timotimo: 15 is just one off of 16. are small strings stored differently? inlined directly into a data structure? | 17:58 | ||
Geth | roast/≤≥≠: ce5e3baab5 | (Aleks-Daniel Jakimenko-Aleksejev)++ | S03-operators/misc.t Tests for ≤ ≥ ≠ unicode ops |
18:05 | |
roast/≤≥≠: 2b19c48da3 | (Aleks-Daniel Jakimenko-Aleksejev)++ | S03-operators/misc.t Tests for ≤ ≥ ≠ unicode ops |
18:08 | ||
timotimo | no, we don't have that kind of optimization yet | 18:18 | |
i wanted to build something like that for something in the past. it didn't work out well yet, but i forgot which datastructure it was for | 18:19 | ||
MasterDuke | thought i remembered you working on something, wasn't sure exactly what for or if it was merged | 18:21 | |
IOninja: * different numbers | |||
lizmat | hmmm... looks like IO::Socket::INET.get could use a lot of love | 18:22 | |
feels to me the first 3 lines should only be done once for each socket, instead of for every get | 18:23 | ||
IOninja | m: .bytes.say for 'a', '♥' | 18:25 | |
camelia | No such method 'bytes' for invocant of type 'Str' Did you mean '.encode($encoding).bytes'? in block <unit> at <tmp> line 1 |
||
IOninja | m: .encode./bytes.say for 'a', '♥' | ||
camelia | 5===SORRY!5=== Error while compiling <tmp> Malformed postfix call at <tmp>:1 ------> 3.encode.7⏏5/bytes.say for 'a', '♥' |
||
IOninja | m: .encode.bytes.say for 'a', '♥' | ||
camelia | 1 3 |
||
IOninja | MasterDuke: same numbers with ♥ | ||
m: .ords.say for 'a', '♥' | 18:26 | ||
camelia | (97) (9829) |
||
MasterDuke | oh well, would have been interesting if the inflection point had been at less than 15 chars then | 18:27 | |
Geth | roast/≤≥≠: b15122f1df | (Aleks-Daniel Jakimenko-Aleksejev)++ | S03-operators/misc.t Tests for ≤ ≥ ≠ unicode ops |
18:39 | |
rakudo/nom: d2c5684e50 | (Aleks-Daniel Jakimenko-Aleksejev)++ | 2 files Add ≤ ≥ ≠ unicode ops 🙌 Tiny IRC discussion: irclog.perlgeek.de/perl6/2017-03-01#i_14183585 ⩵ (and especially ⩶) were left out intentionally. For now, let's focus on operators that were actually requested many times. |
18:50 | ||
rakudo/nom: 5c68ea6828 | (Zoffix Znet)++ | 2 files Merge pull request #1032 from AlexDaniel/≤≥≠ Add ≤ ≥ ≠ unicode ops |
|||
roast: c4ff5ce7d4 | (Aleks-Daniel Jakimenko-Aleksejev)++ | S03-operators/misc.t Tests for ≤ ≥ ≠ unicode ops (#249) |
|||
nine | lizmat: I concur | 18:58 | |
Geth | rakudo/nom: e2c62cfaf4 | (Elizabeth Mattijsen)++ | 10 files Change use of nqp::chars as bool to nqp::isne_s This turned out to be a lot cheaper. |
18:59 | |
rakudo/nom: 4bc826da3d | (Elizabeth Mattijsen)++ | src/core/IO/Handle.pm Streamline IO::Handle.get And also fix a few cases where nqp::chars were used as a boolean. |
|||
lizmat wonders what this all will bring for test-t | |||
IOninja | hmm | 19:07 | |
m: say 5.780667/5.710333 | |||
camelia | 1.01231697 | ||
lizmat | IOninja: is that good or bad ? | ||
IOninja | That's commit right before Str.Bool and second is HEAD. | 19:08 | |
lizmat | so a small improvement | ||
IOninja | lizmat: when I measured against Str.Bool commit alone, it was 5% improvement. So if we assume there's no noise, the latest commits brought a 4% loss. Lemme build a few prior commits | ||
the nqp::isne_s thing seems to be 0%-3% slower than nqp::chars for empty strings tho | 19:09 | ||
jnthn | I'm very confused by all of this, because nqp::chars is O(1) | 19:10 | |
lizmat | jnthn: but if a str is a rope, it would need to walk the rope, no? | ||
whereas nqp::iseq_s would stop immediately on the first different/missing char ? | |||
jnthn | lizmat: No, even if it's a ropey string we calculate the number of chars during the op | 19:11 | |
lizmat: Since it's always almost free anyway | |||
IOninja | jnthn: that's really weird, considering nqp::iseq_s('', $str) stars to be faster than nqp::chars() for 15+_char strings: gist.github.com/zoffixznet/e60c029...b99ef0ec90 | ||
jnthn | Like in a concat it's just an addition | ||
lizmat | .oO( only 10 more tests for 56K :-) |
19:12 | |
IOninja | m: say 2.93532595188/1.80599481741 | ||
camelia | 1.62532357434 | ||
IOninja | That's the diff for timings between 10000000-char string and 0-char string | ||
jnthn | IOninja: What's the test code? | ||
IOninja | jnthn: gist.github.com/zoffixznet/1b1d001...03c1357c48 | 19:13 | |
timotimo | oh, wait | 19:14 | |
we do actually store the size of a string in the string's header | 19:15 | ||
why didn't i realize that obvious fact | |||
we don't have to strlen at all | |||
IOninja | m: say 5.8725/5.7745 | 19:16 | |
camelia | 1.016971 | ||
lizmat | IOninja: and that is ? | ||
IOninja | that was 5c68ea6828e131e1e2365d3a6d05ca4d2b55d184 | ||
IOninja builds Str.Bool one now... | |||
robertle | 1 | ||
IOninja | The numbers are pretty noisy tho. | ||
5.707, 5.703, 5.888, 5.800 <-- all the same commit | 19:17 | ||
lizmat: errr wait | |||
lizmat: that's that commit, but it's 1% SLOWER than before the Str.Bool (if we assume no noise issues) | 19:18 | ||
lizmat | ok, I will revert | ||
IOninja | So 5.8725 is the average of 4 runs on 5c68ea6828e1 | ||
lizmat: no wait | |||
lizmat waits | |||
:-) | |||
IOninja | m: say 5.934/5.82625 | 19:23 | |
camelia | 1.018494 | ||
IOninja | So on Str.Bool commit, it now shows I made test.t 1% slower... I want to saw there's just too much variance to get a reliable result, but I don't know if that's just 'cause I want to believe my Str.Bool improvement affected it more than it really did | ||
It was a 5% improvement when I ran the benching (3 runs each) before committing :/ | 19:24 | ||
IOninja builds HEAD again | |||
s/saw/say/ | |||
jnthn | fwiw, here is the MVM_string_euqal impl: github.com/MoarVM/MoarVM/blob/mast...ops.c#L634 | 19:25 | |
You'll line 5 | |||
*notice | |||
Which actually is first checking if the strings have different length | |||
Which is the very same thing that nqp::chars calls | |||
So I'm very confused about the results :) | 19:26 | ||
lizmat | jnthn, yeah, ok, so reverting :-) | ||
jnthn | There's lies, darned lies, and benchmarks... :-) | 19:27 | |
IOninja | :) | ||
lizmat: would you revert mine too then? The Str.Bool one | 19:28 | ||
lizmat | IOninja: will do | ||
lizmat spectest to be sure she didn't revert too much | 19:33 | ||
Geth | rakudo/nom: f11752cc76 | (Elizabeth Mattijsen)++ | 11 files Revert all of the nqp::chars -> nqp::isne_s stuff There does not appear to be a reason why this would make a positive difference. And there is some evidence it actually caused a negative difference. This reverts: 4bc826da3d8ab3 e2c62cfaf451ef9b 22f43d20ef038ea7a23 |
19:45 | |
rakudo/nom: 9019a5b8ba | (Elizabeth Mattijsen)++ | src/core/IO/Handle.pm Streamline IO::Handle.get/getc Making IO::Handle.lines about 10% faster, and IO::Handle.getc about 3% faster. |
20:19 |