Good examples of value types

Russel Winder via Digitalmars-d digitalmars-d at puremagic.com
Wed May 6 02:20:27 PDT 2015


On Wed, 2015-05-06 at 02:07 +0000, deadalnix via Digitalmars-d wrote:
> 
[…]
> Let me tell you an actual war story of mine.

I think you need to date the story, and say with GC was being used.

> We have this program that is computationally intensive written in 
> java. Somewhere in the core of the program, we have a LRU cache, 
> with some entries sticking in there, and most entry getting 
> evicted soon enough (typical pareto kind of thing).
> 
> Problem is, all these entries needs to be value types (we are in 
> java) and, by the time things gets evicted from the LRU cache, 
> they have moved to the old generation.
> 
> The whole damn thing generate a ton of garbage.

I suspect this was not using G1 as tons of garbage isn't as much of a
problem compared to CMS, etc.

> The obvious solution is to use value types in the cache, but that 
> not possible. I won't go in the details, but that was a really 
> hard problem to solve, that kept us busy for for longer then it 
> should have because of language limitations.
> 
> Long story short: value types are useful.

This is true anyway no matter which language or GC is being used.

-- 
Russel.
=============================================================================
Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.winder at ekiga.net
41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel at winder.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: This is a digitally signed message part
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20150506/42e7cb6b/attachment-0001.sig>


More information about the Digitalmars-d mailing list