!yxFWYdmeLrdzdoIrcE:maralorn.de

nix-output-monitor

99 Members
https://github.com/maralorn/nix-output-monitor32 Servers

Load older messages


SenderMessageTime
22 Nov 2024
@picnoir:alternativebit.frPicnoirWorst case scenario, if I don't manage to understand how this thing works, I can rewrite this part memoization part in a more dumb-dumb explicit way.20:41:30
@picnoir:alternativebit.frPicnoirOr let you write this part :P20:42:09
@maralorn:maralorn.demaralornYeah, I am sure we can do it together.20:42:30
@maralorn:maralorn.demaralorn
In reply to @maralorn:maralorn.de
In my mind memo basically converts "a -> b" into something like "Map a b" where the b part is lazy and all possible keys a are in the map, so that lookup again has the signature a -> b.
This would be relatively easy to write down if it weren’t for the fact that Map a b is spine strict so all a actually exist in memory. That’s why that lib has another Map a b like datastructure which tries to force as little keys as possible on lookup.
20:44:46
@maralorn:maralorn.demaralornAt least that’s my understanding.20:45:07
@picnoir:alternativebit.frPicnoirAlright, doesn't seem so hard in the end.21:03:05
@picnoir:alternativebit.frPicnoirDo you have a way to test that?21:03:09
@picnoir:alternativebit.frPicnoirReworked the stdin buffering set/release.21:03:29
@picnoir:alternativebit.frPicnoirI might not have as much computer time as I originally planned this weekend in the end. But that's no a big deal, I'll have pleinty spare time next week :) 👋21:04:12
@maralorn:maralorn.demaralorn
In reply to @picnoir:alternativebit.fr
Do you have a way to test that?
I have one benchmark and we can see if it got worse, but it is not super automated.
21:05:52
24 Nov 2024
@weethet:catgirl.cloudWeetHet joined the room.11:46:15
25 Nov 2024
@nullcube:matrix.org@nullcube:matrix.org joined the room.10:04:53
@luxus:beeper.comluxus joined the room.18:06:43
26 Nov 2024
@picnoir:alternativebit.frPicnoir Ok, I spent a little bit more time digging into this memoization issue yesterday. I sadly still don't understand how we're bursting it. The print state TMVar is not updated unless we had a user interaction, in which case it'd mean we do have to compute writeStateToScreen again. 08:48:30
@picnoir:alternativebit.frPicnoirI'm maybe missing the point.08:48:44
@picnoir:alternativebit.frPicnoir We already have the whole STM machinery, I think we could rewrite this memoization mechanism explicitely using STM values. We could be racing two async threads waiting for some nix/user interaction and recomputing writeStateToScreen only after we got something new to compute. 08:50:43
@picnoir:alternativebit.frPicnoirIt'd probably make things easier to grasp for people like me.08:50:58
@picnoir:alternativebit.frPicnoir * We already have the whole STM machinery, I think we could rewrite this memoization mechanism explicitely using STM values. We could be racing two async threads waiting for some nix/user interaction and recomputing writeStateToScreen only after we got something new to compute. It'd probablly make it harder to screw up the memoization by accident. 08:52:45
27 Nov 2024
@thedragon44:matrix.org@thedragon44:matrix.org left the room.23:33:11
1 Dec 2024
@shawn8901:matrix.orgshawn8901 joined the room.00:10:56
@maralorn:maralorn.demaralorn Picnoir: Sorry for not coming back to you earlier on this. 21:26:48
@maralorn:maralorn.demaralornMy idea was this: writeStateToScreen does get called at least once per second with a new time stamp.21:28:19
@maralorn:maralorn.demaralornAnd I want minimal recomputation when that happens.21:29:29
@maralorn:maralorn.demaralornThat being said: If we cache the application of stateToText to the printState we should be fine.21:33:17
@maralorn:maralorn.demaralornAlthough this could also just be a premature optmisation because it basically only kicks in once per second, which is probably not at all the hot loop …21:45:00
4 Dec 2024
@picnoir:alternativebit.frPicnoirYeah, builds are usually printing quite often anyways.09:31:40
@picnoir:alternativebit.frPicnoir This PR start to scope creep on my end, started a refactoring to clear a bit writeStateToScreen and have a single tmvar blocking the printer until something new to print appears. 09:32:23
@picnoir:alternativebit.frPicnoirLet's remove this refactoring from this PR and get this merged first.09:32:36
@picnoir:alternativebit.frPicnoirI'll make a quick hyperfine bench run to make sure I'm not breaking perf too much.09:34:38
@picnoir:alternativebit.frPicnoir
In reply to @picnoir:alternativebit.fr
Let's remove this refactoring from this PR and get this merged first.
(I'll keep a few variables remame in the end, I don't think it'll add too much review burden)
09:35:10

Show newer messages


Back to Room ListRoom Version: 9