Author: Armin Rigo <[email protected]>
Branch: 
Changeset: r74940:5fc98f5c2d94
Date: 2014-12-15 15:46 +0000
http://bitbucket.org/pypy/pypy/changeset/5fc98f5c2d94/

Log:    Add a performance hack: llop.gc_writebarrier

diff --git a/rpython/rtyper/lltypesystem/rordereddict.py 
b/rpython/rtyper/lltypesystem/rordereddict.py
--- a/rpython/rtyper/lltypesystem/rordereddict.py
+++ b/rpython/rtyper/lltypesystem/rordereddict.py
@@ -605,6 +605,10 @@
         newitems = lltype.malloc(lltype.typeOf(d).TO.entries.TO, new_allocated)
     else:
         newitems = d.entries
+        # The loop below does a lot of writes into 'newitems'.  It's a better
+        # idea to do a single gc_writebarrier rather than activating the
+        # card-by-card logic (worth 11% in microbenchmarks).
+        llop.gc_writebarrier(lltype.Void, newitems)
     #
     ENTRIES = lltype.typeOf(d).TO.entries.TO
     ENTRY = ENTRIES.OF
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to