Skip to content

Instantly share code, notes, and snippets.

View mrniko's full-sized avatar

Nikita Koksharov mrniko

View GitHub Profile
public class PerfTester {
private static final String MASTER_HOST = "redis://127.0.0.1:63820";
private static final String READ_REPLICA_HOST = "redis://127.0.0.1:63800";
private static final int TEST_RUNS = 10;
private static final int RETRY_ATTEMPTS = 3;
private static final int RETRY_INTERVAL_MS = 1500;
private static final int CONNECT_TIMEOUT_MS = 10_000;
private static final int TIMEOUT_MS = 3000;
@mrniko
mrniko / benchmark.txt
Last active March 29, 2016 11:35
Redisson benchmark
Test machine: Windows 7, Core i7 3612QM, 16Gb RAM
Redisson 2.2.10 results:
Memory Status: [Used: 249 MB (6% of max), Free: 207 MB (5% of max), Total: 456 MB (12% of max), Max: 3 614 MB]
0% complete. 16 468 of 5 000 000 attempted. 3 083 per sec. 0,1 min elapsed. 27,0 min remaining(est).
8% complete. 423 530 of 5 000 000 attempted. 20 823 per sec. 0,3 min elapsed. 3,7 min remaining(est).
19% complete. 944 084 of 5 000 000 attempted. 26 714 per sec. 0,6 min elapsed. 2,5 min remaining(est).
29% complete. 1 451 046 of 5 000 000 attempted. 28 824 per sec. 0,8 min elapsed. 2,0 min remaining(est).
Memory Status: [Used: 266 MB (7% of max), Free: 527 MB (14% of max), Total: 793 MB (21% of max), Max: 3 614 MB]
@mrniko
mrniko / HuffmanService.java
Created June 22, 2015 06:19
Huffman service
import java.util.BitSet;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Map;
import java.util.PriorityQueue;
import java.util.Queue;
import org.springframework.security.crypto.codec.Hex;
import org.springframework.stereotype.Service;