mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-10-20 05:14:16 +02:00
AssignVariables: open QSettings only for element formulas
Every formula evaluation constructed a QSettings, although only element formulas read it (border-columns_0, for %c). Constructing QSettings is costly, on Windows a registry lookup, and conductor labels are evaluated in bulk: Conductor::refreshText() runs for every wire of a folio when it is built, and for every wire of every built folio when the project or a title block changes. Debug build, 40 folios with 4,280 numbered wires: - refreshText() of every wire: 1,136-1,264 ms before, 203-208 ms after - opening the project (database fill): 2.24-2.48 s before, 1.46-1.59 s after - building 39 lazy folios: 15.0-15.3 s before, 12.3-12.5 s after Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -415,9 +415,9 @@ namespace autonum
|
||||
m_assigned_label.replace("%M", m_context.plant);
|
||||
m_assigned_label.replace("%LM", m_context.locmach);
|
||||
|
||||
QSettings settings;
|
||||
if (m_context.has_element)
|
||||
{
|
||||
QSettings settings;
|
||||
if (settings.value("border-columns_0", true).toBool()){
|
||||
m_assigned_label.replace("%c", QString::number(m_context.element_position.number() - 1));
|
||||
}else{
|
||||
|
||||
Reference in New Issue
Block a user