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

Annatto needs a memory switch #120

Open
MartinKl opened this issue Aug 2, 2023 · 1 comment
Open

Annatto needs a memory switch #120

MartinKl opened this issue Aug 2, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@MartinKl
Copy link
Collaborator

MartinKl commented Aug 2, 2023

Currently there is no option to force annatto to build the corpora in memory. The annotation graph is always initialized on disk. For machines with larger memory this is a waste.

For now I would really like to avoid configuration files, having a single binary is neat. I suggest an optional argument (--in-mem) or an environment variable (ANNATTO_IN_MEM=true), of which the latter might be the more suitable way to go for server applications. A third option would be to initially deserialize a template for AnnotationGraph where the storage location is predefined.

Any thoughts @thomaskrause ?

@MartinKl MartinKl assigned MartinKl and thomaskrause and unassigned MartinKl Aug 2, 2023
@MartinKl MartinKl added the enhancement New feature or request label Aug 2, 2023
@thomaskrause
Copy link
Member

If we are not using config files yet, both variants can be achieved at the same time with structopt by using an environment variable fallback for the configuration option: https://docs.rs/structopt/latest/structopt/#environment-variable-fallback. We might have to update structopt to use this feature.1

I would keep the issue with a configurable storage location separate and implement the in memory switch first.

Footnotes

  1. It seems that structopt is now in maintenance only mode and considered feature complete. If we would need more features, the clap crate is recommended. Since all features we currently need are included, I think we can stay with structopt for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants