[pypy-commit] stmgc c8-faster-smallobj-sync: fix; but anyway seems to go nowhere

Raemi noreply at buildbot.pypy.org
Mon Aug 17 10:47:46 CEST 2015


Author: Remi Meier <remi.meier at inf.ethz.ch>
Branch: c8-faster-smallobj-sync
Changeset: r1936:3dea513c6824
Date: 2015-08-17 10:51 +0200
http://bitbucket.org/pypy/stmgc/changeset/3dea513c6824/

Log:	fix; but anyway seems to go nowhere

	Merging ranges in small_overflow_obj_ranges_add was basically the
	only way this branch could improve sync-time. However, even with the
	quadratic, dead-slow version of merging, only 8% of objs passed to
	this function allowed a merge to happen (and the current version
	reaches ~7%). In this light, the branch is probably useless. It also
	suggests that smallmalloc often allocates in isolated slots of
	already-used pages. Meaning, if the allocation pattern of
	smallmalloc does not change, there is little chance of syncing
	continuous memory ranges instead of individual objects.

diff --git a/c8/stm/core.c b/c8/stm/core.c
--- a/c8/stm/core.c
+++ b/c8/stm/core.c
@@ -1827,8 +1827,8 @@
         /* seems to not help to look for merges in this way: */
         stm_char *obj_start = (stm_char*)obj;
         long i;
-        long min = lst->count - 2 * 2; /* go back 4 elems */
-        for (i = lst->count - 2; i >= min; i -= 2) {
+        long min = lst->count - 4 * 2; /* go back 4 elems */
+        for (i = lst->count - 2; i >= min && i >= 0; i -= 2) {
             stm_char *start = (stm_char*)lst->items[i];
             ssize_t size = (ssize_t)lst->items[i+1];
 


More information about the pypy-commit mailing list