All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.fillumina.performance.producer.suite.ParametrizedRunnableSink Maven / Gradle / Ivy

Go to download

Configurable tool to easily compare performances of different code snippets and to take performance telemetry of a running application.

The newest version!
package com.fillumina.performance.producer.suite;

/**
 * It's a {@link ParametrizedRunnable} that avoids dead code eviction.
 *
 * @author Francesco Illuminati
 */
public abstract class ParametrizedRunnableSink

extends ParametrizedRunnable

{ private static final Object REFERENCE = new Object(); /** * Override this method to provide the test's code. * The returned value is managed so the code used to get it is not * removed by the optimizations of the JVM. */ public abstract Object sink(final P param); @Override public void call(final P param) { final Object obj = sink(param); // force obj to be evaluated and so the code returning it // will not be evicted if (obj == REFERENCE) { throw new AssertionError(); } } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy