Author: Armin Rigo <[email protected]>
Branch: stm-gc
Changeset: r52795:df24c4bac7bc
Date: 2012-02-23 11:20 +0100
http://bitbucket.org/pypy/pypy/changeset/df24c4bac7bc/
Log: Trying out a version of the RTyper that runs every block in its own
transaction.
diff --git a/pypy/rpython/rtyper.py b/pypy/rpython/rtyper.py
--- a/pypy/rpython/rtyper.py
+++ b/pypy/rpython/rtyper.py
@@ -246,9 +246,12 @@
else:
tracking = lambda block: None
- previous_percentage = 0
- # specialize all blocks in the 'pending' list
- for block in pending:
+ try:
+ import transaction
+ except ImportError:
+ previous_percentage = 0
+ # specialize all blocks in the 'pending' list
+ for block in pending:
tracking(block)
blockcount += 1
self.specialize_block(block)
@@ -266,6 +269,16 @@
error_report = ''
self.log.event('specializing: %d / %d blocks
(%d%%)%s' %
(n, total, percentage, error_report))
+ else:
+ # try a version using the transaction module
+ for block in pending:
+ transaction.add(self.specialize_block, block)
+ self.log.event('specializing transactionally %d blocks' %
+ (len(pending),))
+ transaction.run()
+ blockcount += len(pending)
+ self.already_seen.update(dict.fromkeys(pending, True))
+
# make sure all reprs so far have had their setup() called
self.call_all_setups()
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit