Page 1 of 1

r10084: where we might reduce heap usage

PostPosted: 27 Jun 2011, 01:27
by Braids
in this commit, i simply marked some places where we can likely improve speed and reduce temporary heap usage. affected scenarios are
  • limited formats
  • randomly generated decks
  • deck editors
  • card shop
  • downloading pictures

to see the suggestions, visit http://code.google.com/p/cardforge/source/detail?r=10084# and expand all.

i will not be enacting these changes myself; i am hoping someone else will want to try them and test. most involve just changing a method call.

please post here if you have questions or comments about these proposed changes.

Re: r10084: where we might reduce heap usage

PostPosted: 27 Jun 2011, 23:08
by Rob Cashwalker
In reference to the comments in BoosterGenerator, What's the advantage of the for-each vs for(i)-get(i)?

Re: r10084: where we might reduce heap usage

PostPosted: 28 Jun 2011, 00:25
by Braids
if the list's internal representation changes, for-each has a greater chance of constant time performance. get does not. why is that important? one way to reduce forge's heap requirements is to use Python style generators. such generators support iteration, but not indexing.