cppcheck icon indicating copy to clipboard operation
cppcheck copied to clipboard

some XML parsing cleanups

Open firewave opened this issue 1 year ago • 5 comments

firewave avatar Jun 12 '24 11:06 firewave

What speedup, if any, does using strcmp() buy us?

chrchr-github avatar Jun 12 '24 14:06 chrchr-github

What speedup, if any, does using strcmp() buy us?

That was not done because of performance but so the code is aligned with the rest. The redundant calls should have more of an impact and were done for performance purposes.

callgrind in CI 64,844,065,823 -> 64,850,887,712

The increase seems to be caused by strcmp().

firewave avatar Jun 12 '24 17:06 firewave

Even with Clang 19 which includes a fix for https://github.com/llvm/llvm-project/issues/58003 using strcmp() uses more Ir.

Running just the start-up code of testrunner: 1,432,304,160 -> 1,459,503,454

firewave avatar Jun 12 '24 22:06 firewave

Same behavior with GCC.

firewave avatar Jun 12 '24 22:06 firewave

Even with Clang 19 which includes a fix for llvm/llvm-project#58003 using strcmp() uses more Ir.

Ah - turns out the default maximum length which is inlined is 3 characters. It can be controlled via the option strncmp-inline-threshold.

firewave avatar Jun 16 '24 13:06 firewave

I dropped the introduction of strcmp() as it makes things slower.

firewave avatar Sep 18 '24 10:09 firewave