"jsondecode" poor performance in COCO datasets?
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I tried to import data annotation files from COCO2017 and it takes about half a minute using “jsondecode”, while coco-api only takes about 15 seconds, can the performance of “jsondecode” be significantly provided in future versions?
Run R2021a,
cocoDir = 'coco2017/';
annFile = 'annotations_trainval2017\annotations\instances_train2017.json';
annFile = fullfile(cocoDir,annFile);
data = fileread(annFile);
tic
data = jsondecode(data);
toc
Elapsed time is 31.671089 seconds.
cocoDir = 'coco2017/';
annFile = 'annotations_trainval2017\annotations\instances_train2017.json';
annFile = fullfile(cocoDir,annFile);
tic
coco=CocoApi(annFile);
toc
Elapsed time is 15.598371 seconds.
1 comentario
Rik
el 5 de Ag. de 2021
Performance is strongly dependent on the implementation or the JSON parser. In the performance section (direct link, might break after an update) of the documentation for my JSON parser you can see there is a quite a wide margin.
For a very large file jsondecode is much faster (1000x), while for many small files my parser is faster (2-3x).
Respuestas (0)
Ver también
Categorías
Más información sobre JSON Format en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!