Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: markspace <-@.> Newsgroups: comp.lang.java.programmer Subject: Re: alias for Integer Date: Fri, 18 Nov 2011 07:11:51 -0800 Organization: A noiseless patient Spider Lines: 29 Message-ID: References: <21374513.220.1321627842805.JavaMail.geo-discussion-forums@yqmj32> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Fri, 18 Nov 2011 15:11:53 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="XjIWM99mD7Ijfdu600oVPA"; logging-data="13593"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19RKZMlkA5a6cR7kib0EX1MxeLji/YYfa8=" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0 In-Reply-To: <21374513.220.1321627842805.JavaMail.geo-discussion-forums@yqmj32> Cancel-Lock: sha1:X2mqzw0e08GZEU4MF4uiNTD/vz0= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:10042 On 11/18/2011 6:50 AM, jrobinss wrote: > > 3. is there any > performance issue in defining my own classes instead of Integer? To me yes, there is a performance issue, and you should definitely consider using something besides Integer and Map for this. > Note that (exceptionnally for me) performance *is* an issue here. I > haven't yet narrowed it down, but the code executes very slowly and > eats up much too much memory at the moment. I'm starting to optimize > it, that's why I'm starting with strongly typing it to prevent > errors. Good, you're doing this the right way. You should look into profiling your code. NetBeans has an excellent profiler built in, and will handle most "user made" projects as well as its own format. You should look into it. The most important thing is to pinpoint where the code is slow and work on those bits. I suspect that auto-boxing and unboxing is costing you too much time, but I couldn't prove it. The profiler could.