Comments (5)
See discussion here: browserify/sha.js@91649a6#commitcomment-4964325
from buffer.
Wow, looks like it's better to just get rid of the DataView and do bit ops manually! cc @dominictarr @substack @maxogden
Perf before:
FIREFOX: "NewBuffer#readUInt32LE x 1,221,113 ops/sec ±1.41% (67 runs sampled)"
FIREFOX: "NewBuffer#readUInt32BE x 1,156,194 ops/sec ±0.33% (68 runs sampled)"
CHROME: NewBuffer#readUInt32LE x 564,154 ops/sec ±0.26% (69 runs sampled)
CHROME: NewBuffer#readUInt32BE x 494,371 ops/sec ±0.47% (69 runs sampled)
Perf after:
FIREFOX: "NewBuffer#readUInt32LE x 1,554,848 ops/sec ±0.64% (67 runs sampled)"
FIREFOX: "NewBuffer#readUInt32BE x 1,511,584 ops/sec ±0.68% (66 runs sampled)"
CHROME: NewBuffer#readUInt32LE x 963,040 ops/sec ±0.30% (69 runs sampled)
CHROME: NewBuffer#readUInt32BE x 823,859 ops/sec ±1.19% (70 runs sampled)
Size Before:
$ browserify -r native-buffer-browserify | wc -c
37762
Size after:
$ browserify -r native-buffer-browserify | wc -c
34034
from buffer.
Published as 2.0.2.
from buffer.
Wat!? how come that is faster!
from buffer.
No idea! My guess is that DataView isn't used much in production code yet, so the browsers haven't taken the time to optimize it heavily yet.
from buffer.
Related Issues (20)
- Buffer treats decimal numbers mod 100?? HOT 5
- writeBigUint64BE isn't defined, but writeBigUInt64BE is HOT 1
- TypeError: writeUint32LE is not a function
- Property storage exceeds 196607 properties, js engine: hermes HOT 1
- Uncaught SyntaxError: Cannot use import statement outside a module HOT 1
- wrt: standalone script. HOT 3
- Buffer Lib does not transpile code into ES2015 which does not allow to import it by older devices HOT 1
- "File is not a constructor" in Node 16 and below
- Buffer 4.9.2 refers to `global` which is a node-only feature. HOT 1
- [suggestion] Replace https://bundle.run/buffer with https://bundle.run/[email protected] HOT 1
- subarray returns Uint8Array which can't handle toString('uff-8') HOT 29
- Uncaught SyntaxError: Invalid or unexpected token (at VM9 [email protected]:1:2)
- Consider injecting Buffer to window in standalone script
- Publish new version to npm HOT 3
- ESM Support HOT 4
- if possible map it like filer-browserify?
- typing error on method concat with TS 5.3
- Remove dependency on `base64-js` HOT 20
- Missing alias for writeBigUint64BE / LE
- Remove exclamation mark in header comment HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from buffer.