Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!.POSTED!not-for-mail From: Jan Burse Newsgroups: comp.lang.java.programmer Subject: Re: Immutable Datastructures with good Sharing Date: Sat, 05 Nov 2011 21:33:48 +0100 Organization: albasani.net Lines: 17 Message-ID: References: <4eb59a7e$0$292$14726298@news.sunsite.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Trace: news.albasani.net BfDmMpBANK+O+pTVIP2vWQRLkjmEl+3upEr8S6ozwQiVEL1PCgDioKDaGO48fA46jvRJJgLDgNjtXGwygBj8DQ== NNTP-Posting-Date: Sat, 5 Nov 2011 20:33:49 +0000 (UTC) Injection-Info: news.albasani.net; logging-data="RD0cKw87FWBuzAb/8Pn+VUueme/OnDy6lwcf2jukUJMT7uxfRndmK9RFbbiyC1HkmjP4MQsL8UhacS0F8qEXLrOVQgZ2p69v4erARa8TKLYlf+etz3RSMxz5aX136F/s"; mail-complaints-to="abuse@albasani.net" User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:7.0.1) Gecko/20110928 Firefox/7.0.1 SeaMonkey/2.4.1 In-Reply-To: <4eb59a7e$0$292$14726298@news.sunsite.dk> Cancel-Lock: sha1:0GpibpIkQRPwu+qFHVjZazulA9o= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:9602 Arne Vajhøj schrieb: > But will the time you spend investigating this really cost less > than what it cost to buy 4 GB more RAM and just clone the objects > you want to store as history. I do this already. But I have an application case where the cloning not only incures more memory use but also more runtime. When you clone you need to go through the whole array and copy each element, this takes time. When you share, you don't need to spend this time. Currently the runtime is too high. So if you show me a shop where I can buy CPU time as I can buy RAM, then this could be a solution. But les assume that the CPU time is bounded, so that we have a real problem case here. Bye