Skip to content

Commit

Permalink
Add benchmarks for symbol layer with icons
Browse files Browse the repository at this point in the history
  • Loading branch information
alexshalamov committed Nov 11, 2019
1 parent 2b78798 commit f47a5a6
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
19 changes: 19 additions & 0 deletions bench/benchmarks/layers.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,3 +220,22 @@ export class LayerSymbol extends LayerBenchmark {
});
}
}

export class LayerSymbolWithIcons extends LayerBenchmark {
constructor() {
super();

this.layerStyle = Object.assign({}, style, {
layers: generateLayers({
'id': 'symbollayer',
'type': 'symbol',
'source': 'composite',
'source-layer': 'poi_label',
'layout': {
'icon-image': 'dot-11',
'text-field': ['format', ['get', 'name_en'], ['image', 'dot-11']]
}
})
});
}
}
3 changes: 2 additions & 1 deletion bench/versions/benchmarks.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import WorkerTransfer from '../benchmarks/worker_transfer';
import Paint from '../benchmarks/paint';
import PaintStates from '../benchmarks/paint_states';
import {PropertyLevelRemove, FeatureLevelRemove, SourceLevelRemove} from '../benchmarks/remove_paint_state';
import {LayerBackground, LayerCircle, LayerFill, LayerFillExtrusion, LayerHeatmap, LayerHillshade, LayerLine, LayerRaster, LayerSymbol} from '../benchmarks/layers';
import {LayerBackground, LayerCircle, LayerFill, LayerFillExtrusion, LayerHeatmap, LayerHillshade, LayerLine, LayerRaster, LayerSymbol, LayerSymbolWithIcons} from '../benchmarks/layers';
import Load from '../benchmarks/map_load';
import Validate from '../benchmarks/style_validate';
import StyleLayerCreate from '../benchmarks/style_layer_create';
Expand Down Expand Up @@ -63,6 +63,7 @@ register('LayerHillshade', new LayerHillshade());
register('LayerLine', new LayerLine());
register('LayerRaster', new LayerRaster());
register('LayerSymbol', new LayerSymbol());
register('LayerSymbolWithIcons', new LayerSymbolWithIcons());
register('Load', new Load());
register('LayoutDDS', new LayoutDDS());
register('SymbolLayout', new SymbolLayout(style, styleLocations.map(location => location.tileID[0])));
Expand Down

0 comments on commit f47a5a6

Please sign in to comment.