VBA-tools / VBA-JSON

JSON conversion and parsing for VBA
MIT License
1.76k stars 568 forks source link

Performance issue with nested Dictionaries #213

Open KonnokMollom opened 2 years ago

KonnokMollom commented 2 years ago

Hello, i already made a post on stackoverflow with this issue, but due to its being related directly to this project i thought i post it here too .)

its about nested dictionaries with 30+ size of the first level dictionaries getting noticably slower to parse to jsonText.

one part of the problem is, that for some unknown reason TypeName(Object) is exceptionaly slow with Dictionaries compared to other types (about 200 times slower), so it would be a good idea to test its type via TypeOf Object is Dictionary.

Another performance bottleneck is, when the item is accessed. Its about 1/3 faster to copy the .Keys and .Items to Variant and iterate through those variant arrays, although it still gets slow with this method.

Does anyone know why this is, why it only happens with dictionaries and if its fixable?

Thanks for this amazing project, it realy helped me alot already :*