[android-beginners] Re: Poor performance on my file loader (code optimization help!)

2009-09-21 Thread fadden
On Sep 20, 11:28 am, Glen Kimsey wrote: > The loading process on a sample (1000+ line) file is abysmally slow > (more than 4 minutes). [...] > > Some possible causes for the slowness: > - Extensive use of parseFloat() > - Creating new StringTokenizer for every line > - Inefficiencies in for() loo

[android-beginners] Re: Poor performance on my file loader (code optimization help!)

2009-09-22 Thread a1
On 20 Wrz, 20:28, Glen Kimsey wrote: > Hello! > I'm fairly new to both Android and Java (pretty experienced in C/C++), > and (stupidly, perhaps) took on a big project.  In it, I need to load > information about 3D models and their respective animations from a > text file (proprietary file forma

[android-beginners] Re: Poor performance on my file loader (code optimization help!)

2009-09-23 Thread Glen Kimsey
Thanks for the reply. I think your suggestion of going binary is one of the better ones I had considered. Especially because I can avoid the parseFloat() calls altogether using this method. As for the quaternion vs axis/angle, I had thought I HAD to translate them originally (I found out later

[android-beginners] Re: Poor performance on my file loader (code optimization help!)

2009-09-23 Thread Glen Kimsey
Fadden, Sorry, I missed your reply when I responded to Bart! I tried to find significant ways that I could avoid allocation, but the StringTokenizer is the main thing that I'm calling 'new' on and I didn't see any way to avoid doing that for every line. Your suggestion of using regexs for a par

[android-beginners] Re: Poor performance on my file loader (code optimization help!)

2009-09-23 Thread fadden
On Sep 23, 8:49 am, Glen Kimsey wrote: > I tried to find significant ways that I could avoid allocation, but > the StringTokenizer is the main thing that I'm calling 'new' on and I > didn't see any way to avoid doing that for every line.  Your > suggestion of using regexs for a parser kind of thr

[android-beginners] Re: Poor performance on my file loader (code optimization help!)

2009-09-23 Thread a1
Hi, > As for the quaternion vs axis/angle, I had thought I HAD to translate > them originally (I found out later with more research that I just had > to use the more complicated matrix math rather than simple glrotate > and gltranslate calls if I didn't).  I don't suppose you could direct > me to

[android-beginners] Re: Poor performance on my file loader (code optimization help!)

2009-09-24 Thread Kaj Bjurman
Is there a reason to why you use a LineNumberReader? I would instead use a BufferedReader, that will probably improve your performance. I don't know anything about the dataformat in the file, but there probably is a much faster way to parse it than using all those StringTokenizers (or regexp even

[android-beginners] Re: Poor performance on my file loader (code optimization help!)

2009-09-29 Thread Glen Kimsey
Thanks to everyone for the help on this. As I mentioned, I'm rather new to Java, so things like StringTokenizer being legacy are news. Believe it or not the file format uses actual frames instead of keyframes (hence no timestamp or other indication of time or frames between each being parsed out)