Skip to content

[JavaScript] Implement packed BitSet#3507

Draft
jcking wants to merge 329 commits into
antlr:masterfrom
jcking:js-bitset-opt
Draft

[JavaScript] Implement packed BitSet#3507
jcking wants to merge 329 commits into
antlr:masterfrom
jcking:js-bitset-opt

Conversation

@jcking

@jcking jcking commented Jan 24, 2022

Copy link
Copy Markdown
Collaborator

Implements a packed BitSet, similar to Go and Dart runtimes. It is more memory efficient as it avoids using an Object as a hash map.

jcking and others added 30 commits December 9, 2021 14:07
[C++] Implement standalone Unicode encoding and decoding handling
[C++] Cleanup EMPTY_VOCABULARY uses and remove SingleWriteMultipleRea…
[C++] Optimize ATN deserialization
ericvergnaud and others added 24 commits January 6, 2022 12:52
* Update windows.yml

* Create run-tests-php.cmd

* Update run-tests-php.cmd

* Update run-tests-php.cmd

* Update run-tests-php.cmd

* Update run-tests-php.cmd

* Update windows.yml

* Update windows.yml

* Update windows.yml

* Update run-tests-php.cmd

* Update windows.yml
* Delete .appveyor directory

* Delete .travis directory
* Update windows.yml

* Update windows.yml

* Update windows.yml
replace toArray(new T[size]) with toArray(new T[0]) for better performance

https://shipilev.net/blog/2016/arrays-wisdom-ancients/#_conclusion
* fix-maven-concurrency

* Update windows.yml

* Update windows.yml

* Update windows.yml

* Update windows.yml

* Update windows.yml

* Update windows.yml

* Update windows.yml

* Update run-tests-python2.cmd

* Update run-tests-python3.cmd

* Update windows.yml

* Update windows.yml

* Update windows.yml

* Update windows.yml

* Update windows.yml

* Update windows.yml

* Update windows.yml

* Update windows.yml

* Update windows.yml

* Update run-tests-php.cmd

* Update windows.yml

* Update run-tests-dart.cmd

* Update run-tests-csharp.cmd

* Update run-tests-go.cmd

* Update run-tests-java.cmd

* Update run-tests-javascript.cmd

* Update run-tests-php.cmd

* Update run-tests-python2.cmd

* Update run-tests-python3.cmd
increase Windows CI concurrency for all targets except Dart
* Preserve line separators for input data in runtime tests, fix test data

Refactor and improve performance of BaseRuntimeTest

* Add LineSeparator (\n, \r\n) tests

* Set up .gitattributes for LineSeparator_LF.txt (eol=lf) and LineSeparator_CRLF.txt (eol=crlf)
[JavaScript] Migrate from jest to jasmine
@ericvergnaud

Copy link
Copy Markdown
Contributor

Hi,
not sure memory is a bigger concern than speed, the current biggest concern with JS and Python.
Can you provide performance comparisons ?

@jcking

jcking commented Jan 24, 2022

Copy link
Copy Markdown
Collaborator Author

For the test zeroThroughOneTwentySeven, the new implementation is ~4.6 ms while the old implementation is ~5.7 ms. For the test equality the new implementation is ~0.1 ms while the old implementation is ~0.7 ms. For the test bitwiseOr the perf is similar. I would expect the new implementation to beat the old one in most cases or perform similarly.

@ericvergnaud

ericvergnaud commented Jan 24, 2022

Copy link
Copy Markdown
Contributor

Atomic improvements are great if they don't come at the cost of deteriorating the broader use case.
So I'm interested in overall performance i.e. when used in a parsing scenario.
You would want to parse the same input several times to avoid the warmup bias.

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.