Files
qelectrotech-source-mirror/sources/factory
ispyisail a8df5e3df9 Compile the element style pattern once instead of once per primitive
setPainterStyle() built its QRegularExpression as a local, so the pattern
was compiled from scratch on every call -- and it is called for every
graphics primitive of every element instance a project places. A callgrind
profile of opening examples/affuteuse_250h.qet put 28 % of all instructions
inside libpcre2, and 12 % of the whole run inside this one function.

Making it static const compiles the pattern once for the life of the
process. Nothing else changes: same pattern, same matching, same named
captures.

Measured with callgrind, which counts instructions and so does not depend
on what else the machine is doing, opening examples/affuteuse_250h.qet:

  4,801,381,735 -> 4,297,629,948 instructions  (-10.5 %)
  setPainterStyle  582 M (12.13 %) -> 79 M (1.83 %)

--info stays byte identical on all 23 example projects, and so does every
SVG this produces for industrial.qet -- which is the output that would
change if the styles were parsed any differently.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01N64mk33R9GdbU1PkYcc9SP
2026-09-12 18:32:14 +12:00
..
2026-01-16 15:24:35 +01:00
2026-07-27 22:16:52 +02:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00