ampproject / amp-toolbox

A collection of AMP tools making it easier to publish and host AMP pages.
Apache License 2.0
449 stars 243 forks source link

Add minimal Optimizer Transformer Config #1180

Closed sebastianbenz closed 3 years ago

sebastianbenz commented 3 years ago

Results:

minimal x 147 ops/sec ±38.65% (72 runs sampled) 6.816074326178452ms
default x 6.93 ops/sec ±11.41% (40 runs sampled) 144.290958325ms
Fastest is minimal
sebastianbenz commented 3 years ago

Traced the individual transformer execution times:

AddMandatoryTags: 0.465ms
Markdown: 0.055ms
AutoExtensionImporter: 68.673ms
OptimizeImages: 0.059ms
OptimizeHeroImage: 1.654ms
OptimizeAmpBind: 0.071ms
ServerSideRendering: 3.025ms
AmpBoilerplateTransformer: 0.116ms
ReorderHeadTransformer: 0.429ms
RewriteAmpUrls: 0.497ms
GoogleFontsPreconnect: 0.107ms
PruneDuplicateResourceHints: 0.165ms
AddBlurryImagePlaceholders: 0.085ms
SeparateKeyframes: 317.038ms
AddTransformedFlag: 0.042ms
MinifyHtml: 6.029ms
AmpScriptCsp: 0.631ms

Maybe we should get rid of SeparateKeyframes...since we've raised the CSS limit it's less of a concern.