Skip to content

Instantly share code, notes, and snippets.

View gdela's full-sized avatar

Wojciech Gdela gdela

View GitHub Profile
Benchmark (unscaledValue) Score Error Units
value_of 0 0.885 0.021 ns/op
ctor_having_big_integer 0 4.141 2.112 ns/op
ctor_creating_big_integer_from_long 0 4.010 0.850 ns/op
ctor_creating_big_integer_from_bytes 0 11.274 1.482 ns/op
ctor_having_string 0 14.536 6.909 ns/op
value_of 1 4.080 2.500 ns/op
ctor_having_big_integer 1 4.239 0.920 ns/op
ctor_creating_big_integer_from_long 1 4.586 0.925 ns/op
ctor_creating_big_integer_from_bytes 1 12.411 7.313 ns/op
BigDecimal’s unscaled value range baseline (noop) classic ser/deser optimized ser/deser
0 to 999 999 8 ns/op 40 ns/op 14 ns/op
2000000 to 2999999 8 ns/op 39 ns/op 13 ns/op
10 000 000 to 10 999 999 8 ns/op 41 ns/op 13 ns/op
1 million below Long.MAX_VALUE 8 ns/op 55 ns/op 19 ns/op
1 million above Long.MAX_VALUE 8 ns/op 51 ns/op 53 ns/op
@gdela
gdela / MyEntryTaskSchedulerBenchmark.java
Last active August 2, 2019 18:28
Benchmark used for improving performance of committing transaction in Hazelcast: https://github.com/hazelcast/hazelcast/issues/15301
/*
* Copyright (c) 2008-2019, Hazelcast, Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@gdela
gdela / MyTransactionCommitMain.java
Last active July 10, 2019 17:04
Benchmark used for improving performance of committing transaction in Hazelcast: https://github.com/hazelcast/hazelcast/issues/15301
/*
* Copyright (c) 2008-2019, Hazelcast, Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@gdela
gdela / MyTransactionBenchmark.java
Last active May 30, 2019 09:30
Benchmark used for improving performance of TransactionLog class in Hazelcast: https://github.com/hazelcast/hazelcast/pull/15111
/*
* Copyright (c) 2008-2019, Hazelcast, Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@gdela
gdela / QueryCacheDelayExample.java
Last active March 5, 2019 13:22
Code describing use case behind this question: https://stackoverflow.com/questions/54928516
import com.hazelcast.config.Config;
import com.hazelcast.config.PredicateConfig;
import com.hazelcast.config.QueryCacheConfig;
import com.hazelcast.core.Hazelcast;
import com.hazelcast.core.HazelcastInstance;
import com.hazelcast.core.HazelcastInstanceAware;
import com.hazelcast.core.IMap;
import com.hazelcast.core.TransactionalMap;
import com.hazelcast.map.EntryBackupProcessor;
import com.hazelcast.map.EntryProcessor;
@gdela
gdela / 30976263.java
Last active August 29, 2015 14:23
Code describing use case behind this question: http://stackoverflow.com/questions/30976263
/**
* Plain old implementation, no good - all data gathered in memory in List object.
*/
public List<Parent> loadData() throws Exception {
String sql = "select parent.id, child.value "
+= "from parent join child on (child.parent_id = parent.id) "
+= "order by parent.id";
ResultSet rs = connection.createStatement().executeQuery(sql);
List<Parent> parents = new ArrayList<>();