[#2178] Improve FieldList. Avoid creating excessive array lists,

where simple (immutable) Field<?>[] are sufficient - Added benchmark
This commit is contained in:
Lukas Eder 2013-02-08 13:07:53 +01:00
parent d51a7b53dc
commit 8573e3d0c5
2 changed files with 15 additions and 0 deletions

View File

@ -79,6 +79,7 @@ public class BenchmarkTests<
T785 extends TableRecord<T785>>
extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T725, T639, T785> {
private static final int REPETITIONS_NEW_RECORD = 1000000;
private static final int REPETITIONS_RECORD_INTO = 2000;
private static final int REPETITIONS_FIELD_ACCESS = 1000000;
private static final int REPETITIONS_SELECT = 100;
@ -88,6 +89,15 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
super(delegate);
}
@Test
public void testBenchmarkNewRecord() throws Exception {
Executor create = create();
for (int i = 0; i < REPETITIONS_NEW_RECORD; i++) {
create.newRecord(TBook());
}
}
@Test
public void testBenchmarkRecordInto() throws Exception {
Result<B> books = create().fetch(TBook());

View File

@ -1974,6 +1974,11 @@ public abstract class jOOQAbstractTest<
new LoaderTests(this).testLoader();
}
@Test
public void testBenchmarkNewRecord() throws Exception {
new BenchmarkTests(this).testBenchmarkNewRecord();
}
@Test
public void testBenchmarkRecordInto() throws Exception {
new BenchmarkTests(this).testBenchmarkRecordInto();