On Apr 10, 2007, at 16:45 UTC, Hector Schisa wrote:

> I've always assumed that crunching through specific data will be  
> faster if one uses the individual arrays for each field, while it is 
> more convenient (programing wise) to use an object class.  Speed for 
> the user has usually won out for me, so I've usually chosen the  
> separate array approach.  Is my assumption about speed wrong?

Yes, quite likely.  It depends on the details of what you're doing, and
any speed difference will almost certainly be so small as to be
immeasurable anyway -- but if you do any reordering of the data, for
example, then the array of objects will be faster (maybe even
noticeably faster).

In general, I recommend you do NOT make coding decisions this way. 
Your intuition about what will be faster or slower is very often wrong,
even if you're an experienced software engineer.  So choose the
approach that makes the code clearest and shortest, and easiest to
maintain.  Then, only *after profiling* your code, refactor if needed
for performance.

Best,
- Joe

--
Joe Strout -- [EMAIL PROTECTED]
Verified Express, LLC     "Making the Internet a Better Place"
http://www.verex.com/

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to