Skip to content

Commit 145c697

Browse files
author
PSPDFKit
committed
PSPDFKit WebAssembly Benchmark
0 parents  commit 145c697

File tree

23 files changed

+29551
-0
lines changed

23 files changed

+29551
-0
lines changed

.gitignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# See https://help.github.com/ignore-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
6+
# testing
7+
/coverage
8+
9+
# production
10+
/build
11+
12+
# artifacts
13+
/public/vendor
14+
15+
# misc
16+
.DS_Store
17+
.env.local
18+
.env.development.local
19+
.env.test.local
20+
.env.production.local
21+
22+
npm-debug.log*
23+
yarn-debug.log*
24+
yarn-error.log*

LICENSE

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
The Nutrient Web SDK component is under a commercial license.
2+
Ping [email protected] for details.
3+
4+
The remaining benchmark code is under MIT:
5+
6+
The MIT License (MIT)
7+
8+
Copyright (c) 2018-present PSPDFKit GmbH (www.nutrient.io)
9+
10+
Permission is hereby granted, free of charge, to any person obtaining a copy
11+
of this software and associated documentation files (the "Software"), to deal
12+
in the Software without restriction, including without limitation the rights
13+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14+
copies of the Software, and to permit persons to whom the Software is
15+
furnished to do so, subject to the following conditions:
16+
17+
The above copyright notice and this permission notice shall be included in
18+
all copies or substantial portions of the Software.
19+
20+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
26+
THE SOFTWARE.

README.md

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
> ⚠️ **Repository Moved**
2+
> This repository has been moved to https://github.com/PSPDFKit/nutrient-web-examples/tree/main/examples/wasm-benchmark.
3+
> Please update your bookmarks and issues accordingly.
4+
>
5+
> This repo is now archived and will no longer receive updates.
6+
7+
<center>
8+
<a href="http://iswebassemblyfastyet.com/">
9+
<img src="https://www.nutrient.io/assets/images/blog/2018/webassembly-benchmark/article-header.png?commit=d5901d372044382ad59d52a0dac7d4a136db7816" width="1000" style="max-width: 100%;">
10+
</a>
11+
</center>
12+
13+
# WebAssembly Benchmark by Nutrient
14+
15+
A Benchmark for WebAssembly (Wasm, WA) that uses [Nutrient Web](https://www.nutrient.io/sdk/web/) Standalone.
16+
17+
The rendering engine of [Nutrient Web](https://www.nutrient.io/sdk/web/) Standalone is written in C/C++ and compiled to Wasm.
18+
19+
Get your score in the [live demo](http://iswebassemblyfastyet.com/) and learn more in our [blog post](https://www.nutrient.io/blog/2018/a-real-world-webassembly-benchmark/).
20+
21+
## Prerequisites
22+
23+
- [Node.js](http://nodejs.org/) (with npm or Yarn)
24+
- A Nutrient Web license. If you don't already have one
25+
you can [request a free trial here](https://www.nutrient.io/try/).
26+
27+
## Getting Started
28+
29+
Install the `nutrient` npm package and move all contents to the vendor directory.
30+
31+
```bash
32+
npm install --save @nutrient-sdk/viewer
33+
mkdir -p public/vendor
34+
cp -R node_modules/nutrient/dist public/vendor/nutrient
35+
```
36+
37+
Bootstrap the project by installing all the other dependencies.
38+
39+
```bash
40+
npm install
41+
```
42+
43+
## Running the Benchmark
44+
45+
Now that Nutrient Web is installed, you need to copy your product (license) key to the `public/license-key` file.
46+
47+
We can now run the benchmark server:
48+
49+
```bash
50+
npm start
51+
```
52+
53+
The benchmark is available at `http://localhost:3000`.
54+
55+
## Building a Production Version
56+
57+
You can build an optimized version using the following command:
58+
59+
```bash
60+
PUBLIC_URL="/webassembly-benchmark/" npm run build
61+
```
62+
63+
Where `PUBLIC_URL` must be set according to the final URL, where the application is hosted.
64+
65+
## Optimizations
66+
67+
The following optimizations can be enabled via URL parameter:
68+
69+
- `disableWebAssemblyStreaming`, `true` by default
70+
- `standaloneInstancesPoolSize`, `0` by default
71+
- `runsScaleFactor`, scales the number of test runs, `1` by default
72+
73+
## What's in This Repository
74+
75+
This repository contains files used to build the [Nutrient WebAssembly benchmark](http://iswebassemblyfastyet.com/).
76+
77+
The source files are structured into two different categories:
78+
79+
- `src/lib` contains all files necessary to set up the test suite including the individual tests and helper functions.
80+
- `src/ui` contains a [React](https://reactjs.org/) application that is used to render the user interface.
81+
82+
For a main entry point, have a look at `src/index.js`.
83+
84+
## License
85+
86+
This software is licensed under [the MIT license](LICENSE).
87+
88+
## Contributing
89+
90+
Please ensure
91+
[you have signed our CLA](https://www.nutrient.io/guides/web/current/miscellaneous/contributing/) so that we can
92+
accept your contributions.

config/license-key

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

license-key

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

0 commit comments

Comments
 (0)