diff --git a/examples/buffer.html b/examples/buffer.html deleted file mode 100644 index a9e46ee..0000000 --- a/examples/buffer.html +++ /dev/null @@ -1,51 +0,0 @@ - - - -Examples - Buffer - - -

Buffer

- -List - Source - WebAssembly - -
- - - - - - - diff --git a/examples/buffer.py b/examples/buffer.py deleted file mode 100644 index 8fe6570..0000000 --- a/examples/buffer.py +++ /dev/null @@ -1,7 +0,0 @@ -@exported -def index(inp: bytes, idx: u32) -> u8: - return inp[idx] - -@exported -def length(inp: bytes) -> u32: - return len(inp) diff --git a/examples/crc32.html b/examples/crc32.html index e78505c..c176fdf 100644 --- a/examples/crc32.html +++ b/examples/crc32.html @@ -2,245 +2,68 @@ Examples - CRC32 + -

Buffer

+

Examples - CRC32

-List - Source - WebAssembly
-
-Note: This tests performs some timing comparison, please wait a few seconds for the results.
-
+ -

Measurement log

-

AMD Ryzen 7 3700X 8-Core, Ubuntu 20.04, Linux 5.4.0-124-generic

-

After optimizing fold over bytes by inlineing __subscript_bytes__

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TestInterpreterSetupWebAssemblyJavascript
Lynx * 65536Chromium 104.0.5112.101DevTools closed5.7012.45
Lynx * 65536Firefox 103DevTools closed5.165.72
Lynx * 1048576Chromium 104.0.5112.101DevTools closed95.65203.60
Lynx * 1048576Firefox 103DevTools closed83.3492.38
-

Before optimizing fold over bytes by inlineing __subscript_bytes__

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
+

+ This example shows a fold implementation of a cyclic redundancy check. + There are actually many variations of these CRCs - this one is specifically know as CRC-32/ISO-HDLC. +

+
- - - - - - - - - - - - - - -
TestInterpreterSetupWebAssemblyJavascript
Lynx * 65536Chromium 104.0.5112.101DevTools closed9.3512.56
Lynx * 65536Chromium 104.0.5112.101DevTools open14.7112.72
Lynx * 65536Chromium 104.0.5112.101Record page load9.4412.69
Lynx * 65536Firefox 103DevTools closed9.025.86
Lynx * 65536Firefox 103DevTools open9.015.83
Lynx * 65536Firefox 103Record page load72.415.85
Lynx * 1048576Chromium 104.0.5112.101DevTools closed149.24202.36
Lynx * 1048576Firefox 103DevTools closed145.0191.44
+

Try it out!

+
+
+ + +
-

Notes

-- Firefox seems faster than Chromium in my setup for Javascript, WebAssembly seems about the same.
-- Having DevTools open in Chromium seems to slow down the WebAssembly by about 30%, but not when doing a recording of the page load.
-- WebAssembly in Firefox seems to slow down when doing a recording of the page load, which makes sense, but the Javascript does not.
+
+