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.
diff --git a/benchmark/case/ffi.expect b/benchmark/case/ffi.expect
new file mode 100644
index 0000000..d15ab7a
--- /dev/null
+++ b/benchmark/case/ffi.expect
@@ -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);
diff --git a/benchmark/case/ffi.expect_short b/benchmark/case/ffi.expect_short
new file mode 100644
index 0000000..22201a9
--- /dev/null
+++ b/benchmark/case/ffi.expect_short
@@ -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);
diff --git a/benchmark/case/ffi.unit b/benchmark/case/ffi.unit
new file mode 100644
index 0000000..22201a9
--- /dev/null
+++ b/benchmark/case/ffi.unit
@@ -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);