mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
This adds two benchmarks, one for flights-app which doesn't use data binding and one for city-list which uses lots of it. 1st runs in each benchmark contain the cost of collecting all the metadata about bindings and templates in addition to creating instances. Later runs only contain the cost of creating instances. Overall it looks like SkyBinder is 24.4% - 35.5% faster depending on if you're using data binding (the performance improvement is larger if you are). It also appears to put less pressure on the GC. == flights-app.sky benchmark == TemplateBinding: flights-app.sky => [103.0, 27.0, 26.0, 26.0, 27.0, 26.0, 39.0, 29.0, 29.0, 72.0] flights-app.sky => [101.0, 27.0, 27.0, 27.0, 27.0, 26.0, 37.0, 33.0, 26.0, 69.0] flights-app.sky => [103.0, 27.0, 26.0, 26.0, 27.0, 26.0, 37.0, 27.0, 28.0, 71.0] 1st run avg = 102.33333333333333 avg = 33.148148148148145 SkyBinder: flights-app.sky => [78.0, 25.0, 25.0, 25.0, 25.0, 30.0, 34.0, 26.0, 25.0, 32.0] flights-app.sky => [77.0, 28.0, 25.0, 26.0, 26.0, 28.0, 31.0, 23.0, 26.0, 26.0] flights-app.sky => [77.0, 25.0, 25.0, 24.0, 25.0, 28.0, 31.0, 23.0, 25.0, 24.0] 1st run avg = 77.33333333333333 avg = 26.51851851851852 24.4% reduction for 1st run, 20% reduction for normal runs. Normal runs actually seem maybe only 5% faster, but it looks like pre SkyBinder there were occasional runs that took 250% longer than normal from GC pauses. If I increase the iteration count for SkyBinder I can see those long pauses again, but they're much less frequent presumably because SkyBinder creates less garbage. == city-list.sky benchmark == TemplateBinding: city-list.sky => [820.0, 609.0, 600.0, 529.0, 430.0, 437.0, 387.0, 462.0, 541.0, 415.0] city-list.sky => [827.0, 599.0, 551.0, 481.0, 436.0, 425.0, 363.0, 366.0, 427.0, 364.0] city-list.sky => [823.0, 574.0, 467.0, 483.0, 444.0, 429.0, 364.0, 363.0, 433.0, 367.0] 1st run avg = 823.3333333333334 avg = 457.25925925925924 SkyBinder: city-list.sky => [521.0, 369.0, 320.0, 285.0, 319.0, 273.0, 267.0, 262.0, 272.0, 331.0] city-list.sky => [553.0, 362.0, 314.0, 284.0, 327.0, 278.0, 263.0, 264.0, 249.0, 290.0] city-list.sky => [556.0, 355.0, 317.0, 289.0, 333.0, 277.0, 269.0, 266.0, 264.0, 263.0] 1st run avg = 543.3333333333334 avg = 294.8888888888889 34% reduction for 1st run, 35.5% reduction for subsequent runs. This also shows less variance in the later runs than pre SkyBinder which I think might again be less GC pressure. TBR=ojan@chromium.org BUG= Review URL: https://codereview.chromium.org/834983002