Thanks to visit codestin.com
Credit goes to github.com

Skip to content

RFC: Refactor Record. No longer a Collection. Faster guts. #1135

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

Merged
merged 2 commits into from
Mar 10, 2017

Conversation

leebyron
Copy link
Collaborator

This is a breaking change refactor of Record which no longer extends a collection type and therefore does not inherit sequence methods - which was a constant source of confusion and breakage. It also refactors the internals to no longer rely on a Map, but instead a fixed size List which should result in dramatically faster performance. This is also a breaking change as delete() (aka remove()) and clear() are no longer available - previously these methods reverted values to their default value, now that can be done with set(k, undefined).

This adds a predicate function isRecord() and also minorly refactors related functionality such as Seq() constructors.

Fixes #505
Fixes #286

@leebyron
Copy link
Collaborator Author

Also tested an implementation which used a native Array to host Record values rather than an Immutable List, but did not find a significant performance improvement vs the List, but did see rather punishing memory usage for very large Records.

This is a breaking change refactor of Record which no longer extends a collection type and therefore does not inherit sequence methods - which was a constant source of confusion and breakage. It also refactors the internals to no longer rely on a Map, but instead a fixed size List which should result in dramatically faster performance. This is also a breaking change as `delete()` (aka `remove()`) and `clear()` are no longer available - previously these methods reverted values to their default value, now that can be done with `set(k, undefined)`.

This adds a predicate function `isRecord()` and also minorly refactors related functionality such as `Seq()` constructors.

Fixes #505
Fixes #286
@leebyron leebyron merged commit 27a937b into master Mar 10, 2017
@leebyron leebyron deleted the separate-record branch March 10, 2017 08:06
leebyron added a commit that referenced this pull request Mar 10, 2017
* RFC: Refactor Record. No longer a Collection. Faster guts.

This is a breaking change refactor of Record which no longer extends a collection type and therefore does not inherit sequence methods - which was a constant source of confusion and breakage. It also refactors the internals to no longer rely on a Map, but instead a fixed size List which should result in dramatically faster performance. This is also a breaking change as `delete()` (aka `remove()`) and `clear()` are no longer available - previously these methods reverted values to their default value, now that can be done with `set(k, undefined)`.

This adds a predicate function `isRecord()` and also minorly refactors related functionality such as `Seq()` constructors.

Fixes #505
Fixes #286

* Add perf test
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.

Remove homogeneous collection API from records Faster implementation for Record
2 participants