github.com/moarvm/moarvm | IRC logs at colabti.org/irclogger/irclogger_logs/moarvm
Set by AlexDaniel on 12 June 2018.
timotimo well, could be that it was not attempted to be jitted for invocation-related reasons, somehow 00:24
MasterDuke timotimo: what would that look like? btw, the spesh log say things like `JIT was successful and compilation took 160us` for that method 00:30
timotimo could still be a different candidate was called that didn't get jitted 00:31
MasterDuke all the the entries for it in the log say jit was successful 00:33
timotimo stumps me, sorry. it doesn't help that we can't really single-step in the jitted code 00:34
we can, however, breakpoint MVM_frame_invoke or whatever
MasterDuke i gotta get to bed. but if you're interested, the code is 'use Math::Sequences::Integer; say @A000793[^40]' with github.com/ajs/perl6-Math-Sequences/pull/151 applied
timotimo with a conditional breakpoint that checks the name and cuuid or something
is it extra slow? 00:35
MasterDuke it's 3s with that PR
timotimo i would recommend trying to assign the LHS of the range to a variable first
an int-typed variable perhaps
we do have some code nowadays to handle ranges with more "dynamic" endpoints
oh, wait 00:36
that's a ... not a ..
we don't optimize those yet
and i'm not sure if our for loop optimization handles 1..10 .reverse or something
MasterDuke we do for literals
i.e., 4...1 is re-written into a while
timotimo cool, i did not know that 00:37
MasterDuke pretty sure lizmat did that a little while ago
timotimo perhaps the problem is that it can't tell whether it has to generate an upwards counting loop or a downwards counting loop until run time
MasterDuke so for none of the other variants of looping i've tried have been faster 00:46
timotimo can you also give replacing given/when with if/elsif a try? 00:47
also, if the moebius sub takes a good chunk of time, i wonder if .elems == 1 as a fast path for skipping .max would be a good idea 00:48
MasterDuke don't know if that one's slow 00:49
timotimo anyway, an optimization for `for a..b .reverse` would be cool 00:52
MasterDuke if/elsif seems pretty much the same
timotimo wow, ok
MasterDuke i thought lizmat did do that, but what i tried was a little slower
00:52 pamplemousse joined
MasterDuke m: my $a = (900000..1000000).pick; my $b = (900000..1000000).pick; my $c; my int $m = min($a, $b); for (^$m).reverse { $c++ }; say $c; say now - INIT now 00:54
camelia 929328
0.1016843
MasterDuke m: my $a = (900000..1000000).pick; my $b = (900000..1000000).pick; my $c; my int $m = min($a, $b); for ^$m { $c++ }; say $c; say now - INIT now
camelia 939398
0.1786489
timotimo you could srand that to get the same value every time 00:55
MasterDuke hm. i definitely see a difference locally
timotimo i gotta go to bed, too
MasterDuke m: srand 1; my $a = (9000000..10000000).pick; my $b = (9000000..10000000).pick; my $c; my int $m = min($a, $b); for ^$m { $c++ }; say $c; say now - INIT now
camelia 9287579
1.64770848
MasterDuke m: srand 1; my $a = (9000000..10000000).pick; my $b = (9000000..10000000).pick; my $c; my int $m = min($a, $b); for (^$m).reverse { $c++ }; say $c; say now - INIT now 00:56
camelia 9287579
5.59486992
timotimo could camelia be a bit noisy at the moment?
MasterDuke m: srand 1; my $a = (9000000..10000000).pick; my $b = (9000000..10000000).pick; my $c; my int $m = min($a, $b); for (^$m).reverse { $c++ }; say $c; say now - INIT now
camelia 9287579
5.5375774
MasterDuke locally i see .reverse pretty much twice as slow 00:57
timotimo mhm
MasterDuke but yeah, time to sleep 00:58
timotimo good night!
MasterDuke later...
timotimo good ā™˜ 00:59
02:52 pamplemousse left 04:54 tbrowder left, tbrowder joined 06:03 squashable6 left 06:08 squashable6 joined 06:10 squashable6 left 06:13 squashable6 joined 06:39 patrickb joined 06:57 robertle_ joined 07:02 domidumont joined 08:04 zakharyas joined 08:29 sena_kun joined
sena_kun 08:30
nwc10 good *, sena_kun 08:33
sena_kun nwc10, o/ # ww, sorry. 08:34
08:37 domidumont left 08:43 domidumont joined 08:58 domidumont1 joined 09:01 domidumont left 10:04 sena_kun left 10:14 domidumont joined 10:16 domidumont1 left 10:18 domidumont left 10:20 Voldenet left 10:22 AlexDaniel left, AlexDaniel joined 10:25 Voldenet joined, Voldenet left, Voldenet joined 11:22 zakharyas left
timotimo o/ 12:02
Kaiepi is only one thread guaranteed to be able to access a specific thread context at any given time? 12:15
timotimo well, the debugserver accesses other thread's stuff, but first it always suspends them 12:19
lizmat we haz the tools to suspend a thread ???
timotimo and when you're iterating threads, you have to hold a lock, so that threads don't spawn or die while you're going through
jnthn lizmat: Well, the MoarVM debug protocol offers it for implementing the pause program facility, the JVM debug protocl offers the same... 12:23
Kaiepi the reason i ask is i keep an mbstate_t var in the thread context that's used for wide string transcoding, but if there's some sort of race condition where something tries to use it to transcode a string while it's in the middle of transcoding another string, its behaviour will be undefined
jnthn ThreadContext is per-thread, thus the name
We have various kinds of caches in there, but the one you ask about feels like it's local enough not to put it there? 12:24
Kaiepi i could make it a static variable in src/strings/wide.c 12:30
jnthn Why not just declare it on the stack?
static variable will be a disaster threading wise
We avoid them generally since in theory you can have multiple MoarVM instances in one process
Kaiepi i think i'm trying to prematurely optimize 12:31
just declaring it on the stack would avoid my concerns about it being thread safe anyways 12:32
12:34 domidumont joined
Kaiepi ok i have one more question before i'm done with working on wide string support, since i'll end up doing too much at once if i keep going with u16string and u32string support as well 12:53
should i refactor this so it uses different static inline functions to transcode depending on whether _MSC_VER is defined instead of doing it like this? github.com/MoarVM/MoarVM/blob/99ff...ngs/wide.c 12:54
12:59 lizmat_ joined, leedo left 13:00 evalable6 left, notable6 left, statisfiable6 left 13:01 lizmat left 13:02 leedo joined 13:03 domidumont1 joined 13:05 AlexDaniel left, AlexDaniel joined 13:06 domidumont left 13:13 pamplemousse joined, zakharyas joined 13:19 lizmat_ is now known as lizmat 13:33 lucasb joined 13:59 evalable6 joined 14:01 notable6 joined 14:02 statisfiable6 joined 14:23 domidumont joined 14:25 domidumont1 left 14:41 pamplemousse left 14:59 domidumont left, domidumont joined 15:13 domidumont left 15:14 patrickb left 15:21 robertle_ left 15:43 zakharyas left 17:07 pamplemousse joined
samcv jnthn, multiple instances per process? 17:16
timotimo oh yeah 17:17
just create more than one MVMInstance
everything except the unicode db is attached to non-globals
samcv what would be the reason for that? 17:19
timotimo *shrug*
jnthn In theory, it'd be one way to run things in a more sandboxed way within a process 17:23
Though only sandboxed in the sense of "can't possibly touch the other program's objects"
samcv ah i see 17:27
lizmat fg 17:29
oops, ww
Kaiepi nqp::fork creates another instance right? 17:38
or does it call fork 17:39
timotimo we hvae that?
ah, we do
jnthn Yes, but you can only do it if you've not created any threads. :)
timotimo and if MVM_platform_supports_fork 17:40
jnthn That also
timotimo we are *not* implementing fork on windows ourselves
jnthn And yes, it calls fork()
18:18 sena_kun joined 18:51 sena_kun left, sena_kun joined 19:56 sena_kun left
pamplemousse I was wondering if/how MoarVM handles the need to create temporary files? I'm needing to for the linker and want to make sure I'm doing it in a consistent way. 20:18
timotimo i don't think moarvm does anything in that direction yet 20:19
for example, the unicode database downloader script just leaves the downloaded files where they were instead of deleting them 20:20
pamplemousse Alright, figured I'd ask. Thanks, timotimo! 20:22
samcv pamplemousse, what are the temporary files for? 20:23
pamplemousse samcv: I've modified perl6 to be able to run a MBC file, so I'm making the ELF file I'm generating write the MBC that it contains to a temp file, call perl6, and delete the file. I'm hoping to come up with a more graceful solution for handing perl6 the bytecode a bit further down the line, but want to get a POC working. 20:28
samcv that sounds like a good plan to me. best of luck 20:37
pamplemousse Wrote an update on getting perl6 to run MBC: yakshavingcream.blogspot.com/2019/...o-run.html 21:26
MasterDuke pamplemousse++ 21:36
21:50 pamplemousse left 23:24 patrickb joined 23:25 patrickz joined 23:29 patrickb left 23:50 Kaiepi left, Kaiepi joined 23:57 lucasb left