Skip to content

Commit 1536c11

Browse files
authored
Add benchmark for some dart:ffi code that was slow in the old formatter. (#1515)
In the new formatter, it's about 3000x faster. Fix #1066.
1 parent 8a8e4f5 commit 1536c11

File tree

3 files changed

+255
-0
lines changed

3 files changed

+255
-0
lines changed

benchmark/case/ffi.expect

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
final passInt32x8Doublex8Int64Int8Struct1ByteIntInt64IntLeaf = ffiTestFunctions
2+
.lookupFunction<
3+
Double Function(
4+
Int32,
5+
Int32,
6+
Int32,
7+
Int32,
8+
Int32,
9+
Int32,
10+
Int32,
11+
Int32,
12+
Double,
13+
Double,
14+
Double,
15+
Double,
16+
Double,
17+
Double,
18+
Double,
19+
Double,
20+
Int64,
21+
Int8,
22+
Struct1ByteInt,
23+
Int64,
24+
Int8,
25+
Struct4BytesHomogeneousInt16,
26+
Int64,
27+
Int8,
28+
Struct8BytesInt,
29+
Int64,
30+
Int8,
31+
Struct8BytesHomogeneousFloat,
32+
Int64,
33+
Int8,
34+
Struct8BytesMixed,
35+
Int64,
36+
Int8,
37+
StructAlignmentInt16,
38+
Int64,
39+
Int8,
40+
StructAlignmentInt32,
41+
Int64,
42+
Int8,
43+
StructAlignmentInt64,
44+
),
45+
double Function(
46+
int,
47+
int,
48+
int,
49+
int,
50+
int,
51+
int,
52+
int,
53+
int,
54+
double,
55+
double,
56+
double,
57+
double,
58+
double,
59+
double,
60+
double,
61+
double,
62+
int,
63+
int,
64+
Struct1ByteInt,
65+
int,
66+
int,
67+
Struct4BytesHomogeneousInt16,
68+
int,
69+
int,
70+
Struct8BytesInt,
71+
int,
72+
int,
73+
Struct8BytesHomogeneousFloat,
74+
int,
75+
int,
76+
Struct8BytesMixed,
77+
int,
78+
int,
79+
StructAlignmentInt16,
80+
int,
81+
int,
82+
StructAlignmentInt32,
83+
int,
84+
int,
85+
StructAlignmentInt64,
86+
)
87+
>("PassInt32x8Doublex8Int64Int8Struct1ByteIntInt64Int", isLeaf: true);

benchmark/case/ffi.expect_short

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
final passInt32x8Doublex8Int64Int8Struct1ByteIntInt64IntLeaf =
2+
ffiTestFunctions.lookupFunction<
3+
Double Function(
4+
Int32,
5+
Int32,
6+
Int32,
7+
Int32,
8+
Int32,
9+
Int32,
10+
Int32,
11+
Int32,
12+
Double,
13+
Double,
14+
Double,
15+
Double,
16+
Double,
17+
Double,
18+
Double,
19+
Double,
20+
Int64,
21+
Int8,
22+
Struct1ByteInt,
23+
Int64,
24+
Int8,
25+
Struct4BytesHomogeneousInt16,
26+
Int64,
27+
Int8,
28+
Struct8BytesInt,
29+
Int64,
30+
Int8,
31+
Struct8BytesHomogeneousFloat,
32+
Int64,
33+
Int8,
34+
Struct8BytesMixed,
35+
Int64,
36+
Int8,
37+
StructAlignmentInt16,
38+
Int64,
39+
Int8,
40+
StructAlignmentInt32,
41+
Int64,
42+
Int8,
43+
StructAlignmentInt64),
44+
double Function(
45+
int,
46+
int,
47+
int,
48+
int,
49+
int,
50+
int,
51+
int,
52+
int,
53+
double,
54+
double,
55+
double,
56+
double,
57+
double,
58+
double,
59+
double,
60+
double,
61+
int,
62+
int,
63+
Struct1ByteInt,
64+
int,
65+
int,
66+
Struct4BytesHomogeneousInt16,
67+
int,
68+
int,
69+
Struct8BytesInt,
70+
int,
71+
int,
72+
Struct8BytesHomogeneousFloat,
73+
int,
74+
int,
75+
Struct8BytesMixed,
76+
int,
77+
int,
78+
StructAlignmentInt16,
79+
int,
80+
int,
81+
StructAlignmentInt32,
82+
int,
83+
int,
84+
StructAlignmentInt64)>("PassInt32x8Doublex8Int64Int8Struct1ByteIntInt64Int", isLeaf: true);

benchmark/case/ffi.unit

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
final passInt32x8Doublex8Int64Int8Struct1ByteIntInt64IntLeaf =
2+
ffiTestFunctions.lookupFunction<
3+
Double Function(
4+
Int32,
5+
Int32,
6+
Int32,
7+
Int32,
8+
Int32,
9+
Int32,
10+
Int32,
11+
Int32,
12+
Double,
13+
Double,
14+
Double,
15+
Double,
16+
Double,
17+
Double,
18+
Double,
19+
Double,
20+
Int64,
21+
Int8,
22+
Struct1ByteInt,
23+
Int64,
24+
Int8,
25+
Struct4BytesHomogeneousInt16,
26+
Int64,
27+
Int8,
28+
Struct8BytesInt,
29+
Int64,
30+
Int8,
31+
Struct8BytesHomogeneousFloat,
32+
Int64,
33+
Int8,
34+
Struct8BytesMixed,
35+
Int64,
36+
Int8,
37+
StructAlignmentInt16,
38+
Int64,
39+
Int8,
40+
StructAlignmentInt32,
41+
Int64,
42+
Int8,
43+
StructAlignmentInt64),
44+
double Function(
45+
int,
46+
int,
47+
int,
48+
int,
49+
int,
50+
int,
51+
int,
52+
int,
53+
double,
54+
double,
55+
double,
56+
double,
57+
double,
58+
double,
59+
double,
60+
double,
61+
int,
62+
int,
63+
Struct1ByteInt,
64+
int,
65+
int,
66+
Struct4BytesHomogeneousInt16,
67+
int,
68+
int,
69+
Struct8BytesInt,
70+
int,
71+
int,
72+
Struct8BytesHomogeneousFloat,
73+
int,
74+
int,
75+
Struct8BytesMixed,
76+
int,
77+
int,
78+
StructAlignmentInt16,
79+
int,
80+
int,
81+
StructAlignmentInt32,
82+
int,
83+
int,
84+
StructAlignmentInt64)>("PassInt32x8Doublex8Int64Int8Struct1ByteIntInt64Int", isLeaf: true);

0 commit comments

Comments
 (0)