Phalynx/WoT-Dossier-Cache-to-JSON — pull request #11 by Blcz (2014-08-06 21:43:00+00:00)
Title: Speedup

Hello, I have done some work which significantly speeds up dossier file decoding. It is achieved by changing the way structures and tanksdata are internally stored and searched through. Instead of flat lists which must be iterated, dicts are used and data are searched by keys.

Speed gain is indeed very significant and will be even more as new versions of structures and new tanks are introduced. And also as dossier files contain more and more tanks.

Times to decode my testing dossier file (which contains some 200 tanks) are as follows:
original version: 3.45 seconds
after structures optimization: 1.29 s
after tanksdata optimization: 0.51 s

Changes are divided to 2 commits, first optimizing structures, second optimizing tanksdata, feel free to comment or propose changes, before pulling.