Namaskara Pradeep,
Please, let us resolve that we generate the JSON and we can place the Keys as we intend.
So Weekly can be easily placed last. Its has minimalistic influence… now that most F&O in NSE and BSE have shifted to Monthly.
That said… the reason I asked for the earlier structure is that .. Your json fields are not constant. They depend on the type of the instrument, whether equity or derivative. I need to process these two jsons differently.
WORSE, the 48 mb has been minified. This is the reason I requested a NDJSON instead of Plain json.
If the file contained NDJSON then I can pick one JSON object at a time and process it.
Due to (thoughtless) minification, I am forced to go character by character to build the json object and process it.
There is the issue. … to know which json object structure I need to look at the first 45 characters. Weekly key has messed this up… If the weekly key is at last or any other point apart from first, I can process with just 3 character processing iterated 45000 times. Hope you get the computing difference.
It’s nothing to do with Json …as it’s pre json processing.
It would be ideal
- Weekly key moved to last.
- Segment is always fixed first.
- NDJSON instead of Json.
If the JSON Template was CONSTANT THROUGHOUT THE COMBINED JSON file, Yes I agree with your conviction.. but mixing the json formats and shifting keys has led to a mess in upstream processing.
When I execute an IOT (embedded) project I use CSV for data generating and transmission efficiency.
But here since we are using JSON, that efficiency cannot be achieved, but gains is in flexibility. Still the JSON object has to be designed keeping the consumption in view as the consumption side processing increases dramatically if the JSON is poorly designed.
UPSTOX Json design, I am sorry to say, has not lived up to that level of professionalism. Please follow my posts on JSON in the community to know what I am conveying.
Regards
Rathnadhar K V