Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Needs DOOM demo #78

Open
vonj opened this issue Mar 5, 2023 · 6 comments
Open

Needs DOOM demo #78

vonj opened this issue Mar 5, 2023 · 6 comments
Labels
not a bug Issue is resolved somewhere else

Comments

@vonj
Copy link

vonj commented Mar 5, 2023

I'm not even half kidding. :-)

@LekKit
Copy link
Owner

LekKit commented Mar 5, 2023

See https://lekkit.github.io/test/index.html and type doom X)

Although, that WASM demo doesn't have a JIT, and overall is disgustingly slow, so 'ere are the firmware/kernel/drive images to replicate that setup locally on a proper JITed native VM - please report if anything
rvvm fw_jump.bin -k linux_6.1 -i rootfs.ext2
rvvm_demo.zip

And if you wanna a GIF or something in a repository, then ugh... I considered it, but it would slow down page load times and overall I have a lot of better things to show off (Minecraft in RVVM? Plasma in RVVM?), but maybe you would have a better idea)

image

image

@LekKit
Copy link
Owner

LekKit commented Mar 5, 2023

Also this 👀, although the mod has stagnated sinсe february 2022 for... well you might have an idea why

2022-04-24.06-21-07.mp4

@LekKit
Copy link
Owner

LekKit commented Mar 12, 2023

Any update?)

@LekKit LekKit added the not a bug Issue is resolved somewhere else label Mar 25, 2023
@avanspector
Copy link

avanspector commented Apr 2, 2023

Tried on win11, no tweaking with -smp and -jitcache helps affecting doom performance, any reason why? what can be a bottleneck?

@LekKit
Copy link
Owner

LekKit commented Apr 4, 2023

Tried on win11, no tweaking with -smp and -jitcache helps affecting doom performance, any reason why? what can be a bottleneck?

Option -jitcache sets an upper bound on JIT cache size to prevent excess peak memory usage. When it reaches that point it has to drop some of the recompiled code, and if your working set doesn't fit in JIT cache it will trash and interpret-trace over the same code frequently.
There are efforts to determine optimal JIT cache size at runtime and scale it dynamically. For now if you don't have strict memory limits, just raise it. QEMU for comparison sets upper JIT cache bound to 1G and calls it a day X).

It should be noted some performance tuning might be possible for Windows. I haven't done extensive profiling there.
See src/vma_ops.c for platform-specific code which is frequently used from JIT, if you're interested.

JIT also frequently calls vma_clean() over dirty but unused memory to return it to OS untill it writes there again. Previosly there was a bottleneck, setting JIT cache size too high caused a stall in vma_clean() on Linux, so I used a different API.

@LekKit
Copy link
Owner

LekKit commented Apr 4, 2023

Tried setting -jitcache 64M, -jitcache 16M, -jitcache 4M, -jitcache 1M with that Doom demo - no perf/CPU usage difference on a Linux host. CPU use is at ~10% of one core, smooth as butter. Below 1M it starts stuttering, understandably so.

Win32-specific code might need profiling, will look at it soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not a bug Issue is resolved somewhere else
Projects
None yet
Development

No branches or pull requests

3 participants