The current version of picoquery tracks the key path in an array and then processes the key path afterwards. This is bad for performance for two reasons. Firstly pushing to an array is more expensive than just setting a string value and secondly it means the path needs to be processed twice when parsing nested query strings.
This can be improved by tracking the current object whilst parsing. The previous and current key must be tracked in order to know whether to create an array or an object in place of the previous key.
The current version of picoquery tracks the key path in an array and then processes the key path afterwards. This is bad for performance for two reasons. Firstly pushing to an array is more expensive than just setting a string value and secondly it means the path needs to be processed twice when parsing nested query strings.
This can be improved by tracking the current object whilst parsing. The previous and current key must be tracked in order to know whether to create an array or an object in place of the previous key.