2010-05-14 Rodrigo Kumpera <rkumpera@novell.com>
commitf5c5052e82d034602451d092e26a81c7e7145853
authorkumpera <kumpera@e3ebcda4-bce8-0310-ba0a-eca2169e7518>
Mon, 17 May 2010 19:34:05 +0000 (17 19:34 +0000)
committerkumpera <kumpera@e3ebcda4-bce8-0310-ba0a-eca2169e7518>
Mon, 17 May 2010 19:34:05 +0000 (17 19:34 +0000)
tree6970de7db9029f69548d273c86c4c8353e840c44
parent819b3725fb141090c082059819c9297b06cb812c
2010-05-14 Rodrigo Kumpera  <rkumpera@novell.com>

* sgen-gc.c (global_remset_cache_test): New function that
implements a 2 element LRU cache for just added remsets.
It is used to avoid adding duplicate ones.

* sgen-gc.c (add_to_global_remset): Check cache before
adding new entry.

* sgen-gc.c (scan_from_remsets): Ditto.

A 2 element LRU cache was chosen by profiling IronPython 2.6
pytones with 1M passes and corlib compilation.

For the ipy test duplication was originally 940.92, measured
by "Store remsets" divided by "Unique store remsets".

With a 2-element LRU, duplication went to 1.007. Without the
check in scan_from_remsets 1.438.

With a 16-elements LRU, duplication reduction was negligibe.
A single element cache was basically of no use.

With corlib compilation duplication went from  1.4 to 1.02.

Performance results is a 20% time decrease for ipy and 2%
with corlib.

git-svn-id: svn+ssh://mono-cvs.ximian.com/source/trunk/mono@157460 e3ebcda4-bce8-0310-ba0a-eca2169e7518
mono/metadata/ChangeLog
mono/metadata/sgen-gc.c