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: use ropes under the hood #22

Open
velipso opened this issue Apr 27, 2017 · 1 comment
Open

Optimization: use ropes under the hood #22

velipso opened this issue Apr 27, 2017 · 1 comment

Comments

@velipso
Copy link
Owner

velipso commented Apr 27, 2017

The C implementation of strings is pretty dumb and straight forward (and slow).

We should probably implement a form of rope under the hood. Notice that node.js's v8 already does in some form, because ./perf/cat.sink runs significantly faster in the JS implementation.

See: https://en.wikipedia.org/wiki/Rope_(data_structure)

We can likely keep the C API the same, and just use ropes internally, and flatten ropes when sink_caststr is called.

@velipso
Copy link
Owner Author

velipso commented Apr 27, 2017

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

1 participant