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

Optimization: avoid copying startByte and startPoint in Node struct #205

Open
maxbrunsfeld opened this issue Sep 16, 2019 · 0 comments
Open

Comments

@maxbrunsfeld
Copy link
Contributor

The TSNode type has cryptic field names, and uses accessor functions for start_byte() and start_point(), but in reality, these two fields correspond directly to fields on the node:

So when loading a node into haskell via the FFI, we can remove the separate startByte and startPoint fields from the Node struct, in order to reduce the amount of data that we copy. This breaks the encapsulation of the TSNode API, but I think that's ok to do in a Tree-sitter binding library.

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

No branches or pull requests

2 participants