Re: Object overhead [message #26744 is a reply to message #26740] |
Mon, 24 September 2001 08:32   |
Pavel A. Romashkin
Messages: 531 Registered: November 2000
|
Senior Member |
|
|
Thanks, Craig!
This kind of helps. Kind of, because you confirm that objects will then
always have a limitation: if you have repetitive data that would benefit
from objectifying, think twice if you are going to have a lot of them,
or you will slow down to a crawl. However, for small numbers, the
convenience of objects can't be beat.
Thanks again,
Pavel
P.S. When I say "a lot of them", I think it depends on what you are
running on. For my G4, I notice a difference when the number of data
objects reaches 5k. And I hoped to be able to convert over 100k... I
think I can come up with a way to use objects for processing but store
and save data as simple arrays.
Craig Markwardt wrote:
>
> Hi Pavel--
>
> Since I've mucked around with the format of save files, and in fact
> made a library to manipulate them, I think I can try to answer your
> questions.
>
> Saving a FLTARR() is fast because IDL can simply write out a block of
> floating point numbers in one operation. [ after converting to
> standard endian-ness, of course ]
>
> Saving a PTRARR() is slower, because IDL must scan through the entire
> array looking for non-null pointers. You actually gave an example
> that was too trivial. If you tried populating your PTRARR(1000) with
> values, you will find that the save file becomes much larger and take
> much longer to create. That's because IDL must save each heap
> variable separately. This is invisible to you, but it happens.
>
> Finally, an array of objects is more complicated still. Objects are
> really structures. Since structures are more or less infinitely
> flexible, much more complicated programming is used to save them, and
> there is extra metadata information related to structures, that must
> also be saved.
>
> Vector support for structures and pointers has never been as strong as
> for simple data types, and this shows in how they are save as well.
>
> Hope this helps!
> Craig
>
> --
> ------------------------------------------------------------ --------------
> Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
> Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
> ------------------------------------------------------------ --------------
|
|
|