app launch optimization(?)

All code submission.
Post Reply
MootPoint
Posts: 58
Joined: Fri Sep 24, 2010 7:44 am

app launch optimization(?)

Post by MootPoint » Tue Sep 28, 2010 10:53 am

Instead of relying on getline on an ifstream, read the entire stream into memory first.

Attempt based on this info found by mnguyen:

http://www.cygwin.com/ml/cygwin/2003-06/msg01229.html

Haven't stopwatched it yet on the psp, will post the results shortly...
Attachments

[The extension zip has been deactivated and can no longer be displayed.]


MootPoint
Posts: 58
Joined: Fri Sep 24, 2010 7:44 am

Re: app launch optimization(?)

Post by MootPoint » Tue Sep 28, 2010 5:01 pm

So, just to report back, this shaved approx 3-4 seconds during the card loading on my psp. I'll probably look around to see if there's other instances where we can apply the same optimization.

Cheers

wololo
Site Admin
Posts: 3727
Joined: Wed Oct 15, 2008 12:42 am
Location: Japan

Re: app launch optimization(?)

Post by wololo » Wed Sep 29, 2010 12:29 am

I was expecting a huge change in the code, which is definitely not the case. This is actually what I wanted to do from the beginning, and how I expected getLine would work (I was foolishly thinking it was actually reading a good part of the file internally then handling it correctly through getline).
Will test this tonight, if it works correctly on my tests, this goes into the release.

Thanks!

Note: historically I was using C and a huge char* buffer for reading the card files. When I switched to getLine I was disappointed by the speed...probably because I did it incorrectly

mnguyen
Posts: 229
Joined: Thu Apr 29, 2010 4:13 pm

Re: app launch optimization(?)

Post by mnguyen » Wed Sep 29, 2010 5:55 am

I've applied the optimization to the other parts of the app and things seem a little snappier all around.

Post Reply