Search in sources :

Example 1 with CombinedExecutionStats

use of co.rsk.peg.performance.CombinedExecutionStats in project rskj by rsksmart.

the class GetMultisigScriptHashPerformanceTestCase method getMultisigScriptHash_Weighed.

@Test
public void getMultisigScriptHash_Weighed() throws VMException {
    warmUp();
    CombinedExecutionStats stats = new CombinedExecutionStats(String.format("%s-weighed", function.name));
    stats.add(estimateGetMultisigScriptHash(500, 2, environmentBuilder));
    stats.add(estimateGetMultisigScriptHash(2000, 8, environmentBuilder));
    stats.add(estimateGetMultisigScriptHash(1000, 15, environmentBuilder));
    HDWalletUtilsPerformanceTest.addStats(stats);
}
Also used : CombinedExecutionStats(co.rsk.peg.performance.CombinedExecutionStats) Test(org.junit.Test)

Example 2 with CombinedExecutionStats

use of co.rsk.peg.performance.CombinedExecutionStats in project rskj by rsksmart.

the class GetMultisigScriptHashPerformanceTestCase method getMultisigScriptHash_Even.

@Test
public void getMultisigScriptHash_Even() throws VMException {
    warmUp();
    CombinedExecutionStats stats = new CombinedExecutionStats(String.format("%s-even", function.name));
    for (int numberOfKeys = 2; numberOfKeys <= 15; numberOfKeys++) {
        stats.add(estimateGetMultisigScriptHash(500, numberOfKeys, environmentBuilder));
    }
    HDWalletUtilsPerformanceTest.addStats(stats);
}
Also used : CombinedExecutionStats(co.rsk.peg.performance.CombinedExecutionStats) Test(org.junit.Test)

Example 3 with CombinedExecutionStats

use of co.rsk.peg.performance.CombinedExecutionStats in project rskj by rsksmart.

the class DeriveExtendedPublicKeyPerformanceTestCase method deriveExtendedPublicKey.

@Test
public void deriveExtendedPublicKey() throws VMException {
    function = new DeriveExtendedPublicKey(null, null).getFunction();
    EnvironmentBuilder environmentBuilder = (int executionIndex, TxBuilder txBuilder, int height) -> {
        HDWalletUtils contract = new HDWalletUtils(new TestSystemProperties().getActivationConfig(), PrecompiledContracts.HD_WALLET_UTILS_ADDR);
        contract.init(txBuilder.build(executionIndex), Helper.getMockBlock(1), null, null, null, null);
        return EnvironmentBuilder.Environment.withContract(contract);
    };
    // Get rid of outliers by executing some cases beforehand
    setQuietMode(true);
    System.out.print("Doing an initial pass... ");
    estimateDeriveExtendedPublicKey(100, 1, environmentBuilder);
    System.out.print("Done!\n");
    setQuietMode(false);
    CombinedExecutionStats stats = new CombinedExecutionStats(function.name);
    stats.add(estimateDeriveExtendedPublicKey(500, 1, environmentBuilder));
    stats.add(estimateDeriveExtendedPublicKey(2000, 2, environmentBuilder));
    stats.add(estimateDeriveExtendedPublicKey(500, 4, environmentBuilder));
    stats.add(estimateDeriveExtendedPublicKey(500, 10, environmentBuilder));
    HDWalletUtilsPerformanceTest.addStats(stats);
}
Also used : CombinedExecutionStats(co.rsk.peg.performance.CombinedExecutionStats) TestSystemProperties(co.rsk.config.TestSystemProperties) Test(org.junit.Test)

Aggregations

CombinedExecutionStats (co.rsk.peg.performance.CombinedExecutionStats)3 Test (org.junit.Test)3 TestSystemProperties (co.rsk.config.TestSystemProperties)1