[Mono-dev] ResourceReader patch

Konstantin Triger kostat at gmail.com
Fri May 30 09:49:09 EDT 2008


Hello all,

Since both ResourceInfo and ResourceCacheItem are used for caching, I think
they are not created a lot. Thus I don't think their creation/collection
pose a pressure on GC.

In the same time ResourceReader can be under heavy pressure and utilize its
cache a lot.
Once the cache data is converted to a struct their is a great potential that
it will be boxed somewhere (see Andy's comments below) and this may happen
in a common flow.

I'm not convinced that there is a performance improvement, and there is a
great potential that after this optimization the performance will even
degrade.


On Thu, May 29, 2008 at 12:59 PM, Andy Hume <andyhume32 at yahoo.co.uk> wrote:

> For full no-allocation behaviour :-) the IList passed to
> LoadResourceValues needs to be typed as its real Generic type, otherwise
> ResourceCacheItem is boxed on store.Add.  Don't know how often that
> operation occurs...
>
> Andy
>
>
> e.g. [[
> Index: ResourceReader.cs
> ===================================================================
> --- ResourceReader.cs   (revision 104379)
> +++ ResourceReader.cs   (working copy)
> @@ -409,7 +409,11 @@
>                        return obj;
>                }
>
> +#if NET_2_0
> +               void LoadResourceValues (IList<ResourceCacheItem> store)
> +#else
>                void LoadResourceValues (IList store)
> +#endif
>                {
>                        ResourceInfo ri;
>                        ResourceCacheItem rci;
> ]]
>
>
> > -----Original Message-----
> > From: mono-devel-list-bounces at lists.ximian.com
> > [mailto:mono-devel-list-bounces at lists.ximian.com] On Behalf
> > Of Marek Habersack
> > Sent: 28 May 2008 22:36
> > To: mono-devel-list at lists.ximian.com
> > Subject: Re: [Mono-dev] ResourceReader patch
> >
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> >
> > On Wed, 28 May 2008 10:21:19 +0200
> > "Andreas Nahr" <ClassDevelopment at A-SoftTech.com> wrote:
> >
> > > Is there any reason for not using structs?
> > > No sense in needlessly torturing the GC ;)
> > Makes sense - applied in r104334, thanks!
> >
> > marek
> > -----BEGIN PGP SIGNATURE-----
> > Version: GnuPG v2.0.4-svn0 (GNU/Linux)
> >
> > iD8DBQFIPdA1q3909GIf5uoRAlsvAJ98jcbhTtuNUudBHybCR4xBCD3k1QCfYngI
> > Qougwstb8DzXROt6uTn7aHc=
> > =Gris
> > -----END PGP SIGNATURE-----
> > _______________________________________________
> > Mono-devel-list mailing list
> > Mono-devel-list at lists.ximian.com
> > http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
>
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>



-- 
Regards,
Konstantin Triger
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20080530/e6d52b19/attachment.html 


More information about the Mono-devel-list mailing list