mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-25 06:38:13 -05:00
Constructing an Opm::Parser populates the complete keyword database (2774 keywords, measured at 2.4 ms per construction) and this was done once per keyword event in RifEventKeywordFormatter::buildKeyword, and twice more per keyword in the column-aligned serialisation in RimKeywordFactory. Schedule generation was therefore completely dominated by parser construction and grew directly with the number of events on the timeline. Use a single shared parser instance instead, since the parser is stateless once constructed. Also compute the events for a date once in generateDateSection and pass them to the per-well helpers, instead of calling RimWellEventTimeline::getEventsAtDate four times per well and date, which scaled as dates x wells x events. Generating a schedule for a production data set with 1737 events over 490 dates goes from 4.2 s to 0.1 s, and 21000 events over 14 wells now complete in 0.5 s.