Skip to content

Commit

Permalink
UniqueIndexTest, MmapLongIdIndexTest: take effective constant out of …
Browse files Browse the repository at this point in the history
…the loop
  • Loading branch information
c247t committed Jan 11, 2024
1 parent a7c3700 commit 25d0269
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion dump/test/util/dump/MmapLongIdIndexTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -358,11 +358,12 @@ private void fillDump( Dump<Bean> dump ) throws IOException {
for ( int i = 0; i < BEAN_SIZE - 15; i++ ) { // 15 is an estimation for the size of the Bean instance without this padding
sb.append('0');
}
String padding = sb.toString();

/* add some elements */
long t = System.currentTimeMillis();
for ( int i = 0; i < _dumpSize; i++ ) {
dump.add(new Bean(i, i + sb.toString()));
dump.add(new Bean(i, i + padding));
}
System.out.println("Written " + _dumpSize + " instances to dump. Needed " + (System.currentTimeMillis() - t) / (float)_dumpSize + " ms/instance.");
}
Expand Down
3 changes: 2 additions & 1 deletion dump/test/util/dump/UniqueIndexTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -382,11 +382,12 @@ private void fillDump( Dump<Bean> dump ) throws IOException {
for ( int i = 0; i < BEAN_SIZE - 15; i++ ) { // 15 is an estimation for the size of the Bean instance without this padding
sb.append('0');
}
String padding = sb.toString();

/* add some elements */
long t = System.currentTimeMillis();
for ( int i = 0; i < _dumpSize; i++ ) {
dump.add(new Bean(i, i + sb.toString()));
dump.add(new Bean(i, i + padding));
}
System.out.println("Written " + _dumpSize + " instances to dump. Needed " + (System.currentTimeMillis() - t) / (float)_dumpSize + " ms/instance.");
}
Expand Down

0 comments on commit 25d0269

Please sign in to comment.