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

Improve performance of reading files from disk #144

Closed
2 of 3 tasks
KyleVaughn opened this issue Feb 1, 2024 · 1 comment
Closed
2 of 3 tasks

Improve performance of reading files from disk #144

KyleVaughn opened this issue Feb 1, 2024 · 1 comment
Labels
good first issue Good for newcomers priority: medium type: enhancement New feature or request

Comments

@KyleVaughn
Copy link
Owner

KyleVaughn commented Feb 1, 2024

Currently, we use std::getline and std::string related functions for input parsing. However, allocating memory on each invocation of std::getline for each line in a 100 K - 1 M line Abaqus or VTK file is not ideal. Therefore, I think it would be likely be faster to use fgets() and a fixed size buffer for reading files.

The primary issue with this is related to buffer/line size. The buffer must be large enough to handle the max line size. Maybe we just allocate something like 4096 and see how it goes. We do not currently handle files with anywhere near that large of lines.

  • gmsh/io.cpp
  • mesh/polytope_soup.cpp
  • physics/cross_section_library.cpp
@KyleVaughn KyleVaughn added type: enhancement New feature or request good first issue Good for newcomers priority: medium labels Feb 1, 2024
@KyleVaughn KyleVaughn changed the title Improve performance of reading mesh files from disk Improve performance of reading files from disk Feb 1, 2024
@KyleVaughn
Copy link
Owner Author

Implemented for all but gmsh/io.cpp, since the files containing a gmsh model are not very large, hence it would not have been worth the refactor effort. Merged to main with #156

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers priority: medium type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant