[swift-dev] Using gyb with benchmarks

Luke Larson llarson at apple.com
Thu Apr 6 15:40:55 CDT 2017


> On Apr 6, 2017, at 1:14 PM, Pavol Vaskovic via swift-dev <swift-dev at swift.org> wrote:
> 
> On Thursday, 6 April 2017 at 19:44, Michael Gottesman wrote:
>>> On Apr 6, 2017, at 6:16 AM, Pavol Vaskovic via swift-dev <swift-dev at swift.org (mailto:swift-dev at swift.org)> wrote:
>>> 
>>> ...
>>> How do I make benchmarks work with gyb?
>> 
> 
> Upon further inspection, one needs to regenerate harness _after_ modifying the gyb anyway, so manually invoking gyb works fine for now, given the [FILE].swift.gyb is ignored by the benchmarking and compilation machinery.
> 
> Is that so bad to add .gyb templates alongside the .swift sources and generate the boilerplate as a first step when generating harness?
> 
>> 
>> Please do not do this. We have been talking about switching the benchmarks to use swiftpm instead of our own custom cmake goop. swiftpm does not support using custom things like gyb.
>> 
>> Michael
> What’s the motivation here? I’m guessing GYB will not be removed from other parts of project… The benchmark files for sequence operations I’ve been looking at are ripe for templating, reducing possibility to make accidental errors when adding new variations.
One of the goals for the benchmark suite is for it to not depend on things outside of the benchmarks folder. It works with the Swift build system but doesn’t require it. This allows someone to distribute the benchmarks folder as a standalone entity and use it without having to execute the Swift build system.

I’d recommend using a scheme like we use for generating the harness files.

Luke

> 
> I’m about to add coverage for a lot more of sequence operations, as their current performance is horrible. These are almost identical, varying only by the concrete type of sequence/collection tested, plus lazy variants. Being able to automate this seems vital to me.
> 
> Best regards
> Pavol Vaskovic
> 
> 
> 
> _______________________________________________
> swift-dev mailing list
> swift-dev at swift.org
> https://lists.swift.org/mailman/listinfo/swift-dev



More information about the swift-dev mailing list