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

Is it possible to keep Iterator instead of Vec<Vec<String>> in Grid? #123

Open
zhiburt opened this issue May 6, 2022 · 0 comments
Open
Labels
papergrid question Further information is requested

Comments

@zhiburt
Copy link
Owner

zhiburt commented May 6, 2022

The idea is,
if we could use Iterator<Item=Iterator<Item=String>> instead of Vec<Vec<String>> we could not allocate a huge chunk of memory.
But we would call the iterator each time we do fmt::Display which would do small allocations each time....
Not sure which is better but...

It potentially could be beneficial, because of less memory usage.

We do use indexes of arrays heavily in papergrid so it may be hard to do.

At the end of the day we would need to benchmark it.

Nevertheless it would affect such things like tabled::Format we would need to store the function until it's applied to iterator or iterator to the element, change it while creating a new iterator.

Not sure if it is valuable and worth to do, but worth to think about it more certainly.

ref: wfxr/csview#27

@zhiburt zhiburt added enhancement New feature or request papergrid question Further information is requested and removed enhancement New feature or request labels May 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
papergrid question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant