1
Fork 0
mirror of https://github.com/RGBCube/cstree synced 2025-07-29 18:17:44 +00:00

Performance Improvements (#43)

- add `Language::static_text` and optimize static tokens
 - re-use existing `ThinArc`s in `GreenNodeBuilder::finish_node`
 - replace `*mut` in `SyntaxNode` with `NonNull`
 - add CHANGELOG
This commit is contained in:
DQ 2022-08-25 22:22:45 +02:00 committed by GitHub
parent 9be9dc9597
commit e7b00a603e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 575 additions and 371 deletions

8
CHANGELOG.md Normal file
View file

@ -0,0 +1,8 @@
# Changelog
## `v0.12.0`
* Introduced `Language::static_text` to optimize tokens that always appear with the same text (estimated 10-15% faster tree building when used, depending on the ratio of static to dynamic tokens).
* Since `cstree`s are lossless, `GreenNodeBuilder::token` must still be passed the source text even for static tokens.
* Internal performance improvements for up to 10% faster tree building by avoiding unnecessary duplication of elements.
* Use `NonNull` for the internal representation of `SyntaxNode`, meaning it now benefits from niche optimizations (`Option<SyntaxNode>` is now the same size as `SyntaxNode` itself: the size of a pointer).