tl;dr: DirectSourceRef should store the line-number in addition to start_idx and end_idx.
- Then the line property does not need to look at the source file.
DirectSourceRef._extract_line_info scans the entire file in order to discover a component's line number in its source file.
Profiling shows that peakrdl_html export spends 30% of the time in this method.
For very large models, the peakrdl_html runtime explodes to many hours.
- Disabling source-links reduces the runtime to a small fraction of that.
tl;dr: DirectSourceRef should store the line-number in addition to start_idx and end_idx.
DirectSourceRef._extract_line_info scans the entire file in order to discover a component's line number in its source file.
Profiling shows that peakrdl_html export spends 30% of the time in this method.
For very large models, the peakrdl_html runtime explodes to many hours.