r10084: where we might reduce heap usage
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
3 posts
• Page 1 of 1
r10084: where we might reduce heap usage
by Braids » 27 Jun 2011, 01:27
in this commit, i simply marked some places where we can likely improve speed and reduce temporary heap usage. affected scenarios are
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.
- 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.
"That is the dumbest thing I've ever seen." --Rob Cashwalker, regarding Innistrad double-sided cards. One of the first times he and I have ever agreed on something. 

-
Braids - Programmer
- Posts: 556
- Joined: 22 Jun 2011, 00:39
- Location: Unknown. Hobby: Driving myself and others to constructive madness.
- Has thanked: 1 time
- Been thanked: 1 time
Re: r10084: where we might reduce heap usage
by Rob Cashwalker » 27 Jun 2011, 23:08
In reference to the comments in BoosterGenerator, What's the advantage of the for-each vs for(i)-get(i)?
The Force will be with you, Always.
-
Rob Cashwalker - Programmer
- Posts: 2167
- Joined: 09 Sep 2008, 15:09
- Location: New York
- Has thanked: 5 times
- Been thanked: 40 times
Re: r10084: where we might reduce heap usage
by Braids » 28 Jun 2011, 00:25
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.
"That is the dumbest thing I've ever seen." --Rob Cashwalker, regarding Innistrad double-sided cards. One of the first times he and I have ever agreed on something. 

-
Braids - Programmer
- Posts: 556
- Joined: 22 Jun 2011, 00:39
- Location: Unknown. Hobby: Driving myself and others to constructive madness.
- Has thanked: 1 time
- Been thanked: 1 time
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 53 guests