-
Notifications
You must be signed in to change notification settings - Fork 8
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
GXR and beebjit #40
Comments
Try writing PLOT 69 pixels in graphics mode (i.e. non GXR graphics, but is still accessing the ROM) in the loop |
OK, I can see the problem now - 7.872 vs 1626.078 seconds:
|
Talking to @scarybeasts we need to benchmark a few other modes with GXR |
With a newer beebjit the performance is much better:
So it's now actually faster than non-rocket mode - presumably running slowly for 30 seconds now takes longer than running fast for 3 hours! |
I don't see the GXR rom loaded in the most recent example. It doesn't have a flag like: |
D'oh! Of course in the original test I must have patched the bot. Trying again with a patch to use the GXR in rocket mode it's still slow unfortunately:
It actually seems slower than before. Shame, I was hoping the dynamic opcode changes I noticed in the beebjit history had solved this. These latest tests are with beebjit commit 9fcaa1096857e919f6872856c7bbc77f38e77027 plus a cherry-pick of c00f1b736582beb8362dfd5e5ecc33e192ab3040 to fix a GCC12 warning that's an error due to use of |
The JIT is slow with the GXR ROM because its presence causes MOS to page the BASIC <-> GXR ROMs excessively. ROM paging is very slow with the JIT because all the compiled JIT code in the ROM region must be carefully invalidated. JIT + GXR isn't likely to get much faster in the forseeable future. -mode inturbo may be the best bet. |
OK - I was vaguely assuming it was some evil generated and/or self-modifying code, but the cause being ROM paging makes rather more sense as we see things which don't actually use GXR features run much more slowly too. I suppose it'd be hard to have a separate JIT version of &8000-&BFFF for each ROM image and swap in which is live when the paged ROM is changed? I'll try some tests with Since I'd already started the test with latest git running, here's the result (essentially no significant change):
|
With
That's with latest beebjit git. A test which actually uses GXR features (
Maybe we want to make GXR opt-in (e.g. 🎨 emoji selects it)? GXR imposes an annoyingly high speed overhead inside the emulation too, even for code that doesn't use any of its features, due to its interception of the VDU vector. You can unhook that with e.g. |
Yeah, I've thought about having a separate JIT space for each ROM, and paging that around. I've stayed away because I'm wary of adding the extra complexity for a not-so-common use case. |
I like the idea of unhooking the VDU / other vectors, so that standard drawing commands would be fast. Could the GXR bot mode be defined so that you have to explicitly call the extended drawing routines -- is that possible? |
We could unhook the GXR from VDUV by default by poking bytes via I think the cleaner approach to this would be for the bot not to load the GXR ROM by default, with an emoji to enable it which you could include with your program if you want to use the GXR (similar to how the rocket emoji enables taking a snapshot after 3 hours). Then the default bot is like using a BBC model B without the GXR (which was probably a much more common configuration of actual BBC model B machines). This would also mean more RAM to easily use from BASIC by default, since the GXR raises page by 768 bytes. This approach seems more in line with running on real hardware - the emoji just selects which real hardware you're picking to use. Then in combination with the rocket emoji this could load the GXR and select Owlet could smooth the experience of working with this - click a button to enable the GXR in owlet when testing, and then owlet would know to include the emoji when you share the program. |
Currently we disable the GXR in Rocket mode (and the other long running modes) because apparently it makes things slow with beebjit. I tried it to see, but it seems to not affect the speed for me (here I patched in a different rocket emoji to run beebjit with the GXR loaded - compare the beebjit command lines in the log messages):
Perhaps this got resolved in beebjit? Or does it only affect certain cases?
The text was updated successfully, but these errors were encountered: