1
1
// @flow
2
2
3
- require ( '../src' ) . accessToken = require ( './lib/access_token' ) ;
3
+ import mapboxgl from '../src' ;
4
+ import accessToken from './lib/access_token' ;
5
+ mapboxgl . accessToken = accessToken ;
4
6
5
7
window . mapboxglVersions = window . mapboxglVersions || [ ] ;
6
8
window . mapboxglBenchmarks = window . mapboxglBenchmarks || { } ;
@@ -13,19 +15,36 @@ function register(Benchmark) {
13
15
window . mapboxglBenchmarks [ Benchmark . name ] [ version ] = new Benchmark ( ) ;
14
16
}
15
17
16
- register ( require ( './benchmarks/layout' ) ) ;
17
- register ( require ( './benchmarks/layout_dds' ) ) ;
18
- register ( require ( './benchmarks/paint' ) ) ;
19
- require ( './benchmarks/layers' ) . forEach ( register ) ;
20
- register ( require ( './benchmarks/map_load' ) ) ;
21
- register ( require ( './benchmarks/style_validate' ) ) ;
22
- register ( require ( './benchmarks/style_layer_create' ) ) ;
23
- register ( require ( './benchmarks/query_point' ) ) ;
24
- register ( require ( './benchmarks/query_box' ) ) ;
25
- require ( './benchmarks/expressions' ) . forEach ( register ) ;
26
- register ( require ( './benchmarks/filter_create' ) ) ;
27
- register ( require ( './benchmarks/filter_evaluate' ) ) ;
18
+ import Layout from './benchmarks/layout' ;
19
+ import LayoutDDS from './benchmarks/layout_dds' ;
20
+ import Paint from './benchmarks/paint' ;
21
+ import LayerBenchmarks from './benchmarks/layers' ;
22
+ import Load from './benchmarks/map_load' ;
23
+ import Validate from './benchmarks/style_validate' ;
24
+ import StyleLayerCreate from './benchmarks/style_layer_create' ;
25
+ import QueryPoint from './benchmarks/query_point' ;
26
+ import QueryBox from './benchmarks/query_box' ;
27
+ import ExpressionBenchmarks from './benchmarks/expressions' ;
28
+ import FilterCreate from './benchmarks/filter_create' ;
29
+ import FilterEvaluate from './benchmarks/filter_evaluate' ;
28
30
31
+ register ( Layout ) ;
32
+ register ( LayoutDDS ) ;
33
+ register ( Paint ) ;
34
+ LayerBenchmarks . forEach ( register ) ;
35
+ register ( Load ) ;
36
+ register ( Validate ) ;
37
+ register ( StyleLayerCreate ) ;
38
+ register ( QueryPoint ) ;
39
+ register ( QueryBox ) ;
40
+ ExpressionBenchmarks . forEach ( register ) ;
41
+ register ( FilterCreate ) ;
42
+ register ( FilterEvaluate ) ;
43
+
44
+ import getWorkerPool from '../src/util/global_worker_pool' ;
45
+ // Set up the worker blob URL--written to window.mapboxGlWorkerUrl before this
46
+ // module is executed--before acquiring workers.
47
+ mapboxgl . workerUrl = window . mapboxGlWorkerUrl ;
29
48
// Ensure the global worker pool is never drained. Browsers have resource limits
30
49
// on the max number of workers that can be created per page.
31
- require ( '../src/util/global_worker_pool' ) ( ) . acquire ( - 1 ) ;
50
+ getWorkerPool ( ) . acquire ( - 1 ) ;
0 commit comments