00:39 lucasb left
MasterDuke is this github.com/rakudo/rakudo/blame/mas...qp#L35-L43 still needed? after adding some logging and always seeing it composed i reverted github.com/rakudo/rakudo/commit/8e...581ed5af41 and a spectest passed 00:56
01:13 sena_kun joined 01:15 Altai-man_ left
Geth rakudo: MasterDuke17++ created pull request #3542:
Revert "Work around existing bug exposed by mixin caching."
01:22
02:02 MasterDuke left 03:12 Altai-man_ joined 03:15 sena_kun left 05:13 sena_kun joined 05:15 Altai-man_ left 06:41 domidumont joined 07:13 Altai-man_ joined
lizmat Files=1305, Tests=111213, 208 wallclock secs (28.17 usr 8.16 sys + 2916.40 cusr 272.20 csys = 3224.93 CPU) 07:13
Geth rakudo: 771b95438e | (Daniel Green)++ | src/Perl6/Metamodel/Mixins.nqp
Revert "Work around existing bug exposed by mixin caching."

This reverts commit 8ec84b608d0b3c21ec465352eef617581ed5af41.
Adding some logging showed that `self.is_composed($obj)` is always true when building Rakudo.
07:14
rakudo: 5d8123a27f | (Elizabeth Mattijsen)++ (committed using GitHub Web editor) | src/Perl6/Metamodel/Mixins.nqp
Merge pull request #3542 from MasterDuke17/non_composed_mixing_workaround_no_longer_needed

Revert "Work around existing bug exposed by mixin caching."
07:15 sena_kun left
[Tux] gist updated with final measurements. Note the leading note 07:21
08:11 Kaiepi joined
[Coke] which gist? 08:40
08:46 vrurg left 08:47 vrurg joined
Geth rakudo: 33fc89507c | (Elizabeth Mattijsen)++ | src/core.c/CompUnit/RepositoryRegistry.pm6
Streamline include-spec2cur in CU::RepositoryRegistry

  - de-hllize lookups
  - us binding where possible
  - use subclass check only
08:48
08:48 Geth left 08:49 Geth joined, dogbert11 joined, Kaiepi left, Kaiepi joined 08:52 dogbert17 left
lizmat [Coke]: gist.github.com/Tux/6f1aa9cfbb1d94...2d0ac08aae 08:59
[Coke] Danke && nifty 09:03
09:13 sena_kun joined 09:15 Altai-man_ left
Tux__ [Coke} those columns: 1: commit of rakudo, 2: version/tag of rakudo, 3: two timings for Text::CSV's test-t run (fastest left, slowest right) 09:28
as the note said, on 23:00 Amsterdam/Europe the resource-heavy cron jobs start running, so I bet the times go up from there 09:29
09:57 MasterDuke joined
MasterDuke Tux__: how was your skiing? i was pretty impressed with Alpendorf, there was ~2in of powder overnight at the top (though the bottom was slushy ice balls) 09:58
lizmat: unfortunately work cancelled my trip, so i won't be at Lausanne 09:59
Tux__ MasterDuke, not my best trip. The conditions were bad 10:03
MasterDuke jnthn: i tried adding some `publish_(type|method)_cache`s here github.com/MasterDuke17/rakudo/blo...p#L27-L55, but everything caused the build to fail 10:04
lizmat MasterDuke: I won't be at Lausanne either :-(
MasterDuke Tux__: too bad. they weren't the best conditions i've ever seen in my life, but for a first time visiting the Alps put on a pretty good showing 10:05
my daughter also tried skiing for the first time and like it, so that's also a plus
lizmat: also too bad
nine lizmat: this can't be right: github.com/rakudo/rakudo/blob/mast...me.pm6#L56 10:34
lizmat why? 10:35
nine lizmat: when $!second is 0, the call would be nqp::substr($int,0,-3) which would cause a "Substring length (-3) cannot be negative" error
lizmat m: dd DateTime.new(2020,3,10,11,38,0.3).Str 10:38
camelia "2020-03-10T11:38:00.300000Z"
lizmat so why doesn't that fail ?
nine Oh, that's why: github.com/rakudo/rakudo/blob/mast...me.pm6#L47 10:39
m: DateTime.new(2020,3,10,11,38,0.001).Str.say
camelia 2020-03-10T11:38:00.001000Z
nine m: DateTime.new(2020,3,10,11,38,0.000001).Str.say 10:40
camelia 2020-03-10T11:38:00.000001Z
nine Odd...both of these fail locally 10:41
lizmat nine: perhaps add tests for the cases that fail locally for you ? 10:45
nine m: say $*PERL.compiler.version 10:48
camelia v2020.01.136.g.8.c.995.febd
nine That's why it doesn't fail in camelia ^^^
It's a regression in 2020.02 (shown up on our production system)
lizmat yikes... camelia not very up to date
confirmed here 10:49
will fix
nine Yeah, because: error: Entry '3rdparty/nqp-configure/lib/NQP/Config.pm' would be overwritten by merge. Cannot merge.
vrurg: can we please have a fixed submodule handling for NQP::Config? It's killing camelia every couple of weeks and costs me lot of time 10:50
lizmat m: DateTime.new(2020,3,10,11,38,1.000001).Str 11:06
camelia sudo: /home/camelia/rakudo-m-inst/bin/perl6-m: command not found
lizmat meh
p6: DateTime.new(2020,3,10,11,38,1.000001).Str 11:07
camelia sudo: /home/camelia/rakudo-m-inst/bin/perl6-m: command not found
lizmat evalable6: DateTime.new(2020,3,10,11,38,1.000001).Str
evalable6
lizmat looks like they're all stuck :-(
11:12 Altai-man_ joined
Geth rakudo: 95de785951 | (Elizabeth Mattijsen)++ | src/core.c/DateTime.pm6
Fix default DateTime stringification for second 0..^1

Spotted by Stefan Seifert++.
11:15
roast: 6975233b35 | (Elizabeth Mattijsen)++ | S32-temporal/DateTime.t
Add test for DateTime with second 0..^1
11:15 sena_kun left
lizmat nine: ^^ 11:16
nine m: say $*PERL.compiler.version 11:35
camelia sudo: /home/camelia/rakudo-m-inst/bin/perl6-m: command not found
nine Don't we install perl6-m anymore? 11:37
lizmat my install/bin indeed does not have a perl6-m anymore 11:38
I guess camelia needs to get with the times :-) 11:39
I guess rakudo-m would be the most appropriate choice
nine Why do we insist on breaking people's setups?
jnthn I think it's too soon to not install perl6-m 11:40
Please put it back
nine Even MoarVM contains scripts with perl6-m in the shebang line
Inline::Perl6 uses perl6-m in Makefile.PL - because it doesn't work on any other backend 11:41
lizmat I guess making an issue is in order :-)
nine Breakage is caused by commit f5f6f76ff1fbb23e709e095c2423f19925152e8b 11:42
Author: Vadim Belman [email@hidden.address]
Date: Thu Feb 13 23:11:47 2020 -0500
linkable6 (2020-02-13) github.com/rakudo/rakudo/commit/f5f6f76ff1 Renaming of perl6 to rakudo
nine Renaming of perl6 to rakudo
I guess I'll just revert that?
lizmat not sure that would be the most productive solution 11:43
pretty sure vrurg will be able to come up with a fix quickly once they are awake
mind you, it's been in there for almost a month *and* in the 2020.02 release 11:44
12:34 Kaeipi joined, Kaiepi left
Geth rakudo: 0e87235684 | (Elizabeth Mattijsen)++ | src/core.c/DateTime.pm6
Make default DateTime stringification about 10% faster

  - don't use nqp::concat, joining on empty string anyway
  - lose nqp::tostr_I where not needed
12:50
lizmat afk for a few hours& 12:51
13:02 Voldenet left 13:13 sena_kun joined 13:15 Altai-man_ left 13:16 Voldenet joined, Voldenet left, Voldenet joined 13:38 rypervenche left
vrurg nine: perl6-m has been clearly overlooked. I have daytime job tasks but will fix it later today. 13:39
13:41 rypervenche joined 13:59 lucasb joined 14:07 MasterDuke left 14:49 MasterDuke joined
AlexDaniel` who's stuck again? 14:54
14:54 AlexDaniel joined, AlexDaniel left, AlexDaniel joined
AlexDaniel e: say 42 14:55
evalable6 42
AlexDaniel doesn't look stuck to me
I guess I misread :-)
m: say 42 14:56
camelia sudo: /home/camelia/rakudo-m-inst/bin/perl6-m: command not found
AlexDaniel I meanā€¦
MasterDuke camelia runs with sudo? 14:57
AlexDaniel yeah that's kinda amusing
MasterDuke might want to purge that from the logs 14:58
14:59 ChanServ sets mode: +o AlexDaniel, camelia was kicked by AlexDaniel (Kicked by AlexDaniel))
AlexDaniel m: say 42 14:59
hmmmm
15:00 ChanServ sets mode: -o AlexDaniel
AlexDaniel I think evalable doesn't know about kicks! 15:00
I was planning to fix m: but I think I broke it further :-)
eventually evalable will refresh the list and start working, I guessā€¦
m: say 42 15:06
github.com/Raku/whateverable/blob/...st.pm6#L56 15:07
it'll fix itself randomly :-) 15:08
15:12 Altai-man_ joined 15:13 evalable6 left
AlexDaniel or I can do this :) 15:13
15:15 evalable6 joined, sena_kun left 15:18 evalable6 left 15:21 evalable6 joined
AlexDaniel woah what happened to #perl6 16:03
last time I checked there were a bunch of users who are just forever online :)
now it's completely empty 16:04
sjn it's all #raku now, man
tyil AlexDaniel: perhaps everyone parted due to a netsplit 16:30
and rejoining forwarded them to #raku
AlexDaniel yeah 16:33
nine ++vrurg 16:58
MasterDuke: camelia runs with sudo -u evalbot perl6-m... 17:00
So sudo is actually reducing privileges here :)
17:02 Guest1277 left 17:13 sena_kun joined 17:15 Altai-man_ left
Geth rakudo: d95141ed94 | (Elizabeth Mattijsen)++ | src/core.c/DateTime.pm6
Make DateTime default stringification again a few % faster

  - make sure result of the < 10 check is used as multiplication factor
17:30
17:42 [Coke] left 17:45 [Coke] joined
Geth rakudo: a62da3019b | (Elizabeth Mattijsen)++ | src/core.c/CompUnit/RepositoryRegistry.pm6
Streamline CU::RepositoryRegistry's parse-include-specS

  - this is called many times during each time $*REPO is set up
17:46
17:46 [Coke] left, [Coke] joined 18:02 reportable6 left 18:03 reportable6 joined
MasterDuke nine: ah, nice 18:11
jnthn: any suggestions as to where to look to fix that type|method cache business? any dreams of code last night? 18:14
18:52 ufobat__ joined 18:56 ufobat_ left
Geth rakudo: vrurg++ created pull request #3544:
Fix installation of perl6 aliases
19:05
lizmat waits for Travis and Appveyor results 19:06
19:12 Altai-man_ joined 19:15 sena_kun left 19:37 domidumont left
Geth rakudo: 0736bf7d29 | (Elizabeth Mattijsen)++ | src/core.c/CompUnit/RepositoryRegistry.pm6
Streamline CU::RepositoryRegistry.setup-repositories

  - part 1
  - avoid multiple lookups for the same key
  - replace "ab{$foo}bar" by "ab" ~ $foo ~ "bar"
   The "ab{$foo}bar" construct should be avoided, especially if the
   variable is a native, as it causes an actual Callable to be created,
   which then gets called, and then coerced to a Str. Whereas the
   "ab" ~ $foo ~ "bar" construct basically codegens to nqp::concat()s.
20:19
rakudo: 437f9f4644 | (Elizabeth Mattijsen)++ | src/core.c/CompUnit/RepositoryRegistry.pm6
Streamline CU::RepositoryRegistry.setup-repositories

  - part 2
  - don't bind type if we don't need to
  - don't use nqp::iterator on temporary lists, just nqp::shift
20:50
lizmat nine ugexe when we're precomping, must $custom-lib really be initialized ? 20:51
Geth rakudo: 6e95e1b074 | (Elizabeth Mattijsen)++ | src/core.c/CompUnit/RepositoryRegistry.pm6
Streamline CU::RepositoryRegistry.setup-repositories

  - part 3
  - move initial $next-repo initialization into non-precomp if
   so we need to check that condition one time less
21:05
21:14 sena_kun joined 21:15 Altai-man_ left
nine lizmat: yes 21:17
lizmat okidoki
nine lizmat: the module we're precompiling may have dependencies that we need to load. These dependencies may e.g. want to access their %?RESOURCES for which we want to access the repos by name 21:18
lizmat unless nqp::existskey($custom-lib, 'vendor') { 21:19
nqp::deletekey($custom-lib, 'vendor');
}
that dpesn't make any sense, right ?
I mean if the key is not in there, the deletekey will be a noop
21:20 AlexDaniel left, AlexDani` joined
MasterDuke lizmat: have you benchmarked `if nqp::atkey() -> $foo { <do something with $foo> }` vs `if nqp::existskey() { $foo = nqp::atkey(); <do something with $foo> }`? ISTR some discussion that the first should be faster, but in my tests it isn't 21:35
lizmat Masterduke: if it isn't faster, then we need to look at why it is not :-) 21:36
MasterDuke++ # sanity checking expectations
it should be faster, because it is one less hash lookup
MasterDuke m: use nqp; my %h; for ^2_000_000 { %h{$_} = $_ if 2.rand.Int }; my $a; my $b; my $s = now; for ^2_000_000 { $b = ~$_; if nqp::existskey(%h, $b) { $a += nqp::atkey(%h, $b) } } ; say $a; say now - $s 21:37
evalable6 999528293698
2.14564874
MasterDuke m: use nqp; my %h; for ^2_000_000 { %h{$_} = $_ if 2.rand.Int }; my $a; my $b; my $s = now; for ^2_000_000 { $b = ~$_; if nqp::atkey(%h, $b) -> $d { $a += $d } } ; say $a; say now - $s
evalable6 1000604466125
2.42742473
MasterDuke that's about what i see locally. 1.8s for atkey, 1.45s for existskey+atkey 21:38
running the equivalent in nqp there's less of a difference, maybe none 21:39
`my %h := nqp::hash; my int $a := 0; while $a++ < 2_000_000 { nqp::if(nqp::isgt_n(nqp::rand_n(2), 1), nqp::bindkey(%h, $a, $a)) }; my int $b := 0; my int $c := 0; my num $s := nqp::time_n(); while $b++ < 2_000_000 { if nqp::existskey(%h, $b) { $c := $c + nqp::atkey(%h, $b) } } ; say($c); say(nqp::sub_n(nqp::time_n(), $s))` 21:40
vs
`my %h := nqp::hash; my int $a := 0; while $a++ < 2_000_000 { nqp::if(nqp::isgt_n(nqp::rand_n(2), 1), nqp::bindkey(%h, $a, $a)) }; my int $b := 0; my int $c := 0; my num $s := nqp::time_n(); while $b++ < 2_000_000 { if nqp::atkey(%h, $b) -> $d { $c := $c + $d } } ; say($c); say(nqp::sub_n(nqp::time_n(), $s))`
do those two pairs of tests look reasonable though? 21:41
lizmat well... in the CU case, the hashes are very much smaller 21:48
maybe 10 elements max or so
MasterDuke roughly the same result if i use an ~10 elem hash and just repeat the looping a bunch. i.e., `use nqp; my %h; for ^20 { %h{$_} = $_ if 2.rand.Int }; my $a; my $b; my $s = now; for ^100_000 { for ^20 { $b = ~$_; if nqp::atkey(%h, $b) -> $d { $a += $d } } }; say $a; say now - $s` 21:52
lizmat m: use nqp; my $h := nqp::hash("a",1,"b",2,"c",3,"d",4,"e",5); for ^1000000 { if nqp::atkey($h,"a") -> \foo { } }; say now - INIT now 21:55
evalable6 0.28330285
lizmat m: use nqp; my $h := nqp::hash("a",1,"b",2,"c",3,"d",4,"e",5); for ^1000000 { if nqp::existskey($h,"a") { my \foo = nqp::atkey($h,"a") } }; say now - INIT now
evalable6 0.0593059
lizmat yes, clearly a big difference :-(
the existkey case has no allocation 21:59
the atkey case has *very* many
looks like a BOOTCode object *and* an Int are allocated for each iteration :-( 22:00
22:04 squashable6 left
MasterDuke yeah, perf is showing the top function at 18.5% is MVM_fixed_size_alloc for the atkey version 22:06
22:06 squashable6 joined
MasterDuke but for the existskey version, top at 35% is `<unit>(-e:1)`, 29% is exists_key, and 21.5% is at_key 22:07
lizmat MasterDuke: it's a general issue with -> \foo { } 22:13
m: my %h = "a",1,"b",2,"c",3,"d",4,"e",5; for ^1000000 { if %h.EXISTS-KEY("a") { my \foo = %h.AT-KEY("a") } }; say now - INIT now
evalable6 0.0789675
lizmat m: my %h = "a",1,"b",2,"c",3,"d",4,"e",5; for ^1000000 { if %h.AT-KEY("a") -> \foo { } }; say now - INIT now
evalable6 0.3266065
lizmat so it seems that the overhead of -> \foo drowns the extra hash lookup :-( 22:14
jnthn ^^
m: my $a = 42; for ^1_000_000 { if $a { } }; say now - INIT now 22:27
evalable6 0.0434298
lizmat m: my $a = 42; for ^1_000_000 { if $a -> \foo { } }; say now - INIT now
evalable6 0.28756503
lizmat m: my $a = 42; for ^1_000_000 { if $a -> \foo { my $c = foo } }; say now - INIT now 22:29
evalable6 0.30326269 22:30
lizmat m: my $a = 42; for ^1_000_000 { if my $b := $a { my $c = $b } }; say now - INIT now
evalable6 0.086466
lizmat jnthn: not sure how often you use the if expr -> $foo { } construct, but it feels like low-hanging optimization fruit 22:31
Geth rakudo: 6723d3ad0e | (Elizabeth Mattijsen)++ | src/core.c/CompUnit/RepositoryRegistry.pm6
Streamline CU::RepositoryRegistry.setup-repositories

  - part 4
  - remove code that will never be run
  - reorganize code a bit for a more logical order
22:34
22:36 tbrowder left 22:40 tbrowder joined
MasterDuke ~100 uses in the rakudo source 22:52
22:56 kawaii left, zostay left, lucasb left
lizmat yeah... let's see what jnthn thinks about it 22:57
23:00 zostay joined
Geth rakudo: aeb418a5fd | (Vadim Belman)++ | 3 files
Fix installation of perl6 aliases

Full duplication of all `rakudo-*` executables
23:03
rakudo: 1fad174ca1 | (Vadim Belman)++ (committed using GitHub Web editor) | 3 files
Merge pull request #3544 from vrurg/fix-perl6-aliases-install

Fix installation of perl6 aliases
23:03 lucasb joined
23:03 kawaii joined
Geth rakudo: 24fd100da2 | (Elizabeth Mattijsen)++ | src/core.c/CompUnit/RepositoryRegistry.pm6
Streamline CU::RepositoryRegistry.setup-repositories

  - part 5
  - avoid if expr -> \foo {
   Turns out this construct is in very bad need of optimization
23:06
lizmat and that concludes my hacking for today
23:12 Altai-man_ joined 23:14 MasterDuke left 23:15 sena_kun left 23:20 AlexDani` is now known as AlexDaniel, AlexDaniel left, AlexDaniel joined
japhb lizmat: do you have a doc somewhere that has a list of your collected streamlining / micro-optimization techniques? I think that would be really valuable for people who need a fast inner loop *now*, and can't wait for long term optimization work. 23:20
AlexDaniel ja 23:21
japhb: it's not that simple
japhb For example, there is some code where I would happily make a separate file of "ugly but FAST inner loops" and call subs there from some of my never-fast-enough projects. 23:22
AlexDaniel at least in my experience a lot of the changes are very delicate and depend on the optimizations provided by the compiler itself
japhb AlexDaniel: Yes, I know -- but there seem to be a few that she uses all the time.
And the key thing for me is that are use cases where I want it fast *now*, despite the effort, and I'm happy to rewrite later if the relative performance changes happen 23:23
23:23 ChanServ sets mode: +o AlexDaniel, ChanServ sets mode: -o AlexDaniel 23:25 camelia joined
AlexDaniel m: say 42 23:25
camelia 42 23:26
23:46 MasterDuke joined