I have a supplementary question to a previous question about reading data.
My question is: what is the most efficient way to read in large arrays of
numbers? (such as a very big IndexedFaceSet)
I think its relevant to this list because the loading time is proving a
limitation on the size of mesh that I can use. I'd appreciate any help in
speeding up the loading of my program at www.martinb.com
I get the impression that the most 'architecturally sound' way to do
formatted I/O is to use the java.text package. But that's no good because
its hopelessly inefficient and does not support exponential floating point
numbers. (Are the java.text programmers aware of the needs of Java3D ? is it
on their wish list?)
So I tend to read the file one line at a time, use StringTokenizer to split
it up, then convert to a double floating point number using something like:
value = (new Double(s)).doubleValue();
But this is very slow because it does a memory allocation for every number
read, so when I read in a big IFS the program slows down and starts garbage
collecting and I have to wait ages for it to load.
Would anyone like to suggest the fastest code to load and array of floating
point numbers, which does not allocate memory inside the loop, or use
deprecated classes.
Martin
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".