MCPcopy Create free account
hub / github.com/e2wugui/zeze / prepareDatas

Method prepareDatas

ZezeJava/ZezeJavaTest/src/Benchmark/BenchSocket.java:64–103  ·  view source on GitHub ↗
(int steps, OutInt max)

Source from the content-addressed store, hash-verified

62 }
63
64 private static ArrayList<ByteBuffer> prepareDatas(int steps, OutInt max) {
65 var src = new ArrayList<ByteBuffer>();
66 var rand = new java.util.Random(2); // 固定随机种子
67 for (int step = 0; step < steps; ++step) {
68 {
69 var bValue = new BValue();
70 for (long i = 0; i < 100; ++i) {
71 bValue.getMap15().put(i, rand.nextLong(20));
72 }
73 var bb = ByteBuffer.Allocate();
74 bValue.encode(bb);
75 src.add(bb);
76 if (bb.size() > max.value)
77 max.value = bb.size();
78 }
79 {
80 var bValue = new BValue();
81 for (long i = 0; i < 100; ++i) {
82 bValue.getArray29().add((float)rand.nextInt(20));
83 }
84 var bb = ByteBuffer.Allocate();
85 bValue.encode(bb);
86 src.add(bb);
87 if (bb.size() > max.value)
88 max.value = bb.size();
89 }
90 {
91 var bValue = new BValue();
92 for (int i = 0; i < 100; ++i) {
93 bValue.getSet10().add(rand.nextInt(20));
94 }
95 var bb = ByteBuffer.Allocate();
96 bValue.encode(bb);
97 src.add(bb);
98 if (bb.size() > max.value)
99 max.value = bb.size();
100 }
101 }
102 return src;
103 }
104
105 @Test
106 public void testCompressDecompress() {

Callers 3

testEncryptDecryptMethod · 0.95
testEncryptDecrypt2Method · 0.95

Calls 7

AllocateMethod · 0.95
encodeMethod · 0.95
putMethod · 0.65
addMethod · 0.65
sizeMethod · 0.65
nextLongMethod · 0.45
nextIntMethod · 0.45

Tested by

no test coverage detected