Initial implementation of memory-efficient Excel writing for large documents #481
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I have implemented an initial version that does not use memory to write a document. This solution is useful in cases where it’s necessary to create large Excel documents sequentially, meaning there’s no need for a second manipulation of the cells already added to the document.
The issue is described here: #480
Currently, this code only allows text to be written into a cell, and there is no functionality yet for changing its style. I would also like to point out that, due to the rush in which this modification was made, you should see this pull request not as a final change but as a way to demonstrate that even more can be achieved with Fastexcel!
You can compare the memory usage difference using VisualVM with the images from the issue:
Memory usage:
Memory Profiling:
The difference is remarkable, isn’t it? You can now create huge files without wasting memory!
Here’s the code used for the tests:
Lastly, I’d like to mention that test cases haven’t been added due to the nature of this pull request. If this approach moves forward, they will be included.
Thank you all <3