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

chore(main): release 6.4.0 [skip-ci] #644

Merged
merged 1 commit into from
Feb 29, 2024

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Feb 5, 2024

🌱 A new release!

6.4.0 (2024-02-29)

The MongoDB Node.js team is pleased to announce version 6.4.0 of the bson package!

Release Notes

BSON short basic latin string writing performance improved!

The BSON library's string encoding logic now attempts to optimize for basic latin (ASCII) characters. This will apply to both BSON keys and BSON values that are or contain strings. If strings are less than 6 bytes we observed approximately 100% increase in speed while around 24 bytes the performance was about 33% better. For any non-basic latin bytes or at 25 bytes or greater the BSON library will continue to use Node.js' Buffer.toString API.

The intent is to generally target the serialization of BSON keys which are often short and only use basic latin.

Fixed objectId symbol property not defined on instances from cross cjs and mjs

We do recommend that users of the driver use the BSON APIs exported from the driver. One reason for this is at this time the driver is only shipped in commonjs format and as a result it will only import the commonjs BSON bundle. If in your application you use import syntax then there will be a commonjs and an es module instance in the current process which prevents things like instanceof from working.

Also, private symbols defined in one package will not be equal to symbols defined in the other. This caused an issue on ObjectId's private symbol property preventing the .equals method from one package from operating on an ObjectId created from another.

Thanks to @dot-i's contribution we've changed the private symbol to a private string property so that the .equals() method works across module types.

Deserialization performance increased

If BSON data does not contain Doubles and UTF8 validation is disabled the deserializer is careful to not allocate data structures needed to support that functionality. This has shown to greatly increase (2x-1.3x) the performance of the deserializer.

Thank you @billouboq for this contribution!

Improve the performance of small byte copies

When serializing ObjectIds, Decimal128, and UUID values we can get better performance by writing the byte-copying logic in Javascript for loops rather than using the TypedArray.set API. ObjectId serialization performance is 1.5x-2x faster.

Improved the performance of serializing and deserializing doubles and bigints

We now use bit shifting and multiplication operators in place of DataView getX/setX calls to parse and serialize bigints and a Float64Array to convert a double to bytes. This change has been shown to increase deserializing performance ~1.3x and serializing performance ~1.75x.

Use allocUnsafe for ObjectIds and Decimal128

For small allocations Node.js performance can be improved by using pre-allocated pooled memory. ObjectIds and Decimal128 instance will now use allocUnsafe on Node.js.

Features

Bug Fixes

  • NODE-5873: objectId symbol property not defined on instances from cross cjs and mjs (#643) (4d9884d)

Performance Improvements

Documentation

We invite you to try the bson library immediately, and report any issues to the NODE project.


@github-actions github-actions bot force-pushed the release-please--branches--main--components--bson branch from 46b4638 to de997ee Compare February 9, 2024 16:38
@github-actions github-actions bot changed the title chore(main): release 6.3.1 [skip-ci] chore(main): release 6.4.0 [skip-ci] Feb 13, 2024
@github-actions github-actions bot force-pushed the release-please--branches--main--components--bson branch 2 times, most recently from d2a1048 to c13ee0f Compare February 14, 2024 21:55
@github-actions github-actions bot force-pushed the release-please--branches--main--components--bson branch from c13ee0f to eb26a68 Compare February 21, 2024 18:41
@dot-i
Copy link
Contributor

dot-i commented Feb 26, 2024

Any timeline on this release? The cjs/mjs issue is really causing us headaches, would be nice to have the fix applied 😬

@github-actions github-actions bot force-pushed the release-please--branches--main--components--bson branch 2 times, most recently from 7833c19 to a758b9d Compare February 27, 2024 21:44
@github-actions github-actions bot force-pushed the release-please--branches--main--components--bson branch from a758b9d to 1870e41 Compare February 29, 2024 16:26
@nbbeeken
Copy link
Contributor

run release_notes

@nbbeeken nbbeeken merged commit b64e912 into main Feb 29, 2024
@nbbeeken nbbeeken deleted the release-please--branches--main--components--bson branch February 29, 2024 16:58
Copy link
Contributor Author

🤖 Release is at https://github.com/mongodb/js-bson/releases/tag/v6.4.0 🌻

@nbbeeken
Copy link
Contributor

@dot-i Apologies for the delay, the release is now available: https://www.npmjs.com/package/bson/v/6.4.0 the current release of the driver allows bson versions in the range ^6.2.0 so you should be able to upgrade now, but we do intend to release a new driver version soon as well that will pull in this BSON version. Thanks again for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants