Use of complete GList functionality? Change to GSList?

Derek Atkins warlord@MIT.EDU
17 Mar 2001 14:23:26 -0500


It turns out that there are few places where I can even send an engine
object wholesale.  So it turns out that in most cases I do have to
copy lists.  For example, I can send _most_ of the query terms without
modification.  However I do have modify the Account type, which means
I have to rebuild the whole Query Terms list-of-lists anyways.

Similary, Accounts, Transactions, and Splits are sufficiently
"different" that I wind up building my own lists as well.  Even kvp
frames must be rebuilt.

So, in the end, I do wind up copying, strdup'ing, etc. most data.

-derek

PS: Thanks for reminding me; I need to make sure I don't have a memory
leak in transmitting Queries.

Rob Browning <rlb@cs.utexas.edu> writes:

> Derek Atkins <warlord@MIT.EDU> writes:
> 
> > I'm trying to make the structures look as similar as possible, but
> > in the end I don't think I'll be able to avoid this.  I suppose I'm
> > already going to have to do this anyways, but there are some places
> > where it would be nice to not have to do the duplication on _both_
> > sides.
> 
> While I sympathize with your desire to avoid redundant work, I also
> agree with Dave that in the end, just using the engine to build the
> data structures you need on the relevant end is probably going to be a
> win in the long run.
> 
> I could be wrong, but I suspect that the extra alloc/copy time that
> you might go to some lengths to try and avoid will be dwarfed in
> general by transmission times and other engine/computation/didplay
> related operations.
> 
> Don't get me wrong, I'm all in favor of making things efficient when
> possible, but I as a general rule, I think maybe we'd best optimize
> where it helps most and keep other things as straightforward and easy
> to maintain as possible (though I'm not claiming that I always follow
> my own advice :>).
> 
> -- 
> Rob Browning <rlb@cs.utexas.edu> PGP=E80E0D04F521A094 532B97F5D64E3930

-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord@MIT.EDU                        PGP key available