More efficient jsonencode for large data?
Ältere Kommentare anzeigen
So I am using matlabs jsonencode function to encode a structure array to a character array, and then write this to an output json text file. The structure array mat file equalls approximately 10GB. This takes both a long time, and alot of computer memory.
I then import the JSON text file into mongodb.
Is there a more efficient way to directly get the data into mongodb? Maybe the only option is the MatLab database toolbox...?
Thanks
Antworten (3)
You can try following the example in this File Exchange function, which uses the MongoDB Java driver to insert a document:
The following Stackoverflow post also has some good suggestions:
With these approaches, you should be able to avoid writing text to disk, which may be more efficient. Note that this workflow has not been qualified, and it may or may not be more efficient than your current method.
Marco Rossi
am 28 Jul. 2021
1 Stimme
Is matlab development team planning to remove this limitation? I also noticed that, when the 32 bit limit is overtaken, no warnings/errors are returned.
1 Kommentar
Joris Brouwer
am 11 Aug. 2022
I second that. Running into what seems to be exponentionally / halting jsonencode performance as well. Trying the chunked solution mentioned above.
Kategorien
Mehr zu JSON Format finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!