Author
|
Topic: Sony PSP port? (Read 63061 times)
|
jimparis
Zebranky food
Offline
Posts: 16
|
Not true. UQM reads the central directory at startup, and it will never need to read it again.
OK, I was almost certain I had been seeing tons of back-and-forth calls to stdio_seek, but perhaps I'm misremembering. I'll have to look at that again when I get time; I no longer have any of my logs.
Reading in short blocks however sounds like a good reason. If the OS doesn't read in pages at a time, each read would mean a new request. As far as I am aware the OS does no buffering, so yeah, it would have to be a new request each time.
Do you have an URL to those benchmarks? 64k sounds like rather a lot to me btw. Sure, try this. I believe this particular test was over the USB interface, but I was told that we get similar results with code on the PSP. I should probably test it for myself rather than just trust them I suppose.
Do you have console output? Is the delay right at the start or is it spread over all files? I think it was spread all over. For example: selecting my next ship in Super Melee would take 5-10 seconds to load. I do have a console and can attach gdb to the process, although that's over a serial link and slows things down quite a bit itself.
While there shouldn't be any short (low level) reads for reading files, there are quite a lot of them when the zip file is mounted, when the central directory is read in. I actually have a todo remark somewhere to add read-ahead buffering. I'll see if I can do that somewhere in the next few days. It shouldn't take much time. OK, that would be interesting to try out, but take your time, I'm quite busy myself for the next few weeks
Does the PSP have memory mapped IO btw? In that case there would be room for even more optimisation. Nope, there's only a rudimentary hardware MMU that appears to have fixed mappings.
|
|
|
Logged
|
|
|
|
|
cooleyandy
Zebranky food
Offline
Posts: 10
|
I'm not sure if the latest pspsdk has faster stdio operations but I did get a 2-3x speed increase when switching to the sceXXX file io functions a while ago when linking newlibc. Perhaps we can replace the sc2 with those instead for some loading speedup.
|
|
|
Logged
|
|
|
|
|
cooleyandy
Zebranky food
Offline
Posts: 10
|
Ah okay, that makes sense.
In a related note, I was waiting at the loading screen for about a minute and during that minute I had a thought. Since the initial loading is pretty much the same every single time, how about we have a binary file that is a byte copied version of all the loaded items. With a struct and one fread, we can get everything in a couple seconds. Having a max 20meg file doesn't sound too bad to be able to bypass all the loading. Perhaps it could be generated after the first run.
As a side note, I've played around the uio_Stream_BLOCK_SIZE define and the difference is pretty much unnoticible.
|
|
« Last Edit: January 03, 2006, 07:00:11 pm by cooleyandy »
|
Logged
|
|
|
|
|
jimparis
Zebranky food
Offline
Posts: 16
|
I ran a quick benchmark just to verify what we thought. I create a 4 KB file, then lseek to sequential offsets within it and read 32 bytes each time. It's measuring how many lseek/read pairs it can do per second. On my PC it's easily 1,200,000, while the PSP does 3,000. On a PC, just starting UQM causes at least 20,000 lseeks/reads within the content zip by the time the title screen loads.
|
|
|
Logged
|
|
|
|
|
jimparis
Zebranky food
Offline
Posts: 16
|
If I take out the seeks it's closer to 5,000 reads/sec on the PSP.
About the RAM usage, I ran UQM under valgrid's "massif" tool on Linux. The PDF here shows memory usage versus time. I started a new game at around 50 seconds, visited a planet at 90 seconds, and left about 10 seconds later without scanning or landing.
|
|
|
Logged
|
|
|
|
|
|
|
|
cooleyandy
Zebranky food
Offline
Posts: 10
|
Here's to report recent successes. With the latest uqm snapshot and Jimparis' patches, the planet orbiting part works great now. Now most of the parts are functional now. All we need to do now is to fix the super melee stabiliy issue and we'll have a nice PSP port :-)
|
|
|
Logged
|
|
|
|
|
|