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

Benchmark with pure-JS CRC32C implementations #82

Open
trivikr opened this issue Apr 27, 2021 · 0 comments
Open

Benchmark with pure-JS CRC32C implementations #82

trivikr opened this issue Apr 27, 2021 · 0 comments

Comments

@trivikr
Copy link

trivikr commented Apr 27, 2021

Describe the bug

The benchmarking is done against pure JS CRC32 implementation, although it calls it CRC32C

}, {
title: 'JavaScript (table-based) CRC-32C',
fn: () => jsCrc32(TEST_BUFFER, false)
}, {
title: 'JavaScript (direct) CRC-32C',
fn: () => jsCrc32(TEST_BUFFER, true)
}]

Steps to reproduce

replit https://replit.com/@trivikr/test-sse4crc32-benchmark
Online CRC32 calculator https://crccalc.com/?crc=123456789&method=crc32&datatype=ascii&outtype=hex

Code
const crc32 = require("crc32");
const sse4_crc32 = require("sse4_crc32");
const junderw_crc32c = require("junderw-crc32c");

const testString = "123456789";
console.log(crc32(testString).toString(16));
console.log(sse4_crc32.table_crc(testString).toString(16));
console.log((junderw_crc32c.str(testString) >>> 0).toString(16));

Observed behavior

In replit, the crc32 package returns CRC32 checksum instead of CRC32C checksum

Expected behavior

The benchmarking of CRC32C checksum by sse4_crc32 should be done against another pure-JS CRC32C checksum implementation like junderw-crc32c and not crc32

Additional context

I noticed this while writing my own CRC32 benchmark in https://github.com/trivikr/benchmark-crc32

@trivikr trivikr changed the title Benchmarking should be done with CRC32C implementations and not CRC32 implementation Benchmark with CRC32C implementations and not CRC32 implementation Apr 27, 2021
@trivikr trivikr changed the title Benchmark with CRC32C implementations and not CRC32 implementation Benchmark with pure-JS CRC32C implementations Apr 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant