Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf(las): Bench laz-perf vs laz-rs versions of LasLoader #3171

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions modules/las/test/las.bench.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// 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';

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

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

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

suite.addAsync('load(LAZRsLoader) - LAZ load', {}, 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);
}
Loading