Java Code Examples for com.carrotsearch.junitbenchmarks.BenchmarkOptions#CONCURRENCY_AVAILABLE_CORES

The following examples show how to use com.carrotsearch.junitbenchmarks.BenchmarkOptions#CONCURRENCY_AVAILABLE_CORES . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: IndexBenchmark.java    From public-suffix-list with Do What The F*ck You Want To Public License 6 votes vote down vote up
@BenchmarkOptions(
        benchmarkRounds = 20000,
        warmupRounds = 2000,
        concurrency = BenchmarkOptions.CONCURRENCY_AVAILABLE_CORES)
@Test
public void benchmarkFindRule() throws Exception {
    index.findRule(RandomStringUtils.random(2));
    index.findRule(RandomStringUtils.random(2));
    index.findRule(RandomStringUtils.random(2));
    index.findRule(RandomStringUtils.random(2));
    index.findRule(RandomStringUtils.random(2));
    index.findRule(RandomStringUtils.random(2));
    index.findRule("www.global.prod.fastly.net");
    index.findRule(RandomStringUtils.random(2));
    index.findRule(RandomStringUtils.random(2));
    index.findRule(RandomStringUtils.random(2));
    index.findRule(RandomStringUtils.random(2));
}
 
Example 2
Source File: GetRegistrableDomainTest.java    From public-suffix-list with Do What The F*ck You Want To Public License 6 votes vote down vote up
@BenchmarkOptions(
        benchmarkRounds = 10000,
        concurrency = BenchmarkOptions.CONCURRENCY_AVAILABLE_CORES)
@Test
public void testGetRegistrableDomain() throws IOException {
    for (String[] tupel : TestUtil.getCheckPublicSuffixCases()) {
        String domain = tupel[0];
        String registrableDomain = tupel[1];

        String actual = StringUtils.lowerCase(psl.getRegistrableDomain(domain));
        String expected = StringUtils.lowerCase(registrableDomain);
        assertEquals(
            String.format("%s should return %s, but was %s", domain, expected, actual),
            expected,
            actual
        );
    }
}
 
Example 3
Source File: FindRuleNonDetermenisticConcurrentTest.java    From public-suffix-list with Do What The F*ck You Want To Public License 5 votes vote down vote up
@BenchmarkOptions(
        benchmarkRounds = 5000,
        concurrency = BenchmarkOptions.CONCURRENCY_AVAILABLE_CORES)
@Test
public void benchmarkFindRule() throws Exception {
    assertEquals(
            "global.prod.fastly.net",
            index.findRule("www.global.prod.fastly.net").getPattern());
}
 
Example 4
Source File: ParallelAccessTest.java    From jerseyoauth2 with MIT License 5 votes vote down vote up
@Ignore
@BenchmarkOptions(benchmarkRounds=200, concurrency=BenchmarkOptions.CONCURRENCY_AVAILABLE_CORES)
@Test
public void testParallelResourceAccess() throws ClientException
{
	SampleEntity entity = client.retrieveEntitySample1(token);
	assertNotNull(entity);
	assertEquals("manager", entity.getUsername());
	assertEquals(clientEntity.getClientId(), entity.getClientApp());
}