Skip to content

Commit

Permalink
Add benchmark for some dart:ffi code that was slow in the old formatter.
Browse files Browse the repository at this point in the history
In the new formatter, it's about 3000x faster.

Fix #1066.
  • Loading branch information
munificent committed Aug 6, 2024
1 parent 8a8e4f5 commit fc134cd
Show file tree
Hide file tree
Showing 3 changed files with 255 additions and 0 deletions.
87 changes: 87 additions & 0 deletions benchmark/case/ffi.expect
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
final passInt32x8Doublex8Int64Int8Struct1ByteIntInt64IntLeaf = ffiTestFunctions
.lookupFunction<
Double Function(
Int32,
Int32,
Int32,
Int32,
Int32,
Int32,
Int32,
Int32,
Double,
Double,
Double,
Double,
Double,
Double,
Double,
Double,
Int64,
Int8,
Struct1ByteInt,
Int64,
Int8,
Struct4BytesHomogeneousInt16,
Int64,
Int8,
Struct8BytesInt,
Int64,
Int8,
Struct8BytesHomogeneousFloat,
Int64,
Int8,
Struct8BytesMixed,
Int64,
Int8,
StructAlignmentInt16,
Int64,
Int8,
StructAlignmentInt32,
Int64,
Int8,
StructAlignmentInt64,
),
double Function(
int,
int,
int,
int,
int,
int,
int,
int,
double,
double,
double,
double,
double,
double,
double,
double,
int,
int,
Struct1ByteInt,
int,
int,
Struct4BytesHomogeneousInt16,
int,
int,
Struct8BytesInt,
int,
int,
Struct8BytesHomogeneousFloat,
int,
int,
Struct8BytesMixed,
int,
int,
StructAlignmentInt16,
int,
int,
StructAlignmentInt32,
int,
int,
StructAlignmentInt64,
)
>("PassInt32x8Doublex8Int64Int8Struct1ByteIntInt64Int", isLeaf: true);
84 changes: 84 additions & 0 deletions benchmark/case/ffi.expect_short
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
final passInt32x8Doublex8Int64Int8Struct1ByteIntInt64IntLeaf =
ffiTestFunctions.lookupFunction<
Double Function(
Int32,
Int32,
Int32,
Int32,
Int32,
Int32,
Int32,
Int32,
Double,
Double,
Double,
Double,
Double,
Double,
Double,
Double,
Int64,
Int8,
Struct1ByteInt,
Int64,
Int8,
Struct4BytesHomogeneousInt16,
Int64,
Int8,
Struct8BytesInt,
Int64,
Int8,
Struct8BytesHomogeneousFloat,
Int64,
Int8,
Struct8BytesMixed,
Int64,
Int8,
StructAlignmentInt16,
Int64,
Int8,
StructAlignmentInt32,
Int64,
Int8,
StructAlignmentInt64),
double Function(
int,
int,
int,
int,
int,
int,
int,
int,
double,
double,
double,
double,
double,
double,
double,
double,
int,
int,
Struct1ByteInt,
int,
int,
Struct4BytesHomogeneousInt16,
int,
int,
Struct8BytesInt,
int,
int,
Struct8BytesHomogeneousFloat,
int,
int,
Struct8BytesMixed,
int,
int,
StructAlignmentInt16,
int,
int,
StructAlignmentInt32,
int,
int,
StructAlignmentInt64)>("PassInt32x8Doublex8Int64Int8Struct1ByteIntInt64Int", isLeaf: true);
84 changes: 84 additions & 0 deletions benchmark/case/ffi.unit
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
final passInt32x8Doublex8Int64Int8Struct1ByteIntInt64IntLeaf =
ffiTestFunctions.lookupFunction<
Double Function(
Int32,
Int32,
Int32,
Int32,
Int32,
Int32,
Int32,
Int32,
Double,
Double,
Double,
Double,
Double,
Double,
Double,
Double,
Int64,
Int8,
Struct1ByteInt,
Int64,
Int8,
Struct4BytesHomogeneousInt16,
Int64,
Int8,
Struct8BytesInt,
Int64,
Int8,
Struct8BytesHomogeneousFloat,
Int64,
Int8,
Struct8BytesMixed,
Int64,
Int8,
StructAlignmentInt16,
Int64,
Int8,
StructAlignmentInt32,
Int64,
Int8,
StructAlignmentInt64),
double Function(
int,
int,
int,
int,
int,
int,
int,
int,
double,
double,
double,
double,
double,
double,
double,
double,
int,
int,
Struct1ByteInt,
int,
int,
Struct4BytesHomogeneousInt16,
int,
int,
Struct8BytesInt,
int,
int,
Struct8BytesHomogeneousFloat,
int,
int,
Struct8BytesMixed,
int,
int,
StructAlignmentInt16,
int,
int,
StructAlignmentInt32,
int,
int,
StructAlignmentInt64)>("PassInt32x8Doublex8Int64Int8Struct1ByteIntInt64Int", isLeaf: true);

0 comments on commit fc134cd

Please sign in to comment.