romaricdrigon/MetaYaml

Too slow

Closed this issue · 1 comments

I cannot say precisely why but MetaYaml is slow drastically.
I know it's rather vague, but here is a sample output of an application which uses MetaYaml:

Timer result:
probe                           time, s  mem, Mb  time, %  mem, %  
------------------------------  -------  -------  -------  ------  
TOTAL                            10.194     4.37   100.00   78.18  
initDeck                          9.882     4.13    96.94   73.82  
initDeck: validating schema       8.759     0.02    85.92    0.38  <<<
initDeck: base schema validate    0.948     0.21     9.30    3.72  <<<
initDeck: generator plugins       0.091     1.22     0.89   21.88  
initDeck: execution tree          0.043     1.71     0.42   30.64  
initDeck: service fields          0.035     1.00     0.34   17.81  
initDeck: services                0.002     0.14     0.02    2.55 

The app builds some dynamic YAMLs and validates them. Total run time is ~10s. Schemas validation takes ~95%.

Any chances it can be optimized?

Hello @OnkelTem ,

For some reason Github did not send me an e-mail, I'm sorry I missed your issues.
Schema validation is indeed pretty slow. Hence it can be skipped at runtime (you have a flag for that).

Going further, I'm sure MetaYaml would benefit from an architecture refactor. Sadly I'm short on time right now.
Meanwhile, if you see any "quick win", feel free to post those on issues and that would be great 👍