Three issues addressed here:
1. Dependency on dictionary iteration order
CharacterProperties.swift.gyb iterated a dictionary to produce its output.
Changed this to a list of tuples to ensure the order is predictable.
2. Python3 `map` returns an iterator, not a list
Changed a bunch of `map` calls to `list(map(...))` to ensure the result is a list
3. Python3 `int()` expects a string, won't accept a list of characters
Added a concatenation step that is effectively a no-op on Python2
I didn't do this for swiftpm as well since when I tried passing this via
unsafeFlags to swiftpm, swiftpm just created the opt-remarks in my source
directory instead of next to the .o in the build directory. A problem for
another time.
Clean up a few general patterns that are now obviated by canImport
This aligns more generally with the cleanup that the Swift Package
Manager has already done in their automated XCTest-plumbing tool in
apple/swift-package-manager#1826.
* Add benchmarks for Substring.dropFirst(_:) and dropLast(_:)
These are self-slicing operations, so they should be fast even for
this non-random-access collection.
* Fiddle with the iteration count and length
run_smoke_bench script fails to report code size changes if you have a
trailing '/' in <old_build_dir> but not <new_build_dir>.
This change appends a separator if it is missing
The `-force-single-frontend-invocation` flag predates WMO and is now an
alias for `-whole-module-optimization`. We should use the latter and let
the former fade into history.
Add an option to allow compiling the benchmark test utilities and driver
at -Onone. This is needed because lldb does not support stepping through
optimized swift code.
On Darwin, we pass the *.swiftmodule paths transitively referenced by
the driver executable to ld64. ld64 inserts N_AST references to these
modules into the program, for later use by lldb.
This change should let us exercise much more lldb functionality via
`stepper` testing.
I am going to be adding a variant of this that uses
Unmanaged._withUnsafeGuaranteedRef(...). To truly make it fair, I am
adding variants that also use an access ref entrypoint.
I am going to add a version of this that tests that Unmanaged._withUGR
gives us expected performance. So we really need both versions of all of
the four current benchmarks to make this truly fair.