]> git.ipfire.org Git - thirdparty/gcc.git/commit
Size input line cache based on file size
authorAndi Kleen <ak@gcc.gnu.org>
Thu, 26 Dec 2024 21:05:57 +0000 (13:05 -0800)
committerAndi Kleen <ak@gcc.gnu.org>
Mon, 3 Feb 2025 05:59:22 +0000 (21:59 -0800)
commitbaf26fccfb51fa54fcf7c668b96cae4cdbe574b3
tree4de5eea1809b7c13e618664ae880e26276e6f298
parent33acec612423efd2d9db9ffc808c4d103840dcd2
Size input line cache based on file size

While the input line cache size now tunable it's better if the compiler
auto tunes it. Otherwise large files needing random file access will
still have to search many lines to find the right lines.

Add support for allocating one line anchor per hundred input lines.
This means an overhead of ~235k per 1M input lines on 64bit, which
seems reasonable.

gcc/ChangeLog:

PR preprocessor/118168
* input.cc (file_cache_slot::get_next_line): Implement
dynamic sizing of m_line_record based on input length.
* params.opt: (param_file_cache_lines): Set to 0 to size
dynamically.
gcc/input.cc
gcc/params.opt