Runs faster

This commit is contained in:
Chris Tsang
2020-10-29 11:20:33 +08:00
parent 7a62846470
commit 2243d107d5
53 changed files with 59 additions and 51 deletions
Executable → Regular
View File
Executable → Regular
View File
Executable → Regular
View File
Executable → Regular
View File
Executable → Regular
View File
+1 -1
View File
File diff suppressed because one or more lines are too long
Binary file not shown.
Executable → Regular
View File

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Executable → Regular
View File

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 52 KiB

View File

Before

Width:  |  Height:  |  Size: 249 KiB

After

Width:  |  Height:  |  Size: 249 KiB

View File

Before

Width:  |  Height:  |  Size: 1.1 MiB

After

Width:  |  Height:  |  Size: 1.1 MiB

View File

Before

Width:  |  Height:  |  Size: 250 KiB

After

Width:  |  Height:  |  Size: 250 KiB

View File

Before

Width:  |  Height:  |  Size: 240 KiB

After

Width:  |  Height:  |  Size: 240 KiB

View File

Before

Width:  |  Height:  |  Size: 842 KiB

After

Width:  |  Height:  |  Size: 842 KiB

View File

Before

Width:  |  Height:  |  Size: 154 KiB

After

Width:  |  Height:  |  Size: 154 KiB

View File

Before

Width:  |  Height:  |  Size: 2.8 MiB

After

Width:  |  Height:  |  Size: 2.8 MiB

View File
View File

Before

Width:  |  Height:  |  Size: 304 KiB

After

Width:  |  Height:  |  Size: 304 KiB

View File

Before

Width:  |  Height:  |  Size: 3.9 MiB

After

Width:  |  Height:  |  Size: 3.9 MiB

View File
View File

Before

Width:  |  Height:  |  Size: 2.2 MiB

After

Width:  |  Height:  |  Size: 2.2 MiB

View File

Before

Width:  |  Height:  |  Size: 5.3 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

View File

Before

Width:  |  Height:  |  Size: 5.3 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

+1 -1
View File
@@ -258,7 +258,7 @@
/******/ promises.push(installedWasmModuleData); /******/ promises.push(installedWasmModuleData);
/******/ else { /******/ else {
/******/ var importObject = wasmImportObjects[wasmModuleId](); /******/ var importObject = wasmImportObjects[wasmModuleId]();
/******/ var req = fetch(__webpack_require__.p + "" + {"../pkg/vtracer_bg.wasm":"34e06406170859162632"}[wasmModuleId] + ".module.wasm"); /******/ var req = fetch(__webpack_require__.p + "" + {"../pkg/vtracer_bg.wasm":"a56b184573f85c442cd0"}[wasmModuleId] + ".module.wasm");
/******/ var promise; /******/ var promise;
/******/ if(importObject instanceof Promise && typeof WebAssembly.compileStreaming === 'function') { /******/ if(importObject instanceof Promise && typeof WebAssembly.compileStreaming === 'function') {
/******/ promise = Promise.all([WebAssembly.compileStreaming(req), importObject]).then(function(items) { /******/ promise = Promise.all([WebAssembly.compileStreaming(req), importObject]).then(function(items) {
Executable → Regular
View File

Before

Width:  |  Height:  |  Size: 160 KiB

After

Width:  |  Height:  |  Size: 160 KiB

Executable → Regular
View File

Before

Width:  |  Height:  |  Size: 192 KiB

After

Width:  |  Height:  |  Size: 192 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.5 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Executable → Regular
View File
Executable → Regular
View File
Vendored Executable → Regular
View File
Executable → Regular
View File
Vendored Executable → Regular
View File
Executable → Regular
View File
Vendored Executable → Regular
View File
Executable → Regular
View File
Vendored Executable → Regular
View File
Executable → Regular
View File
Executable → Regular
View File
Executable → Regular
View File
Vendored Executable → Regular
View File
Executable → Regular
View File
Executable → Regular
+12 -4
View File
@@ -267,25 +267,33 @@ class ConverterRunner {
svg.style.background = ''; svg.style.background = '';
canvas.style.display = ''; canvas.style.display = '';
} }
canvas.style.opacity = '';
} }
run () { run () {
const This = this; const This = this;
requestAnimationFrame(function tick () { setTimeout(function tick () {
if (!This.stopped) { if (!This.stopped) {
if (!This.converter.tick()) { let done = false;
const startTick = performance.now();
while (!(done = This.converter.tick()) &&
performance.now() - startTick < 25) {
}
progress.value = This.converter.progress(); progress.value = This.converter.progress();
if (progress.value >= 50) { if (progress.value >= 50) {
canvas.style.display = 'none'; canvas.style.display = 'none';
} else {
canvas.style.opacity = (50 - progress.value) / 25;
} }
if (progress.value >= progress.max) { if (progress.value >= progress.max) {
progressregion.style.display = 'none'; progressregion.style.display = 'none';
progress.value = 0; progress.value = 0;
} }
requestAnimationFrame(tick); if (!done) {
setTimeout(tick, 1);
} }
} }
}); }, 1);
} }
stop () { stop () {
Generated Executable → Regular
View File
Executable → Regular
View File
Executable → Regular
View File
Executable → Regular
View File
Executable → Regular
View File
View File
View File
Executable → Regular
View File
Executable → Regular
View File
Executable → Regular
View File
Executable → Regular
View File