The 'prometheus to json' preprocessing step performance could be improved by reusing prometheus cache made for 'prometheus pattern' step. This caching is done in two steps:
- parsing premetheus data into row vector
- indexing rows by label
The first step already contains most of the information needed for 'prometheus to json' step and could be used without having to parse the whole data again. What would be needed is to also cache help information (from comments) and raw lines (if they aren't cached).