BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News Article: The Limits of Code Optimization: a new Singleton Pattern Implementation

Article: The Limits of Code Optimization: a new Singleton Pattern Implementation

Bookmarks

In this new article, Dr. Alexey Yakubovich, discusses the limits of code optimization in the context of the Singleton pattern implementation and offers an enhanced implementation that prevents some of the side effects of code optimization in current JVMs. He explains:

The main purpose of this article is to test the “boundary conditions” of the programming language optimization.

The core of Alexey's argument is to introduce a new method in the Singleton pattern's implementation

a method with the signature static boolean oracle(int h) and one very special quality – there is no way for java compiler or java runtime to predict the value produced by this method.

Rate this Article

Adoption
Style

BT