Repository navigation
Fix and refactor the benchmark suite - #8066
Conversation
215b66f to
668e5a1
Compare
tristen
left a comment
There was a problem hiding this comment.
Tested locally and both versions/styles LGTM 🍭
| <script src="/bench/styles/benchmarks_generated.js"></script> | ||
| <script src="/bench/benchmarks_view_generated.js"></script> | ||
| <script> | ||
| window.Benchmarks.run(benchmarks); |
There was a problem hiding this comment.
Is the benchmarks variable provided by benchmarks_view_generated.js?
There was a problem hiding this comment.
Trying to think through any consequences of calling Benchmark.run for my submodule use case of the benchmark suite. I think its probably fine but I'm just curious the reasoning here.
There was a problem hiding this comment.
@tristen it's provided by index.html and benchmarks.js of each respective benchmark. Styles and versions benchmarks need different treatment here — versions benchmarks group by name in a global variable because versions are ran as separate builds (and we need to keep compat with previous benchmark builds), and styles benchmarks build the benchmarks array in the build itself (because we don't upload them, and they need additional metadata like location).
| import React from 'react'; | ||
| import ReactDOM from 'react-dom'; | ||
| import * as d3 from 'd3'; | ||
| import Axis from './lib/axis'; |
There was a problem hiding this comment.
I kind of wish all the React components weren't defined in one script but 🤷♂️
There was a problem hiding this comment.
I thought it would be nice to put all UI in one file, so that there's clear separation — lib only contains logic that gets insider the different benchmarks builds, and bencharks_view encapsulates all the view logic. As a follow-up, we could split the view components again in a separate folder (e.g. view or components).
There was a problem hiding this comment.
Splitting up the components may be a good opportunity to remove React too. Could be easier to do if the UI is split into smaller, discrete pieces
There was a problem hiding this comment.
Sounds good! Let's follow up with splitting components in a different PR (don't want to blow up the scope of this one too much).
|
|
All the configs are centralized in one file ( |
|
Here's an example timing of loading a benchmark without cache — the first line is v0.53.1, the second is |
* release-liquid: (84 commits) v0.54.0 (take two) (#8184) Fix disappearing controls in Safari 12+ (#8193) (#8194) [docs] token refactor in docs-page-shell (#8174) (#8181) v0.54.0-beta.2 (#8166) Bugfix - removeFeatureState fails with target.id === 0 (#8150) (#8164) update one more frame after canvas source paused (#8130) (#8163) move docs dependencies to dev (#8121) (#8129) v0.54.0 (#8115) CP removeFeatureState fix (#8090) v0.54.0-beta.1 (#8084) Allow setStyle diff by default with localIdeographFontFamily on (#8081) Upgrade various (mostly dev) deps, downgrade GL (#8078) Fix default marker positioning (#8074) Use @mapbox/gazetteer for benchmark coordinates (#8063) bump react-dom to v16.3.3 to fix minor vulnerability warning Fix and refactor the benchmark suite (#8066) Add max width for popups (#7906) Extrusions: Do not try to triangulate non-polygon type features (#7685) docs fixes after the merge limit flow max_workers and upgrade to v0.95.1 (#8061) ...

Fixes benchmarks builds, closes #8064. Gets the uploaded build down from 10MB to 719k.
benchmark_viewbuild again so that React/d3 and UI logic isn't built into benchmark builds