It is currently 11 Sep 2025, 20:42
   
Text Size

r10084: where we might reduce heap usage

Post MTG Forge Related Programming Questions Here

Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins

r10084: where we might reduce heap usage

Postby 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
  • 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. ;)
User avatar
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

Postby 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.
User avatar
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

Postby 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. ;)
User avatar
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


Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 53 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 53 users online :: 0 registered, 0 hidden and 53 guests (based on users active over the past 10 minutes)
Most users ever online was 7967 on 09 Sep 2025, 23:08

Users browsing this forum: No registered users and 53 guests

Login Form