SmokeMachine | does multi dispatch have performance problem? | 03:00 | |
I am trying to fix the hash multidimensional slice, and im abusing of it... | 03:01 | ||
and almost not using nqp... :( | |||
samcv | SmokeMachine, shouldn't have any performance change if it can determine the type on compiling. but if it's dynamic there can be some impact yes | 03:04 | |
SmokeMachine | samcv: thanks! | 03:05 | |
samcv | also depends how many you have. removing some can make a fair impact or restructuring so that you turn two multi's into one that has an if condition can also be more performant | 03:06 | |
usually that is not needed but in some cases that may be good to try if you think that may be causing an issue | |||
SmokeMachine | I was abusing of it... Ill change it... (I was testing outside of the code... I added it to the right file and didn't work... :( ) | 03:08 | |
samcv: that is what I was trying: www.irccloud.com/pastebin/fYK6sZos/ | 03:10 | ||
samcv | what error do you get SmokeMachine | 03:12 | |
it runs for me. but i'm not sure what the output should be or not | 03:13 | ||
SmokeMachine | compile error... P6opaque: must compose before allocating | ||
samcv | compiles for me | 03:14 | |
SmokeMachine | samcv: it gives me error when I port it to src/core/hash_slice.pm | ||
samcv | can you paste the full text of the error? | ||
everything | 03:15 | ||
SmokeMachine | sure, 1 sec | ||
The last version was returning Seq... this returns List (as expected) www.irccloud.com/pastebin/CGDZ7gJw/ | 03:16 | ||
samcv: the error: www.irccloud.com/pastebin/54Bx42Sp/ | 03:17 | ||
samcv | SmokeMachine, show me a diff of your changes | 03:19 | |
SmokeMachine | samcv: the diff www.irccloud.com/pastebin/Ntrrr2GH/ | 03:20 | |
samcv | SmokeMachine, i'm guessing something is not containerizing somewhere. or something | 03:33 | |
try commenting multi's out and see when it starts compiling again | 03:34 | ||
SmokeMachine | samcv: when I comment everything but the"multi recurse-at-key(\SELF, \indices, 0)" it gives error yes... | 03:35 | |
samcv: I think the problem is the WhateverStar! | 03:37 | ||
samcv: I changed to a block and compiled! Ill uncomment everything and test again! | 03:38 | ||
:( | |||
another *... | 03:39 | ||
compiled! | 03:40 | ||
worked! :) | 03:41 | ||
the spec tests passed... | 03:49 | ||
samcv | good :) SmokeMachine | 03:58 | |
yeah commenting things out until it compiles can be helpful because the messages it gives compiling rakudo are not the best | |||
SmokeMachine | samcv: github.com/FCO/rakudo/commit/39ef4...1da63c512a | 03:59 | |
samcv: yes, it helps... | |||
samcv: thanks for the help! | 04:00 | ||
samcv | also yo should make sure to use `multi sub` for the postcircumfix | ||
you don't have to for the subs inside the operator routine but you should call all multi's `multi sub` | 04:01 | ||
SmokeMachine | samcv: it is... wasnt on my test to be sure that would use the one i was testing... | ||
samcv | how is speed of the new function compared to the new one? | ||
SmokeMachine | ah! ok! | ||
samcv | kk np | ||
SmokeMachine | samcv: the old one wasnt working for cases as %hash{1,1; 2} | 04:02 | |
samcv | not at all? or was it returning the wrong type of object? | ||
SmokeMachine | it should return (True, True) and was returning False | 04:03 | |
samcv | that is no good | 04:05 | |
good work though | 04:06 | ||
SmokeMachine | but the fix is much slower... :( | 04:08 | |
samcv | how much slower? 2x slower? | 04:09 | |
SmokeMachine | much more... | 04:10 | |
samcv | okay. then take out this multi multi recurse-at-key(\SELF, [$idx, +@indices where { .elems > 0 }]) { | ||
and turn it into an if else statement | |||
SmokeMachine | samcv: www.irccloud.com/pastebin/T4piLZQX/ | 04:11 | |
samcv | SmokeMachine, i would take out the inside multi's and write it into if else statements | 04:12 | |
SmokeMachine | samcv: yes, Ill do that... | ||
samcv: but ill do that tomorrow... | |||
samcv | kk. sounds good | ||
SmokeMachine | samcv: thanks for your help! | 04:13 | |
samcv | anytime | ||
SmokeMachine | have a good * | ||
samcv | good * :) | ||
lizmat | Files=1181, Tests=55992, 197 wallclock secs (11.76 usr 4.57 sys + 1170.16 cusr 112.54 csys = 1299.03 CPU) | 07:22 | |
Zoffix | I had RAKUDO_MAX_THREADS=100 on my VM | 10:33 | |
Zoffix tries a normal-sized run | |||
timotimo | i wonder if we already have the debugname set before that "need to compose before allocating" message happens. i'm expecting the debugname is set when we compose, though. | 10:46 | |
Zoffix | ZOFVM: Files=1230, Tests=132967, 117 wallclock secs (22.42 usr 3.06 sys + 2441.50 cusr 122.97 csys = 2589.95 CPU) | 10:47 | |
that's a 5harness stresstest | |||
Zoffix waits for 6 | |||
Unhandled exception in code scheduled on thread 7 | 10:48 | ||
Cannot look up attributes in a TAP::Reporter::Console::Session type object | |||
in method summary at /home/cpan/CPANPRC/rakudo/lib/TAP.pm6 (TAP) line 508 | |||
lizmat | ouch. been a while since I saw that one | ||
timotimo | wow, that's amazing | 10:50 | |
Zoffix | why? | 10:51 | |
timotimo | others have been trying to reproduce that error for multiple days | ||
Zoffix | ah | ||
timotimo | or am i thinking of something else? | ||
cool, the debugname is set in new_type, which is separate from compose | 10:53 | ||
so the error message about "compose before allocate" could get the debug name printed out, too | |||
timotimo hacks | |||
Zoffix | ZOF6VM: Files=1216, Tests=132907, 241 wallclock secs | 10:54 | |
samcv: ^ you wanted to see the difference between 5 and 6 harnesses. Notice how along with being twice as slow, the 6 harness reports 60 fewer tests were run | |||
And 4 fewer files :S | 10:55 | ||
m: say 1230/30 | |||
camelia | 41 | ||
Zoffix | Maybe this line *is* buggy: github.com/rakudo/rakudo/blob/nom/...rness6#L60 | 10:57 | |
m: dd <a> Z <a b> | |||
camelia | (("a", "a"),).Seq | ||
Zoffix | dunno if it'd always have the right size there or not. | ||
timotimo | i can imagine it'd fail when @tfiles / @slow isn't a whole number? | 11:01 | |
would probably be easy to check, no? | 11:03 | ||
fantastic | 11:10 | ||
the code SmokeMachine wrote gave "P6opaque: must compose before allocating" | |||
with my diff it also mentions that it's about WhateverCode | |||
MasterDuke | nice | 11:13 | |
timotimo | pushed | 11:15 | |
dogbert17_ | anyone want ta continue the talk about the test harnesses? | 12:23 | |
the 'spectest.data' file contains 1253 rows. if I run a spectest which of these should be igonered? Only the ones marked 'stress? | 12:25 | ||
if we ignore headers an S01 tests the number of files is 1253 - 36 = 1217 | 12:27 | ||
ok, so I have found the 8 files which differ in a spectest between harness5 (1168 files testes) and harness6 (1160 files tested) | 12:43 | ||
MasterDuke | always the same files? | ||
Zoffix | :S | 12:44 | |
My stresstest run only had 4 missing files | |||
dogbert17_ | these differ for me | ||
t/spec/integration/role-composition-vs-attribute.rakudo.moar, t/spec/integration/rule-in-class-Str.t | |||
t/spec/integration/say-crash.t, t/spec/integration/substr-after-match-in-gather-in-for.t | |||
t/spec/integration/topic_in_double_loop.t, t/spec/integration/variables-in-do.t | |||
t/spec/rosettacode/greatest_element_of_a_list.t, t/spec/rosettacode/sierpinski_triangle.t | |||
Zoffix | "differ"? Differ how? | 12:46 | |
dogbert17_ | they are not run by harness6 when doing a spectest | 12:47 | |
I took the output from runs by harness5 and harness6, sorted it and ran diff | 12:48 | ||
Zoffix | does harness 6 run the file when you individually run it? HARNESS_TYPE=6 make t/spec/rosettacode/greatest_element_of_a_list.t | 12:50 | |
dogbert17_ | yes | ||
Zoffix | Then the bug is likely in t/harness6 | 12:51 | |
The part I linked to earlier is especially suspect | |||
dogbert17_ | your cmdline didn't work properly, see below | ||
dogbert@dogbert-VirtualBox ~/repos/rakudo $ HARNESS_TYPE=6 make t/spec/rosettacode/greatest_element_of_a_list.t | 12:52 | ||
/usr/bin/perl t/harness5 --fudge --moar --keep-exit-code --verbosity=1 t/spec/rosettacode/greatest_element_of_a_list.t | |||
it used harness5 instead | |||
I believe the makefile is hardcoded to use harness5 when you want to test a single file | 12:53 | ||
Zoffix | oh, well, try using harness 6 | ||
`make -n spectest` to get the command and then change the files to just 1 file | 12:54 | ||
dogbert17_ | then it runs the file, btw I used './perl6-m -Ilib t/harness6 --fudge --tests-from-file=t/spectest.data2' spectest.data2 contains the test file in question | 12:57 | |
dogbert17_ tests a vague theory, i.e. does the number of tested files change if the TEST_JOBS param is changed | 13:00 | ||
Geth | rakudo/nom: 4227b3824d | (Zoffix Znet)++ | docs/2017-IO-Grant--Action-Plan.md Log changes to IO Plan at the top Remove `other issues` from bottom and log changes due to discussions at the top so those who reviewed the plan already can easily see the new changes. |
||
MasterDuke | here's where it's hardcoded to HARNESS5 when making a single file: github.com/rakudo/rakudo/blob/nom/...re.pl#L324 | 13:01 | |
Zoffix | dogbert17_: just see if @tfiles here matches @files: github.com/rakudo/rakudo/blob/nom/...rness6#L60 | 13:02 | |
well, the number of them | |||
dogbert17_ | ok, will check | 13:04 | |
well, @tfiles is 1160 | 13:06 | ||
Zoffix | and @files? | ||
āāāšāāāš āāāšāāāš āāāšāāāš āāāšāāāš āāāšāāāš āāāšāāā | |||
āāā | |||
āāā Reminder: the deadline to submit your suggestions and corrections to | |||
āāā IO Action Plan is in 3 days, on April 1st. You can find the Plan at | |||
āāā github.com/rakudo/rakudo/blob/nom/...on-Plan.md | |||
āāā | 13:07 | ||
āāāšāāāš āāāšāāāš āāāšāāāš āāāšāāāš āāāšāāāš āāāšāāā | |||
dogbert17_ | @files is 1139 ? | ||
Zoffix | āāā If you already did, you can see the 2 new modifications and 2 changes to old modifications that have been proposed in the first section of the file: github.com/rakudo/rakudo/blob/nom/...ction-plan | 13:08 | |
Geth | rakudo/nom: dc8124f1cd | (Zoffix Znet)++ | docs/2017-IO-Grant--Action-Plan.md List .extension(:parts) is proposed to take a Range - This was originally suggested as possible future expansion, but feels useful enough to include right now. |
13:10 | |
dogbert17_ | Zoffix: so why is tfiles 1160, shouldn't it be 1168? | 13:35 | |
interesting, if I omit the TEST_JOBS directive @tfiles suddenly becomes 1168 | 13:37 | ||
Zoffix | The then bug is where I pointed to, in the Z | 13:41 | |
because it doesn't get run when TEST_JOBS is 1 | |||
Use the debug prints, Luke! | |||
dogbert17_ | that's so old school :) | 13:42 | |
brrt | and super effective | 13:46 | |
dogbert17_ | if TEST_JOBS > 1 then @slow.elems = 29 and @files.elems = 1139 while @tfiles.elems ends up being 1160 (that's eight short) | 13:48 | |
Zoffix | m: say 29+1139 | 13:51 | |
camelia | 1168 | ||
Zoffix | m: say 1139/29 | ||
camelia | 39.275862 | ||
Zoffix | m: say 1139 div 29 | ||
camelia | 39 | ||
Zoffix | m: say 39 29 | ||
camelia | 5===SORRY!5=== Error while compiling <tmp> Two terms in a row at <tmp>:1 ------> 3say 397ā5 29 expecting any of: infix infix stopper postfix statement end statement modifier ā¦ |
||
Zoffix | m: say 39 * 29 | ||
camelia | 1131 | ||
Zoffix | m: say (39 * 29) + 29 | ||
camelia | 1160 | ||
Zoffix | Yup. Z is the cause | ||
Zoffix is pleased to have had guessed this to be the problem area a few weeks ago :) | 13:52 | ||
dogbert17_ | .oO (the Z(offix) operator) | ||
Zoffix++, now all we need is to figure out a fix | |||
Zoffix | Godspeed | ||
dogbert17_ will look when he manages to get home from $work | 13:55 | ||
Zoffix | m: dd <a> Z <b c> | 13:57 | |
camelia | (("a", "b"),).Seq | ||
Zoffix | m: dd roundrobin <a>, <b c> | ||
camelia | (("a", "b"), ("c",)).Seq | ||
Zoffix | dogbert17_: ^ a hint :) | ||
"c" is the missing files. | |||
dogbert17_ | Zoffix: interesting :) | 13:59 | |
[Coke] | m: say "\c[IDEOGRAPHIC TELEGRAPH SYMBOL FOR JANUARY]" | 14:01 | |
camelia | ć | ||
Zoffix | m: gist.github.com/zoffixznet/a79f282...5a7897124d | 14:30 | |
camelia | Wide (Wide) No such method 'is-prime' for invocant of type 'Wide' in sub foo at <tmp> line 8 in sub foo at <tmp> line 7 in block <unit> at <tmp> line 11 |
||
Zoffix | Why is it even trying to call `.is-prime` on Wide? I gave it 41 to `nextwith`... | ||
m: multi foo (Str) { nextwith 13 }; multi foo (Any $ where .is-prime) {say "ohai"}; foo "x" | 14:32 | ||
camelia | No such method 'is-prime' for invocant of type 'Str' in sub foo at <tmp> line 1 in sub foo at <tmp> line 1 in block <unit> at <tmp> line 1 |
||
Zoffix | Bug? | 14:33 | |
m: multi foo (Str) { nextwith 13 }; multi foo (Any $x where {dd $_; True}) {dd [ $x, $x.^name ]; say "ohai"}; foo "x" | 14:34 | ||
camelia | Str $topic = "x" Int $topic = 13 [13, "Int"] ohai |
||
Zoffix | Looks like the arg the `where` is trying is pre-loaded when dispatched is figured out, but when it actually runs the value is different :o | 14:35 | |
s/it actually runs/candidate actually runs/; | |||
Oh, I just misread >_< | 14:38 | ||
Zoffix needs moar coffee | |||
SmokeMachine | samcv: my last try yesterday on this computer that Im using now took 0.3894857, the original 0.02741633. removing all the multis and fancy sub signatures its taking 0.1327739 | 14:49 | |
samcv: this is my test, if you are interested... :) www.irccloud.com/pastebin/aPL55Xzq/ | 14:52 | ||
Zoffix | Interesting. I initially assumed ALL candidates are sorted from narrowest to widest and THEN they're tried in order until first match is found. But my experemintation shows first ALL candidates are tried to see if they match and then they're sorted.... Kinda makes me wonder, wouldn't the first version be way more performant, since you only try enough candidates to find a match and not all? | 14:53 | |
Zoffix is probably talking shit, but I can see the readers of my article wondering the same | |||
Oh nevermind. My experiment was wrong. | 14:56 | ||
or is it... | 14:57 | ||
m: multi foo (IntStr) { say "IntStr"; }; multi foo (Any $ where { say "Tried to match against $_"; .is-prime}) { say "Any" }; foo <43>; | |||
camelia | IntStr | ||
Zoffix | So it didn't try the Any... cool | ||
m: multi foo (IntStr) { say "IntStr"; nextwith 13 }; multi foo (Any $ where { say "Tried to match against $_"; .is-prime}) { say "Any" }; foo <43>; | |||
camelia | IntStr Tried to match against 43 Tried to match against 13 Any |
||
Zoffix | But now it did... twice | 14:58 | |
dogbert17_ | - @tfiles = (@slow Z batch(@tfiles / @slow, @tfiles)).flatmap({ .map(|*) }) | ||
+ @tfiles = (roundrobin @slow, batch(@tfiles / @slow, @tfiles)).flatmap({ .map(|*) }) | |||
Zoffix ^^ | |||
Zoffix | Is that .flatmap({ .map(|*) }) really needed? What about just .flat | ||
dogbert17_ | seems to work with .flat | 15:00 | |
Zoffix | OK. I think I get it: it sorts candidates from narrowest to widest, then goes to find the first matching candidate. If you use `nextwith` and ilk, it will continue trying to find the next matching candidate *using original value* and then when it finds it, it'll try to bind the new value that was given to `nextwith` which makes `where` blocks run twice | 15:01 | |
I don't really get why it doesn't just continue trying with new value alone.... | |||
dogbert17_: "seems" is not very scientific. You can `dd` the result and see that it flattened right | 15:02 | ||
dogbert17_ | that will be done before a PR is submitted, running a spectest right now in order to se if anything explodes | 15:04 | |
Zoffix | I really should read the historic docs of how our multi dispatch works. Even our docs just link to glossary instead of explanation :/ | 15:07 | |
dogbert17_ | Files=1168, Tests=55436, 411 wallclock secs | 15:09 | |
Zoffix | \o/ | ||
dogbert17_ | Files=1168, Tests=55436, 340 wallclock secs ( 6.60 usr 4.22 sys + 903.76 cusr 64.94 csys = 979.52 CPU) # harness5 | 15:10 | |
Zoffix | multi foo { samewith 'blah' }; is the same as multi foo { foo 'blah' } is it not? | 16:00 | |
ugexe | I think it depends on where the `proto` is? | 16:10 | |
Zoffix | Like how? The where the proto is affects `foo` same as `samewith`, I'd think, on? | 16:12 | |
*no? | |||
s: &samewith | 16:13 | ||
SourceBaby | Zoffix, Sauce is at github.com/rakudo/rakudo/blob/dc81...ol.pm#L136 | ||
Zoffix | looks like it just calls foo() to me... | 16:15 | |
ugexe | I guess my comment just affects dispatch in general, so just calling foo() is the same thing I suppose | 16:24 | |
could have swore i've gotten into spots where I was telling myself use `samewith(...)` and if it gets stuck in an infinite dispatch loop use `foo(...)` | 16:26 | ||
SmokeMachine | Any suggestion to make it faster? github.com/FCO/rakudo/commit/c5e8f...59aa3663fa | 17:03 | |
dogbert17 | Zoffix: can you make sense of RT #131073? | 17:06 | |
synopsebot6 | Link: rt.perl.org/rt3/Public/Bug/Display...?id=131073 | ||
Zoffix | dogbert17: yes, it said "It's a spam email, possibly containing an infected attachment" | 17:08 | |
dogbert17 | Zoffix: I see it was swiftly removed :) | 17:10 | |
Zoffix | m: multi foo(Int) { .say for (nextcallee() xx *)[^3]; }; multi foo(Cool) {}; multi foo(Any) {}; foo 42; | 17:14 | |
camelia | Nil Nil Nil |
||
Zoffix | m: multi foo(Int) { .say for eager (nextcallee() xx *)[^3]; }; multi foo(Cool) {}; multi foo(Any) {}; foo 42; | ||
camelia | Nil Nil Nil |
||
Zoffix | buggy xx still? | ||
[Coke] | note: clicking the big "S" is the "best" way to remove spam from the RT queue. (the one in the menu near actions) | ||
Zoffix | That's the one I used. | ||
[Coke] | I suspect it helps document what is spam versus what is a bad request. | ||
Zoffix | m: multi foo(Int) { nextcallee.say for ^3; }; multi foo(Cool) {}; multi foo(Any) {}; foo 42; | ||
camelia | sub foo (Cool $) { #`(Sub|52330576) ... } sub foo ($) { #`(Sub|52330728) ... } Nil |
||
[Coke] | Zoffix++ # I was expected to see it show up as red for me after that, which it didn't. | 17:15 | |
Zoffix | dammit... I really wanted to show off the coolness of xx :( | ||
[Coke] | *expecting | ||
Zoffix | m: .say for ("hi".say xx 3)[^3] | ||
camelia | hi hi hi True True True |
||
Zoffix | m: .say for ("hi".say xx *)[^3] | ||
camelia | hi hi hi True True True |
||
Zoffix | :S | ||
m: .say for (say("hi") xx *)[^3] | 17:16 | ||
camelia | hi hi hi True True True |
||
Zoffix | Oh gee, it thunks nextcallee and calls it elsewhere >_< | ||
fair 'nuf | |||
dd (nextcallee() for ^*)[^3]; has the same problem :/ | 17:20 | ||
Geth | rakudo: dogbert17++ created pull request #1050: Fix for RT #131075 |
17:21 | |
synopsebot6 | Link: rt.perl.org/rt3/Public/Bug/Display...?id=131075 | ||
Geth | rakudo/nom: 876637010e | (Jan-Olof Hendig)++ | t/harness6 Fix for RT #131075 It was noted by Zoffix++ that the number of tests run by harness6 differed from the number run by harness5 when spec- or stresstesting. The problem turned out to be the piece of code combining the normal test files in spectest.data with the ones marked as being 'slow'. That code used the Z operator on lists that were not the same size, changing to roundrobin instead solves the problem. Zoffix++ for help. |
17:23 | |
synopsebot6 | Link: rt.perl.org/rt3/Public/Bug/Display...?id=131075 | ||
rakudo/nom: b108c85105 | (Zoffix Znet)++ | t/harness6 Merge pull request #1050 from dogbert17/fix-for-rt-131075 Fix for RT #131075 |
|||
synopsebot6 | Link: rt.perl.org/rt3/Public/Bug/Display...?id=131075 | ||
dogbert17 | oO | 17:24 | |
Zoffix | holy crap, nextcallee is finicky | 17:31 | |
loop { dd nextcallee } gives Any instead of my callee, presumable cause it looks for that block instead of my routine >_< | 17:32 | ||
TimToady | huh, when did nextcallee officially get into the language? | ||
[Coke] | the language or the compiler? | 17:34 | |
Zoffix | TimToady: Before Christmas apparently, tho looks it might've been accidental: github.com/perl6/roast/commit/d88e...0526b489ca | ||
That commit is the only instance of it in roast; though I see it mentioned in the docs too. | 17:35 | ||
TimToady: I take it it shouldn't be? | |||
TimToady | looks like it's just in there to test wrapping | 17:36 | |
take a reference to the innards of a dispatcher seems...fraught... | |||
[Coke] | github.com/rakudo/rakudo/commit/b6...bc13b125cc is the commit that put it in rakudo | ||
TimToady | okay, I vaguely remember jnthn++ asking about calling something repeatedly | 17:37 | |
[Coke] | rt.perl.org/Ticket/Display.html?id=125783 is the ticket | ||
TimToady | but that's for .wrap, dunno why you'd expect it to work in a loop | 17:38 | |
it might work in a multi, or in a method dispatch | |||
Zoffix | Well, I wanted to loop through candidates and find one on which `callwith` wouldn't fail to bind with | 17:39 | |
And the "loop through" part puts nextcallee into a loop and makes it give wrong results :) | 17:40 | ||
TimToady | nextcallee doesn't do that | ||
nextcallee will always give you the same next one | |||
unless you actually call down | |||
it's not for iterating the candidate list | |||
Zoffix | Hm, then there's a bug. Because it shifts the candidates | ||
m: gist.github.com/zoffixznet/80955d5...8e0c8c7d3a | 17:41 | ||
camelia | Middle (Middle) Non-Prime 42 We're back! The return value is from NotPrime |
||
TimToady | hmm, well, maybe it could be used that way then | ||
Zoffix | Without `nextcallee` call, `callwith` ^ would've called the `Wider` candidate and failbind | ||
Now... if only I could stick it in a loop š¤š¤š¤ | 17:42 | ||
s: &nextcallee | 17:43 | ||
TimToady | try something non-closurey, like a hyper? | ||
SourceBaby | Zoffix, Sauce is at github.com/rakudo/rakudo/blob/dc81...ol.pm#L131 | ||
TimToady | well, but what to hyper it with, since it's a function... | ||
Zoffix | hehe | 17:44 | |
TimToady | obviously you just need a goto | 17:45 | |
Zoffix | :D | 17:46 | |
TimToady | anyway, hyper would have its own dispatcher, obviously, which would interfere | 17:48 | |
so I suspect you can't do this in Perl 6 without dropping into nqp | |||
dispatchers are, by necessity, considered very low level | 17:49 | ||
well, or you could implement goto :D | |||
or we could implement an opcode that would give you the nth dispatcher going outward | 17:50 | ||
Zoffix | I'm gonna take the easy way out... Just not mention anything about looping and nextcallee in my article :) | 17:52 | |
TimToady | the intent was obviously to only deal with the next candidate, not the one after that :) | 17:53 | |
Zoffix | seems like it :) | ||
TimToady | I suppose we could add a loop inside nextcallee, with an optional :nth() arg, since nextcallee itself is perhaps not in anyone's hotpath, but that wouldn't help your article | 17:55 | |
or add a nextcallees function that returns them all | 17:56 | ||
that would maintain better inlineability for nextcallee itself | 17:57 | ||
interesting that shift_caller deconts after pulling from an nqp list, so something (probably .wrap?) pokes containerized routines into it | 18:04 | ||
I wonder why we don't decont when poking things in, rather than when pulling candidates out... | |||
or maybe it's superstitious? | |||
seems like a heck of a lot of unnecessary deconts, if so, so probably is there for a reason | 18:05 | ||
I guess we need to be able to store wrappable candidates | 18:06 | ||
TimToady wonders how much faster we'd run if we didn't allow such late wrapping, and what would break | 18:08 | ||
maybe it type-specializes away somewhere | |||
Zoffix | Well, I *think* I succeeded in my quest: my $r = &?ROUTINE; my @nextcallees = .[.first(* === $r, :k) ^.. *] with $r.dispatcher.candidates; | ||
TimToady | I guess .dispatcher will return the nextsame list, not the whole list | 18:09 | |
Zoffix | of wait, It also needs a .grep: *.cando: \(.signature) or whatever | 18:10 | |
Zoffix moves on... | |||
TimToady | huh, p6finddispatcher is heavier than I expected, seems to act more like p6createbrandnewdispatcher... | 18:21 | |
probably a consequence of not having cons lists... | |||
or maybe I'm reading it wrong | 18:22 | ||
[Coke] gets ready to get laid off Friday! | |||
Zoffix | :( | 18:23 | |
[Coke] | (new job literally starts Saturday, everything is fine) | ||
Zoffix | say $new-job cmp $old-job | ||
TimToady | m: class Foo { method x { say &?ROUTINE.dispatcher.WHICH } }; class Bar is Foo { method x { say &?ROUTINE.dispatcher.WHICH; nextsame } }; Bar.new.x | 18:25 | |
camelia | Mu|U36394168 Mu|U36394168 |
||
TimToady | okay, it doesn't clone dispatchers for nextsame, whew! :) | ||
just uses the current dispatcher destructively | 18:26 | ||
SmokeMachine | is it just for me or is t/spec/S05-modifier/ignorecase.rakudo.moar broken? | 18:30 | |
and t/spec/S09-hashes/objecthash.rakudo.moar seems to have a redeclared %h there too... | 18:31 | ||
Zoffix | I saw ignorecase. pass a TODO once in a while recently... | ||
TimToady | SmokeMachine: are you running on HEAD? | 18:32 | |
maybe you need . config.status or so? | 18:33 | ||
SmokeMachine | TimToady: I think so... I just rebase my changes and tried again... | ||
maybe... | |||
Ill see that.. | |||
TimToady | could be the tests outracing the bumps... | 18:34 | |
SmokeMachine | this is the problem for objecthash: github.com/perl6/roast/blob/master...hash.t#L87 | 18:35 | |
redeclaring the %h | |||
TimToady | I'm guessing whoever added that didn't run the test individually, and the warning got hidden | 18:47 | |
SmokeMachine | the ignore case test worked after I ./Configure again... | ||
TimToady | I can never remember the Configure options, which is why I do . config.status :) | 18:48 | |
SmokeMachine | :) | 18:50 | |
Zoffix | m: say DateTime.now > DateTime: :2016year | 18:57 | |
camelia | Cannot resolve caller Real(DateTime: ); none of these signatures match: (Mu:U \v: *%_) in block <unit> at <tmp> line 1 |
||
Zoffix | :/ I thought we added these :\ | ||
m: say DateTime.now after DateTime: :2016year | |||
camelia | Use of uninitialized value of type DateTime in string context. Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful. in block <unit> at <tmp> line 1 True |
||
Zoffix | m: say DateTime.now after DateTime: :2022year | ||
camelia | Use of uninitialized value of type DateTime in string context. Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful. in block <unit> at <tmp> line 1 True |
||
Zoffix | :( | ||
terrible | |||
Oh, I'm just missing a .new \o/ | 18:59 | ||
m: say DateTime.now > DateTime.new: :2016year | |||
camelia | True | ||
Zoffix | m: say DateTime.now > DateTime.new: :2018year | ||
camelia | False | ||
samcv | Zoffix, those todo's pass magically for unknown reasons | ||
just flapping | |||
Geth | rakudo: FCO++ created pull request #1051: Fix multidimensional hash slice |
||
roast: FCO++ created pull request #259: Add tests for multi dimensional hash slice |
|||
Zoffix | samcv: why magically? It uses .pick, so randomly it picks examples that avoid the bug, don't it? | ||
samcv | which is kind of weird in and of itself. | ||
maybe | 19:00 | ||
that may be true | |||
i will adjust it | |||
i see why it could pass wrongly. fixing | 19:03 | ||
SmokeMachine | this PR fixes the multi dimensional hash slice... but without it, the only feature thats right takes 0.02741633 on my machine... with it it takes 0.1098307, but it fix what didn't work without that... | ||
samcv | gonna do ('a'..'r','u'..'z').flat.pick | ||
SmokeMachine | its much slower... but works... is that ok? | ||
samcv | is there a way to do ranges like this without havng to make two and then flatten it? | 19:04 | |
Zoffix | SmokeMachine: yes. Wrong answer that's fast is worse than right answer that's slow :) | 19:05 | |
m: sub postcircumfix:<{; }> (\a, \b) { dd b }; my %h; %h{1;1...5} | 19:06 | ||
camelia | (1, (1, 2, 3, 4, 5).Seq) | ||
Zoffix | SmokeMachine: ^ looks like it's possible to pass a Seq as a slice. Does your code handle it right? 'cause Seq isn't a List | 19:07 | |
and you have nqp::istype(blah, List) up in there | |||
SmokeMachine | Zoffix: yes... I didn't thought about the Seq... | 19:08 | |
fixing | |||
Zoffix | SmokeMachine: I think people usually use nqp::istype(blah, Iterable) | ||
OTOH Hash/Map are also Iterable, so *shrug* | |||
SmokeMachine | Zoffix: great@ | ||
! | |||
Zoffix: Positional? | 19:09 | ||
Zoffix | SmokeMachine: Seq isn't positional | ||
SmokeMachine | :( | ||
Zoffix | :) | ||
SmokeMachine: I think Iterable is the best bet. | |||
SmokeMachine | ok! fixing! | ||
Geth | roast: bacc9cb41c | (Samantha McVey)++ | S05-modifier/ignorecase.t ignorecase.t don't generate random strings containing the needle This *may* have been the reason some of these tests were passing sometimes |
19:13 | |
samcv | ok should maybe be fixed now. now it'll repick if it picks a string that contains 'st' in it | 19:14 | |
SmokeMachine | Zoffix: changed... | 19:18 | |
if the PR is ok, can I accept it? | 19:19 | ||
Zoffix | Probably :) | 19:21 | |
samcv | SmokeMachine, how commonly used is this in perl 6 code? | 19:22 | |
Zoffix | m: use nqp; my \indices = [1..*]; dd nqp::iseq_I(indices.elems, 1), | ||
camelia | P6opaque: get_boxed_ref could not unbox for the representation '20' of type Failure in block <unit> at <tmp> line 1 |
||
SmokeMachine | samcv: I don't think its very used... | ||
samcv | ok then making it correct is probably better than making it fast | 19:23 | |
Zoffix | .oO( when is making it fast is better than making it correct :D ) |
||
m: sub rand { 4 }; say rand | |||
camelia | 4 | ||
Zoffix | I guess .is-prime falls into that category | 19:26 | |
Since it's not 100% right | |||
SmokeMachine | Zoffix: why isn't it 100% right? | ||
Zoffix | SmokeMachine: because it's probabilistic :) It uses a formula that most of the time gives right results, but not 100% all the time. There are some inputs that it'll say they're prime/not-prime | 19:27 | |
SmokeMachine | 'make' is not recognized as an internal or external command? | 19:28 | |
samcv | Zoffix, which inputs are those? | ||
and are they in roast? | |||
Zoffix | sudo apt-get install build-essential? | ||
SmokeMachine | what does that mean? ci.appveyor.com/project/moritz/rak...5gea2bqd59 | 19:29 | |
Zoffix: ^^ | |||
Zoffix | Man, what';s the name of a popular Perl guy? | 19:30 | |
samcv | msdn.microsoft.com/en-us/library/1kay26wa.aspx | ||
dunno | |||
i have seen it before | |||
jnthn, ? | |||
Zoffix | Damn. Damian Conway | ||
*sigh* was trying to remember the name to find the talk about the .is-prime stuff | |||
This one: www.youtube.com/watch?v=Nq2HkAYbG5o | 19:31 | ||
I *think* it's it; I attended the "extended version"; but maybe regular version has is prime stuff too | |||
And well, it names what we use for is-prime and using that name you can google what inputs it's not right for :) | |||
Zoffix guesses you'd have to wait a lot of time for it to complete to process them :) | 19:32 | ||
samcv | i think i've seen that talk. was good. | 19:33 | |
Zoffix | SmokeMachine: no idea. Something's up with appveyor again. It's not just your commit, all the previous ones have that problem too | 19:34 | |
jnthn | samcv: Sounds like the issue that was fixed in github.com/MoarVM/MoarVM/commit/36...14c82e37b5 | 19:36 | |
samcv | cool | ||
jnthn | Just means that it doesn't cope with sizeof(void *) or so | 19:37 | |
Or more like, won't let you do pointer arith on void* | |||
Since it doesn't know the units | |||
I guess other compilers assume the unit is bytes | |||
timotimo | SmokeMachine: i think you can get away with only calling SELF.EXISTS-KEY when the outermost and second-from-outermost if hits its else-branch | 19:51 | |
SmokeMachine: also, check how indices[1 .. indices.end] compares to indices[1..*] and indices.skip(1) | |||
m: say (1, 2, 3, 4).skip(1) | |||
camelia | (2 3 4) | ||
SmokeMachine | m: my @a = ^10; $ = @a.skip(1) for ^10000; say now - INIT now | 20:06 | |
camelia | 0.0568199 | ||
SmokeMachine | m: my @a = ^10; $ = @a[1 .. @a.end]for ^10000; say now - INIT now | ||
camelia | 0.6056935 | ||
SmokeMachine | changing to skip! | ||
m: my @a = ^10; say = @a.skip | 20:07 | ||
camelia | 5===SORRY!5=== Error while compiling <tmp> Preceding context expects a term, but found infix = instead at <tmp>:1 ------> 3my @a = ^10; say =7ā5 @a.skip |
||
SmokeMachine | m: my @a = ^10; say @a.skip | ||
camelia | (1 2 3 4 5 6 7 8 9) | ||
SmokeMachine | m: my @a = ^10; $ = @a.skip for ^10000; say now - INIT now | ||
camelia | 0.0490078 | ||
SmokeMachine | timotimo: thanks! | ||
m: my say ^10 .skip | 20:10 | ||
camelia | 5===SORRY!5=== Type 'say' is not declared at <tmp>:1 ------> 3my say7ā5 ^10 .skip Malformed my at <tmp>:1 ------> 3my7ā5 say ^10 .skip |
||
SmokeMachine | :( | ||
timotimo | haha "my say"? :) | 20:11 | |
SmokeMachine | m: say ^10 .skip | 20:12 | |
camelia | (1 2 3 4 5 6 7 8 9) | ||
SmokeMachine | (sorry) | ||
m: my $a = ^10; $ = $a.skip.cache for ^10000; say now - INIT now | |||
camelia | 0.09728743 | ||
SmokeMachine | with skip it got from 0.1098307 to 0.0547416 | 20:17 | |
timotimo | *nice* | ||
SmokeMachine | thanks! | ||
(but I had to .skip.cache) | |||
if/when you guys think its ok to merge the PR, please tell me | 20:21 | ||
Zoffix | yeah merge it | 20:48 | |
lizmat | m: my %h{Any} = now => 42; dd %h # guess this is a case of DIHWIDT | 21:01 | |
camelia | Hash[Any,Any] %h = (my Any %{Any} = :now(42)) | ||
SmokeMachine | lizmat: sorry, what means DIHWIDT? | 21:04 | |
lizmat | Doctor, It Hurts When I Do This | ||
(then don't do that :-) | |||
timotimo | yas | ||
[Coke] | buggable: DIHWIDT? | 21:05 | |
lizmat | m: my %h{Any} = now,42; dd %h | ||
camelia | Hash[Any,Any] %h = (my Any %{Any} = Instant.from-posix(<1265707485887/849>, Bool::False) => 42) | ||
[Coke] | ETOOMANYBOTS | ||
lizmat | ah, better :-) | ||
SmokeMachine | Zoffix: create a merge commit, squash and merge or rebase and merge? | 21:06 | |
Zoffix | SmokeMachine: dunno, just click some button :) | 21:08 | |
I'd say it's a case of DWIM. You asked for quoted key, so you got it. It'd be pretty weird if your keys got automatically changed the second you imported some term or constant. | 21:09 | ||
m: my %h{Any} = (now) => 42; dd %h | |||
camelia | Hash[Any,Any] %h = (my Any %{Any} = Instant.from-posix(<1862036359552/1249>, Bool::False) => 42) | ||
Zoffix | m: my %h{Any} = 42 R=> now; dd %h | ||
camelia | Hash[Any,Any] %h = (my Any %{Any} = Instant.from-posix(<2512034655006/1685>, Bool::False) => 42) | ||
Geth | rakudo/nom: a758c0bbf9 | (Fernando Correa)++ | src/core/hash_slice.pm Fix multidimensional hash slice &postcircumfix:<{; }> wasnt prepard to receive a List as one (or more) position(s) of the argument list (eg: %h{"bla", "ble"; "bli"}) |
||
rakudo/nom: dc812a4a5a | (Fernando Correa de Oliveira)++ | src/core/hash_slice.pm Merge pull request #1051 from FCO/multidimensional-hash-slice Fix multidimensional hash slice |
|||
lizmat | SmokeMachine++ | ||
Geth | roast: a25592a533 | (Fernando Correa)++ | S09-hashes/objecthash.t Add tests for multi dimensional hash slice |
21:10 | |
roast: fc4e2c7b25 | (Fernando Correa de Oliveira)++ | S09-hashes/objecthash.t Merge pull request #259 from FCO/multidimensional-hash-slice Add tests for multi dimensional hash slice |
|||
SmokeMachine | lizmat: thanks! | ||
Zoffix | SmokeMachine: what does the .skip.cache do tho? | 21:11 | |
lizmat | the .skip skips the first element of the sequence, the .cache makes sure that you can .AT-POS it without losing the iterator | ||
SmokeMachine | Zoffix: what lizmat sad | 21:12 | |
Zoffix | Ah | ||
SmokeMachine | Zoffix: and @a.skip is 10 times faster than @a[1 .. @a.end] | 21:13 | |
Zoffix | Sweet | ||
Geth | rakudo/nom: a8c6eca78d | (Elizabeth Mattijsen)++ | src/core/set_operators.pm Make Str (elem) Map / Map (cont) Str 50x faster At least. Because this timing is for a one element hash. Since these candidates don't need to coerce anything to a Set, the gain for larger Maps / Hashes would be even bigger. |
21:17 | |
lizmat | now, if I would have a way to do MMD on object hashes... | 21:18 | |
I could do the same for Any (elem) ObjHash | |||
Zoffix | Holy shit. | 21:19 | |
lizmat++ | |||
DrForr | lizmat: Before I forget, Perl6::Tidy does some very primitive indentation. | ||
SmokeMachine | lizmat++ | ||
lizmat: sorry again, but whats MMD? | 21:20 | ||
lizmat | multi method dispatch | ||
SmokeMachine | thanks! | ||
b2gills | That commit does something slightly different to calling .Set, as ļ½¢'a' (elem) { 'a' => 0 }ļ½£ will now return True but used to return False. | 21:36 | |
I think it is an improvement though, as it makes more sense. | |||
lizmat | argh | 21:37 | |
yes | |||
hmmm | |||
fwiw, that wasn't picked up by spectesting | 21:38 | ||
m: say 'a' (elem) { 'a' => 0 } | |||
camelia | True | ||
lizmat | argh, too late :-) | 21:39 | |
nebuchadnezzar | lizmat: isn't bisectable6 here for that purpose? | 21:53 | |
I confess I'm a little bit lost will the bots | 21:54 | ||
Geth | rakudo/nom: 5aebaf1fe4 | (Elizabeth Mattijsen)++ | src/core/set_operators.pm Fix Str (elem) Map / Map (elem) Str for False values As b2gills++ pointed out, we still need Set semantics. So we actually need to check the value truthiness. This reduces the speed increase from 50x to 15x. Again, for a 1 elem hash. Larger maps / hashes should be much faster still. |
||
lizmat has done enough damage for today | 22:02 | ||
good night, #perl6-dev! | |||
Zoffix | night | 22:10 | |
samcv | night | 23:31 | |
Zoffix | night | 23:37 | |
SmokeMachine | m: my %a = 1 => {2 => {3 => 42}}; say %a{1;2;3}:exists | 23:43 | |
camelia | True | ||
SmokeMachine | m: my %a = 1 => {2 => {3 => 42}}; say %a{1,1;2;3}:exists | ||
camelia | (True True) | ||
SmokeMachine | m: my %a = 1 => {2 => {3 => 42}}; say %a{1;*;3}:exists # I think I forgot this case... what should it return? | 23:44 | |
camelia | False | ||
SmokeMachine | m: my %a = 1 => {2 => {3 => 42}}; say %a{1;*;3} | 23:46 | |
camelia | (42) | ||
Zoffix | m: .say with do with 42 { $_ } | 23:51 | |
camelia | 42 | ||
Zoffix loves it |