🦋 Welcome to the MAIN() IRC channel of the Raku Programming Language (raku.org). Log available at irclogs.raku.org/raku/live.html . If you're a beginner, you can also check out the #raku-beginner channel!
Set by lizmat on 6 September 2022.
Voldenet rf: I like the stash, but accessing it by string is not very great performance-wise 00:41
m: for ^100000 { my %h; %h<what> = 42; for ^100 { %h<what>++; }}; say now - BEGIN now
camelia 1.246504761
Voldenet m: my %x = :what(1); for ^100000 { my $n = %x<what>; my @h; @h[$n] = 42; for ^100 { @h[$n]++; }}; say now - BEGIN now
camelia 0.62027981
Voldenet using array for stash is massive performance boost
and lookup can be mapped into array's index just once 00:42
the "stash-item" -> "index" can be mapped only on middleware starting up and can use some global session for the stash
s/global session/global hashmap/ 00:43
rf Hmm, I want it to be fairly usable though 00:45
I think you would expect to get stuff from the stash with named keys rather than indices
Voldenet consider such syntax: `sub middleware-session($app) { my $session-stash = $app.reserve-stash<session>; sub aux() { $lock.protect({ $session-stash.rw = %sessions{$session-id} }) })` 00:47
it's even possible to still have the by-dictionary hash 00:48
rf Ah, nice.
Voldenet basically, the array could implement associative role in a way that would delegate things to a hash
but middlewares with reserved stash item index could use this performance trick 00:49
and use the array directly
but imo most middlewares wouldn't have problems reserving their own stashes first 00:50
and dict-stash would be pure overhead, since the stash entries are going to be relatively static
rf Thanks for this feedback I will play around with this idea 00:52
Voldenet hm, now that I think of it, the bigger problem is that hash keys are going to allocate themselves per request and might end up being bigger than data 00:53
especially if you store bools/ints in that stash
so it's good to not allocate them at all :) 00:55
Voldenet `sub middleware-session($app) { my \session-stash = $app.reserve-stash("session"); sub aux() { $lock.protect({ session($request) = %sessions{$session-id} }) })` 01:01
`sub middleware-session($app) { my \session = $app.reserve-stash("session"); sub aux() { $lock.protect({ session($request) = %sessions{$session-id} }) })`
Voldenet there's definitely too many possibilities in how this can be implemented 01:01
MasterDuke does anyone here know the git diff implementation well enough to add a raku option to github.com/git/git/blob/master/userdiff.c ? would be very helpful 02:47
tonyo . 04:10
tbrowder hi, i'm seeing TAP installation failures on github workflows. to whom should i report that? uh, 12:00
tbrowder and happy spring forward DST change (not!) 12:00
the TAP failure is on windows, it's ok on linux and macos 12:01
tbrowder ah, i see the issue on the TAP github site 12:06
lucs tbrowder: It's known: github.com/Raku/tap-harness6/issues/61 13:26
(Oh, I guess you saw that.) 13:37
rf Good morning folks 14:54
rf .tell ugexe Is it possible to hookup zef to Jenkins or Nexus? 16:10
tellable6 rf, I'll pass your message to ugexe
ugexe what do you mean 16:26
tellable6 2023-03-12T16:10:52Z #raku <rf> ugexe Is it possible to hookup zef to Jenkins or Nexus?
rf Like if I wanted a private dist for a business or something but still have it installable by zef 16:28
For example in Java gradle, I'd just have to add the location of my builds to my build file and then gradle would look there if it couldn't find them in the main ecosystem 16:29
If `zef install <private-git-repo>` works that would work too I guess. 16:31
ugexe one way is to pass the url to `zef install MyDistDependingOnFoo github.com/private/repo/foo.git`. the other way is to add a config entry to github.com/ugexe/zef/blob/5345b918...on#L26-L38 that points to the private repo
rf Thanks! The latter is exactly what I'm after
ugexe i.e. you can use a Zef::Repository::Ecosystem plugin pointed to a remote or local json file of array of hash 16:32
rf ugexe++ 16:33
lizmat: dev.to/rawleyfowler/practical-mona...result-8c8 Hot off the presses 16:36
lizmat rf++ cool 16:38
shmup rf++ 16:50
rf: > So if we wanted to use our new exec-sql sub-routing downstream we'll no explicitly that this call can, and will fail.
rf Lol I started writing this too early in the morning apparently, thanks :) 16:59
shmup++
tbrowder hi, question: since rakudoc is to be the "pod" for Raku, has anyone started an effort to allow "rakudoc" as an alias to "pod" as in "=begin/=end rakudoc" interpreted in raku code as being the same as '=begin/=end pod'? that probably should be done as a branch off the raku ast branch i assume.
rf So turns out Humming-Bird is about 12% faster than Mojolicious with my basic tests :D 17:41
Maybe I should add "blazingly fast" to the readme 17:42
jdv i'd be skeptical. why not hit up @sri about measurements. 17:43
i think there's a mojo channel
rf I'm just blasting it with ~2000 req/sec it drops around 31% HB drops around 19%, over 500 seconds 17:49
rf It is also worth mentioning I HB provides about a 5th of what Mojo does so it's not really a fair comparison I guess 17:53
shmup i see you starred fennel. that is a good community 18:18
er, rf
rf I like Lisp quite a bit, don't write nearly enough of it
I have a few lua scripts I plan to re-write in Fennel or Raku some day
patrickb ugexe: I'm curious. What came of your Zef Grant idea? 19:52
ugexe patrickb: Yeah I need to revisit that... my laptop crapped out on me when I was originally making those plans and it fell on the back burner 20:01
$work has since provided me with a personal laptop to do open source with though (maxmind++) so that isn't a problem now 20:02
patrickb Ok. Thanks for the update. I do like what the grant is aiming for. 20:03
maxmind++ indeed 20:04
rf ugexe you work at maxmind? Neat. I applied there last year when I was looking for a new job. 20:08