tidwall / gjson

Get JSON values quickly - JSON parser for Go
MIT License
14.1k stars 846 forks source link

Start searching string backwards #238

Closed smjure closed 2 years ago

smjure commented 2 years ago

I have files representing measurements from a technical system, each ~30GBs (string format). Every line represents one sample containing about 900 parameters. My parameters of interest are at the end of the string line. I assume, it would probably make sense to start the parameter/path search from the end of the string. That would probably greatly speed up the json file processing. Is it possible to do that with gjson, like gjson.GetFromEnd()? I saw the @reverse modifier but that one reverses json object members. Thanks and respect for the great library.

tidwall commented 2 years ago

Unfortunately there isn't a reverse searching mechanism in gjson.

smjure commented 2 years ago

Can it be added as a feature request or enhancement someday in the future? :)

tidwall commented 2 years ago

This feature is technically possible but may be a challenging task. Perhaps a future enhancement, yes.