Note. This is a continuation of this issue .
I have an "obsolete" program that performs hundreds of string matches with large chunks of HTML. For example, if HTML matches 1 out of 20+ lines, do something. If it matches 1 of 4 other lines, do something else. There are 50-100 groups of these lines to fit these HTML snippets (usually whole pages).
I am trying to reorganize this mess of code and trying to find a suitable approach to fulfill all these matches.
The performance requirements for this code are pretty strict. When performing these matches, you do not need to wait for I / O, so they must be in memory. There may also be more than 100 copies of this process running at the same time, so large I / O at startup can cause slow I / O for other copies.
Given these requirements, this would be most effective if only one copy of these lines is stored in RAM (see my previous question related above).
This program currently runs on Windows with the Microsoft compiler, but I want this solution to be as cross-platform as possible, so I don’t think I want to use PE resource files or anything like that.
Perhaps the M-matching of the external file will work, but then I had the problem of keeping the program version and the data version in synchronization, which usually does not change without another. In addition, this requires some “file format” that adds a layer of complexity that I would rather not have.
So, after all this pre-amble, it seems like the best solution is to have bundles of string arrays that I can then iterate over. This seems messy as I mix code and data very much, but with the above requirements, is there a better way to handle this situation?