Other tricks for faster java include ensuring that, wherever possible, you use the final, static and private keywords. This enables the compiler to apply more compilation tricks in more places. Obviously there are places where you sholdn't use these (think interfaces), but in the inner loop they can have an impact, particularly in a multi-threaded application (because they avoid needing to test for locks). If memory is a stumbling block and you have complex object stuctures, you may also want to set references to objects to null explicitly when you know they're no longer needed.
cheers stuart On 11/29/06, Graham Thomson <[EMAIL PROTECTED]> wrote:
You can also squeeze a little more runtime performance by increasing the size of object nursery. The commands would be: java -XX:NewSize=256m -Xms512m -Xmx512m -server MyApp The NewSize command alters the object nursery size - note that this is in the addition to the heap size. So if you had 1G of memory on your machine, these sizes would be good choices - 256M for the object nursery, 512M for the heap, and 256M for your OS. Tweaking the nursery / heap size ratio for best performance is of course, application dependant. Cheers, Graham. On 29/11/06, William M. Shubert <[EMAIL PROTECTED] > wrote: > > To be more specific, "-server" tells java to spend more time on the > compilation. This is good if you compile a little bit of code and run it > over and over, but it makes programs seem sluggish at first and take a > long time to start up, which is why it isn't the default. > > Also, the documentation says that "-server" will take up a lot more > memory for the compiled code. I haven't verified that myself though. > > On Tue, 2006-11-28 at 21:44 +0000, Lucas, Simon M wrote: > > Both do just in time compilation, > > but the -server option uses more > > optimisation tricks. Sometimes these > > make a significant difference, sometimes not. > > > > Without the JIT, it would be *very* much slower. > > > > Best regards, > > > > Simon Lucas > > _______________________________________________ > computer-go mailing list > [email protected] > http://www.computer-go.org/mailman/listinfo/computer-go/ > _______________________________________________ computer-go mailing list [email protected] http://www.computer-go.org/mailman/listinfo/computer-go/
_______________________________________________ computer-go mailing list [email protected] http://www.computer-go.org/mailman/listinfo/computer-go/
