Closed Gama11 closed 5 years ago
I've started some optimisation of the generated code in aa8d4125b141d0d8122ca24d2de0ae347e1486df
As an example, parsing FormatterConfig
of haxe-formatter
in a simple example used to yield ~10k loc, the same example now yield ~7k. Some more optimisation are envisaged so I'm not closing this issue yet.
That's a nice improvement. :)
I wonder how size-efficient tink_json for instance is / if it's around the same size.
No idea, but I assume it should produce significantly smaller files, since error logging takes a lot space.
The parser for classes and anon has been changed, which gives another big reduction in size.
Arrays have yet to be improved.
Looks like the language server is already down to ~35 kLoC from previously ~41. :)
Parsing an array now takes one line instead of ten (on js at least) which should help if you have a lot of arrays.
When compiling haxe-language-server to JS, roughly 7 kLoC are json2object-generated JSON parsers, which seems a bit excessive:
https://gist.github.com/Gama11/d8552a31944553da1a43e06956844338
There seems to be quite a bit of duplicated code, for instance
loadJsonArray()
appears to be largely repeated for each parser dealing with arrays? Perhaps more code could be shared across parsers?