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

Update loader with what we've learned #810

Merged
merged 3 commits into from
Sep 2, 2019
Merged

Update loader with what we've learned #810

merged 3 commits into from
Sep 2, 2019

Conversation

dcodeIO
Copy link
Member

@dcodeIO dcodeIO commented Sep 2, 2019

This PR updates the loader with the lessons learned in #794 while trying to make accessing typed arrays faster.

In particular, this completely eliminates the need to checkMem and wraps buffers in new TypedArrays directly. The lesson here seems to be that JS engines optimize this extremely well, not actually allocating something but just passing around buffers with a type attached.

Consequently, the I8, ... F64 properties have been removed since a) checkMem isn't there anymore to update them, and b) it can be expected that manually wrapping the buffer in new TypedArray achieves similar results in user code. The README has been updated accordingly.

Also adds typing for 64-bit integer arrays using BigInt.

cc @MaxGraey

Copy link
Member

@MaxGraey MaxGraey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

lib/loader/index.js Outdated Show resolved Hide resolved
@dcodeIO dcodeIO merged commit bc48898 into master Sep 2, 2019
@dcodeIO dcodeIO deleted the update-loader branch November 8, 2019 02:00
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

Successfully merging this pull request may close these issues.

2 participants