Alternative LAZ implementation for C++ and JavaScript
C++ Shell Python Makefile CMake M4 Other
Clone or download
Permalink
Failed to load latest commit information.
benchmarks Change TLAZ to LAZPERF throughout. Jan 9, 2015
cmake/modules Fixup laz-perf emscripten build, remove stale toolchain config Jun 8, 2018
emscripten Extrabytes (#56) Jul 6, 2018
examples clean up more windows warnings Feb 2, 2017
laz-perf Add functions for backward compatibility. (#59) Jul 10, 2018
python get python extension happy on windows Jul 12, 2018
scripts/ci whitespace Jan 29, 2017
support New perf tests Apr 25, 2014
test Extrabytes (#56) Jul 6, 2018
.gitignore New docker build script, updates to cmake configuration to build non-… Jun 29, 2018
.travis.yml Add emscripten build to travis Mar 22, 2018
CMakeLists.txt increase version to 1.3.0 Jul 12, 2018
COPYING add licensing info May 14, 2014
README.md Readme updates, docker build first, manual second Jul 12, 2018
Vagrantfile Remove boost test. Replace with gtest. Sep 18, 2015
appveyor.yml Update location of data sets. (#55) Jun 1, 2018
cleanup.sh Benchmark stuff Apr 23, 2014
download-test-sets.sh Update location of data sets. (#55) Jun 1, 2018
emscripten-build.sh Fix travis build, use supplied cmake toolchain for emscripten Jun 8, 2018
emscripten-docker-build.sh New docker build script, updates to cmake configuration to build non-… Jun 29, 2018
hobu-config.bat get lazperf compiling on windows, add appveyor config Jan 29, 2017
lazperf-config.cmake.in Remove the 'laz-perf' from LAZPERF_INCLUDE_DIR Apr 20, 2016
lazperf-configVersion.cmake.in Change TLAZ to LAZPERF throughout. Jan 9, 2015

README.md

Build Status AppVeyor Status

What is this?

Alternative LAZ implementation. It supports compilation and usage in JavaScript, usage in database contexts such as pgpointcloud and Oracle Point Cloud, and it executes faster than the LASzip codebase.

Why?

The Emscripten/WebAssembly output for LASzip to JavaScript was unusably slow. The generated JavaScript code is not going to be a feasible solution to bring LASzip to all browsers. This project provides an alternative implementation that plays nice with Emscripten and provides a more rigorous software engineering approach to a LASzip implementation.

How do I build this?

There are two ways you can build this: using Docker (which may not use the most recent Emscripten SDK) or manually, where you install the Emscripten SDK to your computer and use that for building laz-perf.

Using Docker

If you're a docker commando, you can run the provided docker build script to build both WASM and JS builds like so:

docker run -it -v $(pwd):/src trzeci/emscripten:sdk-incoming-64bit bash emscripten-docker-build.sh

You should then end up with a build-wasm and build-js directories with respective builds.

Manual method

You need to download the most recent version of Emscripten toolchain from Emscripten's Web Page and follow their setup process.

Once done, navigate to the root directory of laz-perf project and make a directory to stage build files in:

git clone https://github.com/hobu/laz-perf.git 
cd laz-perf
mkdir build ; cd build

Then run cmake like so:

cmake .. \
    -DEMSCRIPTEN=1 \
    -DCMAKE_TOOLCHAIN_FILE=<path-to-emsdk>/emscripten/<emsdk-version>/cmake/Modules/Platform/Emscripten.cmake

To perform a WebAssembly build, pass the -DWASM=1 parameter to the command above.

You should now be able to build JS/WASM output like so:

VERBOSE=1 make

Benchmark results so far

All tests were run on a 2013 Macbook Pro 2.6 Ghz Intel Core i7 16GB 1600 MHz DD3. Arithmetic encoder was run on a 4 field struct with two signed and two unsigned fields. Please see the benchmarks/brute.cpp for how these tests were run. The emscriten version used was Emscripten v1.14.0, fastcomp LLVM, JS host: Node v0.10.18

Native:

      Count       Comp Init       Comp Time      Comp Flush     Decomp Init     Decomp Time
       1000        0.000001        0.000279        0.000000        0.000000        0.000297
      10000        0.000000        0.001173        0.000000        0.000000        0.001512
     100000        0.000000        0.009104        0.000000        0.000000        0.011168
    1000000        0.000000        0.082419        0.000000        0.000000        0.108797

Node.js, test runtime JS v0.10.25

      Count       Comp Init       Comp Time      Comp Flush     Decomp Init     Decomp Time
       1000        0.000586        0.014682        0.000273        0.000383        0.008012
      10000        0.000022        0.017960        0.000009        0.000004        0.020219
     100000        0.000030        0.128615        0.000008        0.000004        0.141459
    1000000        0.000010        1.245053        0.000009        0.000005        1.396419

Firefox, v28.0

      Count       Comp Init       Comp Time      Comp Flush     Decomp Init     Decomp Time
       1000        0.000005        0.001311        0.000006        0.000003        0.000820
      10000        0.000003        0.007966        0.000004        0.000001        0.007299
     100000        0.000001        0.062016        0.000003        0.000001        0.064037
    1000000        0.000002        0.662454        0.000009        0.000003        0.673866

Google Chrome, v34.0.1847.116

      Count       Comp Init       Comp Time      Comp Flush     Decomp Init     Decomp Time
       1000        0.000751        0.012357        0.000424        0.000516        0.008413
      10000        0.000016        0.006971        0.000016        0.000004        0.009481
     100000        0.000008        0.059768        0.000009        0.000004        0.070253
    1000000        0.000009        0.576017        0.000019        0.000005        0.658435