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

Reduce bloat (tree-sitter sources, multriple shared libraries, rust stdlib) #2462

Closed
cdecompilador opened this issue May 12, 2022 · 3 comments
Labels
C-enhancement Category: Improvements

Comments

@cdecompilador
Copy link

cdecompilador commented May 12, 2022

The editor itself is pretty lightweight, ~16MB, but its "runtime" is massive, 0.6 GB, if instead of retaining the tree-sitter sources by default and building a lot of independent dlls/so (which contains the rustlib statically linked so its size use to be big), we could have a single dll/so and check if a function for that language exists at runtime or maybe link all those shared libraries dynamically with the rust stdlib (as far as I know is possible, but has some low level issues, so some unsafe code may break with an update). For the tree-sitter sources I'd recomend just tracking the repo link + version (tag/rev/whatever) on a json and when checking updates just check if the repo has a new (tag/rev/whatever)

It's just that I like lightweight things, and an editor should not occupy more than 20MB in my opinion

@cdecompilador cdecompilador added the C-enhancement Category: Improvements label May 12, 2022
@cdecompilador cdecompilador changed the title Reduce bloat (tree-sitter sources, multriple dlls) Reduce bloat (tree-sitter sources, multriple shared libraries, rust stdlib) May 12, 2022
@kirawi
Copy link
Member

kirawi commented May 12, 2022

I'm not sure I quite understand. The tree-sitter shared object files are just C/C++ compiled, and as of 22.03 w/ #1659 you can select which grammars to build (with all of them being the default). Though I agree that the source folders should be deleted after building.

@cdecompilador
Copy link
Author

Ah I didn't knew that, I entered on one source and saw a Cargo.toml and the first thing I thought was "those many stdlibs may take a lot of space"

Then if the source folders deletion and track of the already compiled version feature is fine, should I start a new issue and close this?

@archseer
Copy link
Member

It's up to you to clean up runtime/grammars/sources if you're building by hand, the same way it's up to you to run cargo clean when you're building cargo projects. Most users don't build from source and use a precompiled package.

The latest release is 7MB as .tar.xz: https://github.com/helix-editor/helix/releases/tag/22.03
Installed Arch package is 64MB with all the grammars: https://archlinux.org/packages/community/x86_64/helix/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: Improvements
Projects
None yet
Development

No branches or pull requests

3 participants