-
Notifications
You must be signed in to change notification settings - Fork 72
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
Remove unnecessary fields from needs info #996
Comments
Thoughts @danwos? |
I use always the templates. So i even check the templates for debugging or if the templates differ by a supplied needs.json. I belive it is easier for a user to reduce the data fieldes of a json file in a post processing (reduce step in database Methodology) than we offer many configuration parameter to configure the output. |
Heya, I can understand you may want to use this for debugging, but then I feel this can be provided by a config flag (to include such "debug" data) The problem is, particularly for commercial use cases, there can be many 1000s of needs, and (currently) all this data is loaded in memory, making sphinx-needs have a very high memory overhead. This is magnified if you try to run sphinx in multi-processing mode, since this data is replicated across all processes.
Also to note, there is already a lot of data fields removed from the internal representation before it is output to the needs.json. |
I know this use case, i‘m working in really big projects. As the templates are normal options, it is necassary to get them out of sohinx-needs. So if a user wants to remove options from needs.json, i would suggest to use a post processing script for this. |
Just to note, I'm not a user, I'm a new developer at useblocks (although with a lot of experience in the space 😄). So expect to see me doing a lot more development and maintenance of the code base. This is definitely helpful feedback thanks; that the template field is being used, and I would be happy to meet, to understand further how you use sphinx-needs. |
It's not so easy to remove fields from needs-data, as you never know the use cases and if the data may be used for filtering needs. But I also have an eye on memory consumption, so totally understand the motivation. |
Another thing I've just realised:
However, for any user defined links (from |
@danwos : I upvote the suggestion in comment #996 (comment), as every little bit that gets us a smaller needs.json is good. |
There are fields that are are stored, for each need, in the
env.needs_all_needs
that are maybe not really necessary for further processing. These add to the size of theneeds.json
.For example,
jinja_content
,template
,pre_template
andpost_template
are used to generatecontent
,pre_content
, andpost_content
insphinx-needs/sphinx_needs/api/need.py
Line 410 in a16fb72
content
,pre_content
, andpost_content
are then used to generate AST.After this none of these fields are required, so I feel they should not be stored on env.needs_all_needs`
The text was updated successfully, but these errors were encountered: