Skip to content

Commit

Permalink
perf(las): Bench laz-perf vs laz-rs versions of LasLoader
Browse files Browse the repository at this point in the history
  • Loading branch information
alekzvik committed Dec 3, 2024
1 parent cee0ede commit e19e7ce
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
24 changes: 24 additions & 0 deletions modules/las/test/las.bench.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// loaders.gl
// SPDX-License-Identifier: MIT
// Copyright (c) vis.gl contributors

import {LAZPerfLoader, LAZRsLoader} from '@loaders.gl/las';
import {fetchFile, load} from '@loaders.gl/core';

const LAZ_URL = '@loaders.gl/las/test/data/indoor.laz';
// const GEO_PARQUET_URL = '@loaders.gl/parquet/test/data/geoparquet/airports.parquet';

export async function lazBench(suite) {
suite.group('ParquetLoader');

const response = await fetchFile(LAZ_URL);
const arrayBuffer = await response.arrayBuffer();

suite.addAsync('load(LAZPerfLoader) - LAZ load', {multiplier: 40000, unit: 'rows'}, async () => {
await load(arrayBuffer, LAZPerfLoader, {worker: false});
});

suite.addAsync('load(LAZRsLoader) - LAZ load', {multiplier: 40000, unit: 'rows'}, async () => {
await load(arrayBuffer, LAZRsLoader, {worker: false});
});
}
2 changes: 2 additions & 0 deletions test/bench/modules.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import dracoBench from '@loaders.gl/draco/test/draco.bench';
import excelBench from '@loaders.gl/excel/test/excel.bench';
import imageBench from '@loaders.gl/images/test/images.bench';
import jsonBench from '@loaders.gl/json/test/json-loader.bench';
import {lazBench} from '@loaders.gl/las/test/las.bench';
// import mvtBench from '@loaders.gl/mvt/test/mvt-loader.bench';
import {parquetBench} from '@loaders.gl/parquet/test/parquet.bench';
// import shapefileBench from '@loaders.gl/shapefile/test/shapefile.bench';
Expand Down Expand Up @@ -42,6 +43,7 @@ export async function addModuleBenchmarksToSuite(suite) {
await dracoBench(suite);
await csvBench(suite);
await excelBench(suite);
await lazBench(suite);

// await i3sLoaderBench(suite);
}

0 comments on commit e19e7ce

Please sign in to comment.