Performance to load big json file
Performance to load big json file
panpansh
Posts: 14Questions: 0Answers: 0
Hello to everyone,
My pages, table etc ... work fine ;) and thank you for this.
The problem is just the load time :(
I have a client side processing only. This is my restriction.
I have a big json file to complete a table : about 26Mo ... 200.000 rows ...
the table look like this :
[code]
var oTable2 = $('#Params').dataTable( {
"bLengthChange": false,
"iDisplayLength": 50,
"bDeferRender": true,
"bPaginate": true,
"sPaginationType": "full_numbers",
"sScrollY": $('#container').height()-235,
"bProcessing": true,
"bJQueryUI": true,
"sDom": '<"H"<"toolbar2">lfr>t<"F"ip>',
"sAjaxSource": "sources/Params.json",
"aoColumns": [
{ "mDataProp": "parentIdjson", "bSearchable": false },
{ "mDataProp": "idjson", "bSearchable": false },
{ "mDataProp": "paramType" },
{ "mDataProp": "paramID" },
{ "mDataProp": "value" }
] // "bVisible": false, => parentIdjson and idjson
});
$("div.toolbar2").html('Parameters');
oTable2.fnSetColumnVis( 0, false ); // REMOVE TO DISPLAY PARENTID
oTable2.fnSetColumnVis( 1, false ); // REMOVE TO DISPLAY ID
[/code]
The load time is about 16.000ms.
I am looking for a solution ... maybe cut json to x*1.000 rows and load on background or something like this but I don't know to insert it into table ... and ... I don't know if it's a good solution.
I'm interested if you have ideas.
Thanks
My pages, table etc ... work fine ;) and thank you for this.
The problem is just the load time :(
I have a client side processing only. This is my restriction.
I have a big json file to complete a table : about 26Mo ... 200.000 rows ...
the table look like this :
[code]
var oTable2 = $('#Params').dataTable( {
"bLengthChange": false,
"iDisplayLength": 50,
"bDeferRender": true,
"bPaginate": true,
"sPaginationType": "full_numbers",
"sScrollY": $('#container').height()-235,
"bProcessing": true,
"bJQueryUI": true,
"sDom": '<"H"<"toolbar2">lfr>t<"F"ip>',
"sAjaxSource": "sources/Params.json",
"aoColumns": [
{ "mDataProp": "parentIdjson", "bSearchable": false },
{ "mDataProp": "idjson", "bSearchable": false },
{ "mDataProp": "paramType" },
{ "mDataProp": "paramID" },
{ "mDataProp": "value" }
] // "bVisible": false, => parentIdjson and idjson
});
$("div.toolbar2").html('Parameters');
oTable2.fnSetColumnVis( 0, false ); // REMOVE TO DISPLAY PARENTID
oTable2.fnSetColumnVis( 1, false ); // REMOVE TO DISPLAY ID
[/code]
The load time is about 16.000ms.
I am looking for a solution ... maybe cut json to x*1.000 rows and load on background or something like this but I don't know to insert it into table ... and ... I don't know if it's a good solution.
I'm interested if you have ideas.
Thanks
This discussion has been closed.
Replies
Allan
If my tutor for my stage don't wan't a server side processing ? :)
Allan
When did some performance testing in the past I found a pretty dramatic difference in speed between IE8 and Firefox when rendering large tables (multiple orders of magnitude for anything > 10k rows).
in addition to my question, it would not come possible to avoid downloading the json by the browser ? because the json file is located next to the index.html on the client ... (this is a report generated on the client machine and open locally by the client).
timtucker : I use Firefox and Chrome ... and it's better with chrome ... I don't know why ...
I think trying to get that to work in the browser would be barking up the wrong tree entirely. Have you considered server-side processing? That will handle millions of rows no problem since all the work is done by the SQL engine on the server, and the client only downloads the rows that it needs.
Allan
Context: my html page is locally on the client computer directly with the json file. Theoretically I do not need to download the json file via the browser ... That would save me time ...
Question: Is it possible to read directly into my json file locally without the browser download the json ?
all is in local and the browser too ...
Allan