std::endl ends a line in a stream and also flushes it, which is slow when done for every line

tx0/cpp:stream-endlstrictnoteperformance/allocationdepth fastperformance

What it finds

std::endl writes '\n' and then flushes the stream; writing many lines this way turns buffered output into one system call per line. '\n' ends the line, and an explicit std::flush flushes where it matters.

From the rule's source, stream_endl.rs.

Turn it on, off or suppress it

The rule runs from the strict tier up. To turn it on in a lower tier, give it a level in tx0.toml:

tx0.toml
[rules]
"tx0/cpp:stream-endl" = "note"

To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:

// tx0: ignore[tx0/cpp:stream-endl] reason="..."

tx0 explain tx0/cpp:stream-endl shows the same in the terminal. Found a false positive? Report it.