platformstl::file_lines performance tests - #21
Open
synesissoftware wants to merge 13 commits into
Open
synesissoftware wants to merge 13 commits into
synesissoftware wants to merge 13 commits into
Conversation
Add a standalone comparative performance test for platformstl::file_lines_a and std::ifstream plus std::getline; follow existing STLSoft warm-up, stopwatch, anchoring, and tabular output conventions;
…::basic_file_lines<>`
… processing, so only pass once
mwsis
approved these changes
Sep 23, 2026
Add a byte-oriented write that preserves embedded NULs, and deprecate write(void const*, size_t) in its favour. Cover CR and CRLF files in the file_lines component tests, and write the NUL fixture through write_binary().
Time LF, CRLF, and CR at the existing 1000×64 and 5000×80 shapes, and at 1×16, 8×32, and 32×64, so a later small-file path has a fixed-cost region to beat. Read the getline baseline in binary mode so the CR bytes are the same on every platform.
Remove the full-file m_contents heap copy; parse directly from the mmap'd base pointer for lower memory bandwidth use. Drop the unused m_contents member and early-return on empty maps.
Avoid MinGW std::ifstream/std::getline crashes by switching the perf fixture writer/reader to fopen/fwrite/fgetc while preserving split on '\n' semantics (keeping '\r' in-line).
- Rename the existing per-character stdio baseline to vector<std::string> plus getc; - add a genuine std::getline baseline using the appropriate LF or CR delimiter and normalise CRLF line endings;
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Add a standalone comparative performance test for platformstl::file_lines_a and std::ifstream plus std::getline; follow existing STLSoft warm-up, stopwatch, anchoring, and tabular output conventions;