Brian Frank wrote: > I've definitely felt the pain trying to deal with longs and doubles. > I gave up and just keep everything boxed. > > But one technique I've used extensively which has really helped is > heavy use of interned/cached boxed objects. For example any integer > in the range of -256 to 1024 is interned (which is a much bigger range > than Integer.valueOf interns). I also intern all the ASCII strings > from " " to "~", empty arrays for every type, etc.
JRuby uses the same technique (as does Ruby) for -127 to 128. And more expensive literals (like literal Bignums) are initialized on load. It definitely does make a big difference. - Charlie --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "JVM Languages" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/jvm-languages?hl=en -~----------~----~----~----~------~----~------~--~---
