🦋 Welcome to Raku! raku.org/ | evalbot usage: 'p6: say 3;' or /msg camelia p6: ... | irclog: colabti.org/irclogger/irclogger_log/raku
Set by ChanServ on 14 October 2019.
Doc_Holliwood @Stern-Brocot = 0, 1, 1, { |(@Stern-Brocot[$_ - 1] + @Stern-Brocot[$_], @Stern-Brocot[$_]) given ++$+1 } ... *; 11:39
what's that ++$+1 doing?
MasterDuke pre-incrementing (`++`) the anonymous state variable (`$`) and adding one to it (`+ 1`) 11:41
notagoodidea Looking at benhoyt.com/writings/count-words/ I was doing a version in Raku. 13:56
Basically, it is : my $counts = BagHas.new; $counts.add($_.lc.comb(/\w+/)) for $*IN.lines; and spurt $counts.kv in a file. 13:57
MasterDuke .words instead of .comb(/\w+/) should be faster 13:58
we've just been chatting about this over in #moarvm 13:59
notagoodidea The differences between .words and .comb(/\w+/) is the punctation handling too? 14:02
m: say "foo,bar".comb(/\w+/); 14:04
camelia (foo bar)
notagoodidea m: say "foo,bar".words;
camelia (foo,bar)
notagoodidea mm MasterDuke you were talking about the article or just .words vs .comb? I have simple solution around ~3s pastebin.com/9JQ3V6Nm 15:08
MasterDuke the article 15:10
you must have good hardware, it takes 11s for me 15:13
notagoodidea nah, I was using one version of the input not the 10x duplicate -_-' 15:15
with a simple time and output to stdout ~22sec :D 15:19
that hurts. 15:21
MasterDuke ha, i get ~1.5s for the single input
notagoodidea You have good hardware :D 15:22
MasterDuke ryzen 3700x, pretty happy with it
notagoodidea i5-6200U, 8Go from a Thinkpad X270. 15:23
With the profiler, its ~33sec 15:24
Now, how to do better :D 15:26
MasterDuke a plain hash is faster. a Bag goes off the .WHICH of the keys, so ends up allocating many more Strs 15:29
notagoodidea Yep, I was looking at it. But even `lc` and `words` alone take ~2s on my computer (in the profiler) 15:30
MasterDuke i can get it down to 9.5s by switching to a branch of moarvm i'm working on 15:36
notagoodidea mm, weird using a Hash if indeed faster than a BagHash but the %foo.sort(*.values).reverse is slower on the Hash than the BagHash ?? 16:19
lizmat *.values ?? not *.value ? 16:21
notagoodidea thanks lizmat that was it, stupid mistakes :D 16:24
lizmat and another Rakudo Weekly News hits the Net: rakudoweekly.blog/2021/03/15/2021-...year-itch/ 19:15
codesections lizmat++ 19:16
codesections .ask MasterDuke I saw you mention in #moarvm that your Raku startup time is ~75ms. Have you done anything to get it that fast, or do you just have a fast machine? I'm at ~125ms 19:55
tellable6 codesections, I'll pass your message to MasterDuke
gfldex codesections: time raku -e 'use v6' # real 0m0.086s # model name : AMD Ryzen 7 5800X 8-Core Processor 20:34
codesections gfldex: interesting. Similar here, but that's different than how I had been measuring startup time. Out of curiosity, what do you get for time raku -e 'unit sub MAIN {}' 20:42
gfldex codesections: real 0m0.094 20:43
:D Perl 5 is to fast to be measued 20:44
codesections interesting. I get 0.104. I'm curious both about why I see so much bigger a jump with &MAIN than you do and surprised that either of us have as large a one as we do/that loading an empty &MAIN takes 10%+ of the startup time 20:45
gfldex do you got fast RAM? 20:46
japhb gfldex: I kinda wondered when machines would get fast enough that perl5 startup was sub-1ms. Guess it finally happened. :-) 20:48
codesections gfldex: 3000MHz 20:49
japhb: yeah, Perl's startup time is pretty impressive. Basically as fast as Bash (though Dash still has a bit of a lead) 20:51
gfldex 3400MHz here. I could see a speedup in other workloads too after the upgrade. (povray, lzo)
MasterDuke codesections: haven't done anything extra. ryzen 3700x, 3200mhz ram
0.092s for `time raku -e 'unit sub MAIN {}'` 20:52
the 0.075s is for `time raku -e ''` 20:53
codesections Fascinating. That's a good 10% faster than me, with a ryzen 3950x, 3000MHz ram 20:54
gfldex Does raku still look for modules, even if there is no use-statement?
japhb gfldex: RAKU_MODULE_DEBUG (I think that's the name) should tell youi 20:55
*you
leont For me it fluctuates between 80-100 msec
japhb Sorry RAKUDO_MODULE_DEBUG 20:55
MasterDuke codesections: decent ssd? 20:56
japhb 130-136ms for raku -e '' here, but this is a several-year-old laptop. 20:56
codesections nvme, even 20:57
MasterDuke i will admit to being slightly surprised it was this fast. istr it usually being ~0.12s 20:57
same here (nvme ssd)
gfldex Once the cache is primed, SSD wont change things. 20:58
I got 64GB in my linux box now. It refuses to read from disk. :)
I just learned that CX::Return can't .resume. Makes sense. :) 21:02
tellable6 2021-03-15T19:55:46Z #raku <codesections> MasterDuke I saw you mention in #moarvm that your Raku startup time is ~75ms. Have you done anything to get it that fast, or do you just have a fast machine? I'm at ~125ms 22:00
codesections go home, tellable6, you're drunk 22:01
notagoodidea Hahaha :D
ok, so my bottleneck is post circumfix { }.. I think that is the hard stop to try with an hash. 22:07
MasterDuke you could just call %hash.AT-KEY directly, but that'd be an optimized version, not the simple version 22:13
notagoodidea MasterDuke: Oh. I finally used a combo of AT-KEY/ASSIGN-KEY and is defined(0). 22:23
lizmat weekly: don't forget Covid Observer next week: covid.observer/news/#20210308 22:25
notable6 lizmat, Noted! (weekly)
uzl[m] lizmat++ 22:39
I'm always amazed how liz keeps on top of everything Raku related :) 22:40
lizmat well, I missed the 1 year anniversary of covid.observer :-( 22:49
so I'm not on top as I could be
lizmat sleep& 22:57
japhb I dunno who is still awake in here (so I guess I'll announce it again in a few hours when Europe is waking up), but I've got something to announce: 23:07
🎉‭🎉‭🎉‭ I've just released MUGS 0.0.5 at github.com/Raku-MUGS (and uploaded into the fez/zef ecosystem). 23:08
It's built on lots of other Raku awesomeness, including Cro, Red, and RPG::Base (see github.com/Raku-MUGS/MUGS/blob/mai...lt-with.md for more details) 23:09
It's a platform for building game services, designed to host any game, and any UI. 23:10
Currently I have only a few (very simple) games uploaded, and two simple UIs: CLI (ANSI terminal) and WebSimple (basic HTML/trivial CSS) 23:11
m6locks holy crap
japhb I have in the works a full-screen TUI, a GTK+ interface, and lots more games -- including some twitch-style games, proving that Cro can serve fast enough to play at least 2D games remotely. 23:12
m6locks DOOM?-)
japhb Anyone interested can join me on #mugs here at Freenode or file issues on the github.com/Raku-MUGS repos
m6locks: Well, I did write a DOOM level viewer in Perl 5, I suppose I could port that .... :-) 23:13
japhb I'd have to revive the OpenGL work that I did back in the Parrot days, but perhaps that's worth doing. Hmmmm. 23:13
japhb drops another yak on the "to be shaved" heap 23:14
m6locks nice, I'd reckon DOOM runs on GTK since it's been ported everywhere
japhb (BTW, performance-wise, there are recently merged patches for Cro that make its minimum RTT faster, but the Cro folks are working to put the finishing touches on their next release, so if you try it now, expect it to be slightly slower.) 23:15
japhb m6locks: Oh yeah, definitely does run on everything (it's hilarious to see classic Doom inside emulators inside modern Doom games, BTW) 23:16
m6locks :) 23:17
japhb My kids have recently gotten to see the games of my teen years by finding them as easter eggs in the follow-ons from *their* teen years, which is kinda fun to watch. "Oh yeah, I remember this level, you have to get over to that spot over there to get the chainsaw." 23:18
Anyway, release roadmap is here: github.com/Raku-MUGS/MUGS/blob/mai...roadmap.md 23:20
Anyone interested in working on (or playing) games implemented in Raku, please join me on #mugs :-)
MasterDuke japhb: wouldn't github.com/Raku-MUGS/MUGS-Games/bl...od#L18-L25 be slightly faster as `.first`s? 23:24
japhb LOL 23:25
I was not expecting that as an early reaction!
MasterDuke heh, i was just clicking around randomly
japhb Yes, it would be faster, but 1) This is on the client side, so it is not as performance-critical as on the server side, however 2) It should be fixed anyway since the WebSimple gateway uses the client code to talk to the backend, so it isn't purely limited by a single user's inputs; thankfully 3) the lists are usually quite short. :-) 23:27
Oh, come to think of it, first might not be all that much faster there, because the expected case is that none of the greps find anything. Would speed up handling of errors. 23:30
MasterDuke i'm to bed, but it looks cool
japhb I figured most people would be heading to bed (or already in it) at this time of day, 23:31
but I also noticed a few people this week talking about their personal games-in-Raku project, so I figured announcing now (and then again in a few hours) was better than sitting on it even longer.
ugexe i wouldnt expect first to be much/any faster... its not actually going to grep every element in bool context 23:32
moon-child m: sub postfix:<&>(Code &x) { start &x }; { sleep 2; say 1 } & 23:33
camelia 5===SORRY!5=== Error while compiling <tmp>
Strange text after block (missing semicolon or comma?)
at <tmp>:1
------> 3ode &x) { start &x }; { sleep 2; say 1 }7⏏5 &
expecting any of:
infix
infix stopper
moon-child why doesn't ^^ work?
ugexe or rather its not going to grep every element after encountering one match
japhb ugexe: Ah, didn't realize that was optimized away. 23:33
japhb m: sub postfix:<&>(Code &x) { start &x }; ({ sleep 2; say 1 })& 23:34
camelia Type check failed in binding to parameter '&x'; expected Callable[Code] but got Block (-> ;; $_? is raw = O...)
in sub postfix:<&> at <tmp> line 1
in block <unit> at <tmp> line 1
japhb OH! 23:35
m: sub postfix:<&>(&x) { start x() }; ({ sleep 2; say 1 })&
camelia ( no output )
moon-child works locally anyway 23:36
thanks!
japhb moon-child: You had extra space before the postfix op, and had doubled-up the type constraint on the x param.
moon-child ahh I see
so Code &x means it has to return COde?
japhb moon-child: Yeah, which you can see by looking at the implementation of the Callable role 23:38
github.com/rakudo/rakudo/blob/mast...llable.pm6 23:39