Page 1 of 1

app launch optimization(?)

Posted: Tue Sep 28, 2010 10:53 am
by MootPoint
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...

Re: app launch optimization(?)

Posted: Tue Sep 28, 2010 5:01 pm
by MootPoint
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

Re: app launch optimization(?)

Posted: Wed Sep 29, 2010 12:29 am
by wololo
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

Re: app launch optimization(?)

Posted: Wed Sep 29, 2010 5:55 am
by mnguyen
I've applied the optimization to the other parts of the app and things seem a little snappier all around.