| disbot7 | <.landyacht.> hm, the issue I'm running into is I want to turn this parameterized role I have into an OO::Monitor, but since OO::Monitor is based on ClassHOW it's not a simple conversion | 00:05 | |
| <.landyacht.> I can always manually put locks around the methods but it would be nice to have a more elegant solution | |||
| timo | can you mix in a role after the OO::Monitor has been created? in a ^parameterize method? | 00:16 | |
| SmokeMachine | glot.io/snippets/he7y3z6idz | 00:49 | |
|
02:06
guifa joined
02:30
kylese left
02:31
kylese joined
02:46
human-blip left
02:47
human-blip joined
02:49
guifa left
02:54
tejr left,
guifa joined
02:57
tejr joined
03:15
kylese left,
kylese joined
03:44
kaskal left
03:45
kaskal joined
04:15
lichtkind joined
04:18
lichtkind_ left
04:42
Aedil joined
05:14
ACfromTX left
05:26
guifa left
05:35
ShimmerFairy left
05:48
ACfromTX joined
06:01
itaipu left
06:06
ACfromTX is now known as atcroft
06:11
ShimmerFairy joined
06:21
itaipu joined
08:48
Sgeo left
11:07
lichtkind left
11:16
lichtkind joined
11:21
melezhik joined
|
|||
| lizmat | .landyacht. perhaps you want raku.land/zef:lizmat/Method::Protected ? | 11:36 | |
|
13:22
jgaz joined
14:00
melezhik left
14:04
guifa joined
15:34
Sgeo joined
|
|||
| disbot7 | <.landyacht.> Ohh, Method::Protected looks like an excellent solution, thanks! | 16:02 | |
|
16:19
sibl joined
16:31
sibl left,
donaldh left
16:56
sibl joined
17:03
sibl left
|
|||
| disbot7 | <.landyacht.> ah shoot, "Cannot apply 'is protected' to method 'put' in a role" | 17:25 | |
| <.landyacht.> looks like I'm just going to do it the manual way | |||
| timo | you may be able to put metamodel method calls into the role body to act upon the class it's being applied to | 17:35 | |
| i'm not sure if the right way to refer to the class being mixed into, it might be ::?CLASS perhaps | |||
| of course with calls to methods on the metaobject you can pretty much do anything you want, but of course it's easier to just put "monitor" instead of "class" and be done with it | 17:37 | ||
| oh, and you can implement your own trait_mod:<is> candidate, that could be easier than writing code into the role body? it very much depends, of course | 17:38 | ||
| lizmat | hmmm.... | 17:41 | |
| timo | i don't actually know what exactly you're trying to do though | ||
|
17:49
Aedil left
18:00
Aedil joined
18:13
Guest19 joined,
Guest19 left
|
|||
| Voldenet | btw, I tried to do (without generics) `has Foo @!keys[$cap];` and native arrays were extremely slow compared to simple arrays | 18:48 | |
| (in 0x0.st/PzjD.raku ) | |||
| theoretically native arrays could be faster but practically they aren't | 18:49 | ||
| timo | did you look in the profiler yet? | 18:50 | |
|
19:33
seric joined,
seric is now known as Guest3992
|
|||
| Voldenet | timo: Yes, and it appears that the version of AT-KEY with native arrays is not optimized at all (the code I've arrived at is 0x0.st/Picr.raku ) | 19:36 | |
| timo | that paste seems to not have native arrays in it? | 19:38 | |
| Voldenet | Uh I mean the `has Foo @!keys[$cap];` | 19:40 | |
| anyway, this is the most substantial difference imgur.com/3ExVqGG | |||
| I'd expect the fixed-length version to be faster (it's probably not called a native array) | 19:42 | ||
| (native array would be CArray[Foo], so I can't do that) | 19:46 | ||
| m: use NativeCall; class Foo { }; my CArray[Foo] $x | |||
| camelia | ===SORRY!=== Error while compiling <tmp> An exception X::AdHoc occurred while parameterizing CArray: A C array can only hold: (u)int8, (u)int16, (u)int32, (u)int64, (u)long, (u)longlong, num16, num32, (s)size_t, bool, Str and types with repres… |
||
| timo | huh it's not even hitting a speshed candidate | 19:54 | |
| i was about to ask how the code that assigns the values does but it's using at-key with a rw container | 19:56 | ||
| how do the different bodies of the loops `for nums() -> $p` fare? | |||
| and can you see something obvious in the deoptimization tab of the profiler? | 19:57 | ||
| Voldenet | global deoptimization of `mixin` in NQP::src/how/NQPClassHOW.nqp | 20:00 | |
| Ah, okay, it's because it's a role | |||
| replacing `class LinearHashMap does Associative {` with `role LinearHashMap does Associative {` gets me to the same level of slowness | 20:01 | ||
| timo | okay but that should only be a single global deoptimization once, right? | 20:03 | |
| Voldenet | Yes, it is | 20:04 | |
| this code does 14 local deoptimizations and 1 global, contains no roles, fixed-size arrays appear to be slower still 0x0.st/Picu.raku | 20:06 | ||
| timo | can you split the for loop over the three different implementations into three full copies of the code? | 20:13 | |
| Voldenet | the code gets prettier and prettier, but it's as slow | 20:24 | |
| this is it now, I doubt `for ^2` should have any impact on it: 0x0.st/Picp.raku | 20:25 | ||
| timo | thanks, it may make a big difference to have it in actually different frames from the perspective of spesh when it comes to what it inlines and what it can find a specialized candidate for, but on-stack-replacement should also work here for the innermost loops | 20:27 | |
| disbot7 | <jubilatious1_98524> @arun circling back to this. You can use a hash to substitute a dictionary of words with abbreviations, so why not a hash to replace a dictionary of letters with accented letters? unix.stackexchange.com/a/767403/227738 | 22:22 | |
| <jubilatious1_98524> @aruniecrisps ^ | 22:23 | ||
|
22:25
jgaz_ joined
22:26
jgaz left
|
|||
| disbot7 | <aruniecrisps> I just made a nomark function and just used that | 22:37 | |
| <jubilatious1_98524> @aruniecrisps copy. Do you have a gist I can look at? I'm interested. Thx! | 22:40 | ||
|
22:42
itaipu left
|
|||