Share this post! | Vote this! |
|
Many algorithms are expressed most concisely as tail-recursive methods.
Compilers can automatically transform such methods into loops and
thereby improve program performance, but this transformation is not
required by the Java language specification, so not all JVMs will
perform it. This means that tail-recursive methods in the Java language
can result in unexpectedly large memory usage. In this article, Eric
Allen demonstrates that dynamic compilation maintains the language's
semantics while static compilation often doesn't. He shows why this
matters and offers a bit of code to help you determine whether your
just-in-time (JIT) compiler can transform tail recursion on code while
preserving semantics. more...
0 comments:
Post a Comment