Changeset 2427
- Timestamp:
- Mar 11, 2010 10:06:30 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
coopr.pysp/trunk/coopr/pysp/ef.py
r2418 r2427 5 5 import traceback 6 6 import copy 7 import gc 7 8 8 9 from coopr.pysp.scenariotree import * … … 575 576 # construct instances for each scenario 576 577 # 578 579 # the construction of instances takes little overhead in terms of 580 # memory potentially lost in the garbage-collection sense (mainly 581 # only that due to parsing and instance simplification/prep-processing). 582 # to speed things along, disable garbage collection if it enabled in 583 # the first place through the instance construction process. 584 # IDEA: If this becomes too much for truly large numbers of scenarios, 585 # we could manually collect every time X instances have been created. 586 587 re_enable_gc = False 588 if gc.isenabled() is True: 589 re_enable_gc = True 590 gc.disable() 577 591 578 592 scenario_instances = {} … … 617 631 scenario_instances[scenario._name] = scenario_instance 618 632 633 if re_enable_gc is True: 634 gc.enable() 635 619 636 print "" 620 637
Note: See TracChangeset
for help on using the changeset viewer.