Skip to content

Commit

Permalink
Optimize bytecode recording test performance
Browse files Browse the repository at this point in the history
- Change creation of a large collection in `BytecodeRecorderTestCase.java` from using a loop to using `Collections.nCopies`
  • Loading branch information
gastaldi committed Feb 15, 2023
1 parent 3bc1f40 commit 106eb4f
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -215,11 +215,7 @@ public String get() {
@Test
public void testLargeCollection() throws Exception {

List<TestJavaBean> beans = new ArrayList<>();
for (int i = 0; i < 100000; ++i) {
beans.add(new TestJavaBean("A string", 99));
}

List<TestJavaBean> beans = Collections.nCopies(100000, new TestJavaBean("A string", 99));
runTest(generator -> {
TestRecorder recorder = generator.getRecordingProxy(TestRecorder.class);
recorder.list(beans);
Expand Down

0 comments on commit 106eb4f

Please sign in to comment.