🦋 Welcome to the IRC channel of the core developers of the Raku Programming Language (raku.org #rakulang). This channel is logged for the purpose of history keeping about its development | evalbot usage: 'm: say 3;' or /msg camelia m: ... | Logs available at irclogs.raku.org/raku-dev/live.html | For MoarVM see #moarvm
Set by lizmat on 8 June 2022.
00:00 reportable6 left, reportable6 joined 00:26 JRaspass left, JRaspass joined 01:31 jgaz joined 03:27 nativecallable6 left, sourceable6 left, statisfiable6 left, benchable6 left, committable6 left, greppable6 left, coverable6 left, quotable6 left, squashable6 left, bloatable6 left, unicodable6 left, tellable6 left, linkable6 left, releasable6 left, bisectable6 left, shareable6 left, evalable6 left, reportable6 left, notable6 left, notable6 joined, tellable6 joined, unicodable6 joined, bloatable6 joined, greppable6 joined 03:28 evalable6 joined, reportable6 joined, quotable6 joined 03:29 squashable6 joined, committable6 joined, coverable6 joined, benchable6 joined, bisectable6 joined, statisfiable6 joined, linkable6 joined 03:30 nativecallable6 joined, releasable6 joined, sourceable6 joined, shareable6 joined 03:54 MasterDuke left 05:20 kjp left 05:23 kjp joined 06:00 reportable6 left 06:01 reportable6 joined 07:09 zostay left, zostay joined
Geth rakudo/main: 5b456299b6 | (Elizabeth Mattijsen)++ | 6 files
RakuAST: allow constants in rakudoc configs

  - move the literalization of configs to CHECK time
  - adapt deparsing of ::Doc::Block accordingly
  - fix .(w|s)orry-ad-hoc methods on ::Doc
  - add $!resolved-config attribute to ::Doc::Block
  - recursively visit ::Doc::Block.paragraphs for config literalization
... (5 more lines)
11:03
12:00 reportable6 left 12:01 reportable6 joined
Geth rakudo/main: 73888f45ad | (Nick Logan)++ | src/core.c/CompUnit/RepositoryRegistry.pm6
Remove largely unknown flags from installed raku script shims

A mostly unknown feature of the bin script shims CURI installs is that it allows choosing the distribution to load the script from, which allows loading an e.g. older version of some script. However to do so required using the :$name :$auth :$ver :$api arguments which prevents any installed raku bin script from taking any arguments of those names; the shim scripts breaks things such as providing a bin/foo --ver that outputs version information. This change removes those arguments until a better solution can be implemented.
12:54
rakudo/main: c14c725ab6 | (Nick Logan)++ (committed using GitHub Web editor) | src/core.c/CompUnit/RepositoryRegistry.pm6
Merge pull request #5286 from rakudo/ugexe/dont-squat-common-arg-names-redux

Remove largely unknown flags from installed raku script shims
[Tux] Rakudo v2023.05-137-gc14c725ab (v6.d) on MoarVM 2023.05-7-g3df20182b
csv-ip5xs0.798 - 1.025
csv-ip5xs-205.838 - 6.060
csv-parser4.028 - 4.499
csv-test-xs-200.404 - 0.523
test6.267 - 6.869
test-t1.378 - 1.501
test-t --race0.818 - 0.906
test-t-2019.865 - 22.107
test-t-20 --race6.172 - 6.974
14:07
ugexe gist.github.com/ugexe/6faa8b2e79e6...57cde0b8ec so the javascript library fdir can crawl the home directory pretty fast if it doesn't check for symlinks (it does it in 1 second for me). When I add the option to check symlinks it takes 12s. Rakudos dir-recurse crawls my home dir in 6s, but i think its checking for symlinks. 14:31
tellable6 2023-06-18T00:20:37Z #raku <tbrowder__> ugexe thanks. i'll keep fiddling with it and come for help if need be.
2023-06-18T10:39:36Z #raku <tbrowder__> ugexe if i use module A in module B, does it matter in which depends block it appears in the META6.json file for module B?
ugexe tbrowder__: sort of. if a module only appears in tests then it goes in test-depends, if it appears in tests and your e.g. provides then it goes in regular depends. if a module only appears in e.g. Build.pm then it goes in builds-depends, and if it appears in a Build.pm and one of your modules in provides then it goes in depends 14:34
you could also list things in more than one depends section if you really want to as well 14:39
strangely if i remove the nqp::fileislink check in DIR-RECURSE it takes over twice as long to run 14:46
tbrowder__ .tell ugexe thanks, Nick. 14:48
tellable6 tbrowder__, I'll pass your message to ugexe
16:12 benchable6 left, bisectable6 left, committable6 left, nativecallable6 left, linkable6 left, quotable6 left, notable6 left, evalable6 left, releasable6 left, shareable6 left, greppable6 left, unicodable6 left, reportable6 left, squashable6 left, tellable6 left 16:13 tellable6 joined, squashable6 joined, linkable6 joined, bisectable6 joined, greppable6 joined, quotable6 joined, nativecallable6 joined, benchable6 joined, shareable6 joined 16:14 reportable6 joined, releasable6 joined, evalable6 joined, committable6 joined 16:15 notable6 joined, unicodable6 joined
ugexe On most systems the call to readdir(3) -- github.com/MoarVM/MoarVM/blob/3df2...13-L336C20 -- would return if the path is a file or directory. In DIR-RECURSE it does one stat to check if the path is a file, and another if its not a file to see if its a directory because all it has is a string path. So for example if DIR-RECURSE was 16:48
implemented in moarvm it would be fairly easy to avoid those stat calls
although its not entirely annoying because on some filesystems readdir(3) doesn't return d_type 16:49
not entirely not-annoying^
16:52 SmokeMachine left, SmokeMachine joined
ugexe hmm, we are also stating every . and .. entry 17:08
gist.github.com/ugexe/5a3f62d5e66a...c1ae0575a8 17:19
that avoids stating some extra . and .. entries by doing the ACCEPTS check before the stat. it also skips the exitence stat check by just using `try` on the other two stats that come after 17:20
its a tiny bit faster, but not much
i had to use `try { nqp::foo(...) }` instead of just `try nqp::foo(...)` though 17:23
there is another microoptimization in there in that we don't technically need to create $path until after $!file.ACCEPTS or $!dir.ACCEPTS return true (or both return false). that would be an optimization because it avoids doing the concat with abspath and $entry if $entry starts with . (so whatever number of directories * 2 -- for . and .. -- number of concats) 17:26
well i guess not, the dot check is only on directories not files 17:27
it looks like maybe we would end up running nqp::fileislink($path) on every . and .. directory since those wouldnt fall through earlier conditionals due to the ACCEPTS 17:32
i dunno if they can be optimized though, since we don't know if we need to apply the $!file.ACCEPTS or $!dir.ACCEPTS to what fileislink will operate on 17:37
18:00 reportable6 left 18:02 reportable6 joined
Geth rakudo/main: c884b1668a | (Elizabeth Mattijsen)++ | src/core.c/RakuAST/Literalize.pm6
RakuAST: allow constant terms to be used in rakudoc config

By attempting to resolve RakuAST::Term::Name when literalizing, and use that value if successful.
18:51
rakudo/ugexe/optimize-dir-recurse: 4e08cb98f0 | (Nick Logan)++ | src/core.c/Rakudo/Internals.pm6
Remove stat existence check

Currently we do a stat to check that a path exists before we do a followup stat to check if that path is a file or directory. We have to do the second stat regardless, so if we just 'try' the second stat and remove the existence check then we ultimately do one less stat call. This changes the current behavior to the aforementioned behavior, resulting in a ~10% speed up.
19:30
rakudo/ugexe/optimize-dir-recurse: 8c5e74f7b5 | (Nick Logan)++ | src/core.c/Rakudo/Internals.pm6
Filter paths before stating them

Currently the default of DIR-RECURSE ignores any directory that starts with '.'. However, when reading the contents of a directory there is always a '.' and '..', which means we are stat'ing a lot of $entry that get filted out in the next conditional i.e.
  $!dir.ACCEPTS. This reorders the file and directory check
conditionals to filter before doing a stat, resulting in a ~3% speed up with the default directory and file filters.
rakudo: ugexe++ created pull request #5287:
Optimize internal directory recursion
19:34
rakudo/main: c6ceff3e6b | (Elizabeth Mattijsen)++ | src/core.c/RakuAST/Fixups.pm6
RakuAST: allow any uppercase characters as markup code

But only if explicitely specified in :allow. Later, maybe implicit specifications will also be handled. If now :allow values are known, still defaults to A..Z as allowable characters for markup code
19:55
lizmat s/now/no *sigh*
20:04 leont left 20:05 leont joined
Geth rakudo/ugexe/optimize-dir-recurse: 0ae022849e | (Nick Logan)++ | src/core.c/Rakudo/Internals.pm6
Remove stat existence check

Currently we do a stat to check that a path exists before we do a followup stat to check if that path is a file or directory. We have to do the second stat regardless, so if we just 'try' the second stat and remove the existence check then we ultimately do one less stat call. This changes the current behavior to the later aforementioned behavior, resulting in a ~10% speed up.
20:10
rakudo/ugexe/optimize-dir-recurse: 78d791120f | (Nick Logan)++ | src/core.c/Rakudo/Internals.pm6
Filter paths before stating them

Currently the default of DIR-RECURSE ignores any directory that starts with '.'. However, when reading the contents of a directory there is always a '.' and '..', which means we are stat'ing a lot of $entry that get filted out in the next conditional i.e.
  $!dir.ACCEPTS. This reorders the file and directory check
conditionals to filter before doing a stat, resulting in a ~3% speed up with the default directory and file filters.
ugexe added a missing `try` on nqp::fileislink and forced push^ 20:12
lizmat and still doing good on performance ?
ugexe yeah, the speed difference was ~1% slower but still an overall win by about 9% 20:13
lizmat cool! 20:14
ugexe i suppose the exceptions from e.g. nqp::stat can't be caught and resumed, or else that might be a way to not have 3 separate try 20:15
lizmat if they can't be resumed, then try wouldn't work either, because that depends on .resume, no? 20:17
ugexe m: use nqp; sub foo { CATCH { default { say $_.raku; $_.resume } }; nqp::fileislink("asdf"); }; foo()
camelia X::AdHoc.new(payload => "Failed to stat file: no such file or directory")
This exception is not resumable
in block at <tmp> line 1
in any at <tmp> line 1
in sub foo at <tmp> line 1
in block <unit> at <tmp> line 1
lizmat interesting
ugexe would be nice if that payload included the path as well 20:18
ok we can use a single `try` 20:27
its not ideal for a public facing api but for internal use i think its fine 20:28
timo1 i don't think any exception from "inside" moarvm are resumable, but resumable is also different from try 20:30
Geth rakudo/ugexe/optimize-dir-recurse: 2642bf2ddc | (Nick Logan)++ | src/core.c/Rakudo/Internals.pm6
Reduce number of 'try' used

Previously we added 'try' to nqp ops that expect their path arg to exist on the file system in order to remove a stat call to check for existence. This reduces the number of 'try' used from one for each of the aforementioned nqp ops to just one total, which results in a ~3% speed up.
20:36
23:02 evalable6 left, linkable6 left, evalable6 joined, linkable6 joined