{"id":716,"date":"2014-09-02T08:15:41","date_gmt":"2014-09-02T08:15:41","guid":{"rendered":"http:\/\/www.nikola-breznjak.com\/blog\/?p=716"},"modified":"2015-08-17T10:56:38","modified_gmt":"2015-08-17T10:56:38","slug":"need-a-replacement-for-jquery-datatables-plugin-as-its-too-slow","status":"publish","type":"post","link":"https:\/\/nikola-breznjak.com\/blog\/stack-overflow\/need-a-replacement-for-jquery-datatables-plugin-as-its-too-slow\/","title":{"rendered":"Need a replacement for jQuery datatables plugin as it&#8217;s too slow"},"content":{"rendered":"<p><a href=\"http:\/\/stackoverflow.com\/users\/534755\/nikola\"><img loading=\"lazy\" decoding=\"async\" title=\"profile for Nikola at Stack Overflow, Q&amp;A for professional and enthusiast programmers\" src=\"http:\/\/stackoverflow.com\/users\/flair\/534755.png\" rel=\"lightbox[716]\" alt=\"profile for Nikola at Stack Overflow, Q&amp;A for professional and enthusiast programmers\" width=\"208\" height=\"58\" \/><\/a><br \/>\nI&#8217;m a big fan of <a href=\"http:\/\/stackoverflow.com\/\">Stack Overflow<\/a> and I tend to contribute regularly (am currently in the <a href=\"http:\/\/stackexchange.com\/leagues\/1\/alltime\/stackoverflow\/2008-07-31\/534755?sort=reputationchange#534755\">top 0.X%<\/a>).\u00a0In this category (<a href=\"http:\/\/www.nikola-breznjak.com\/blog\/category\/stack-overflow\/\">stackoverflow<\/a>)\u00a0of posts I will will be posting my top rated questions and answers. This, btw, is allowed as explained in the meta thread <a href=\"http:\/\/meta.stackoverflow.com\/questions\/266971\/can-i-post-so-questions-and-answers-in-a-personal-blog\/266973\">here<\/a>.<\/p>\n<p>So, <a href=\"http:\/\/stackoverflow.com\/questions\/11646377\/jquery-datatables-plugin-too-slow-need-a-replacement\">my question<\/a>\u00a0was\u00a0as follows:<\/p>\n<p style=\"color: #000000;\">I&#8217;ve been using jQuery\u00a0<a style=\"color: #4a6b82;\" href=\"http:\/\/datatables.net\/\" rel=\"nofollow\">datatables plugin<\/a>\u00a0for about two years now and it worked great so far. The problem occured now when I need to load about\u00a0<strong>45000<\/strong>\u00a0records at once (you click the button and wait for the page with the data to load) &#8211; the loading time is just too big to wait.<\/p>\n<p style=\"color: #000000;\">Here are the tests I made using Chrome web browser (the data is from it&#8217;s Network tab using ):<\/p>\n<p style=\"color: #000000;\"><em>datatables plugin turned on:<\/em><br \/>\n<strong>5476<\/strong>\u00a0records:<br \/>\n<code>24 requests \u2758 256.26KB transferred \u2758 19.80s<br \/>\n(onload: 19.80s, DOMContentLoaded: 18.58s)<\/code><br \/>\n<strong>45071<\/strong>\u00a0records:<br \/>\n<code>34 requests \u2758 1.85MB transferred \u2758 11.1min<br \/>\n(onload: 11.1min, DOMContentLoaded: 11.0min)<\/code><\/p>\n<p style=\"color: #000000;\"><em>datatables plugin turned off (the jQuery datatables initialization is comented out):<\/em><br \/>\n<strong>5476<\/strong>\u00a0records:<br \/>\n<code>21 requests \u2758 255.84KB transferred \u2758 6.57s<br \/>\n(onload: 13.26s, DOMContentLoaded: 13.28s)<\/code><\/p>\n<p style=\"color: #000000;\"><strong>45071<\/strong>\u00a0records:<br \/>\n<code>31 requests \u2758 1.84MB transferred \u2758 2.0min<br \/>\n(onload: 2.0min, DOMContentLoaded: 2.0min)<\/code><\/p>\n<p style=\"color: #000000;\">The\u00a0<em>increase in load time<\/em>\u00a0that datatables make is over\u00a0<strong>80%<\/strong>\u00a0for the 45k rows, and almost\u00a0<strong>40%<\/strong>\u00a0for the 5k rows.<\/p>\n<p style=\"color: #000000;\">So I was wondering if you guys know of any similar plugin that handles alot of rows (45000+) faster, or am I just missing the point by trying to load all 45000+ records in &#8220;one go&#8221;?<\/p>\n<p style=\"color: #000000;\">Any suggestions are appreciated!<\/p>\n<p>The answer, by user Allan Jardine, was this:<\/p>\n<blockquote>\n<p style=\"color: #000000;\">From the DataTables FAQs (\u00a0<a style=\"color: #4a6b82;\" href=\"http:\/\/datatables.net\/faqs#speed\">http:\/\/datatables.net\/faqs#speed<\/a>\u00a0):<\/p>\n<ul style=\"color: #000000;\">\n<li>Client-side processing &#8211; DOM sourced data: ~5&#8217;000 rows. Speed options: bSortClasses<\/li>\n<li>Client-side processing &#8211; Ajax sourced data: ~50&#8217;000 rows. Speed options: bDeferRender<\/li>\n<li>Server-side processing: millions of rows.<\/li>\n<\/ul>\n<p style=\"color: #000000;\">If you aren&#8217;t using deferred rendering at the moment, with your 45&#8217;000 rows, I would most certainly suggest that. Failing that, for DataTables options, you might need to look at\u00a0<a style=\"color: #4a6b82;\" href=\"http:\/\/datatables.net\/examples\/data_sources\/server_side.html\">server-side processing<\/a>.<\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;m a big fan of Stack Overflow and I tend to contribute regularly (am currently in the top 0.X%).\u00a0In this category (stackoverflow)\u00a0of posts I will will be posting&hellip;<\/p>\n","protected":false},"author":1,"featured_media":609,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[35],"tags":[],"class_list":["post-716","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-stack-overflow"],"_links":{"self":[{"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/posts\/716","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/comments?post=716"}],"version-history":[{"count":3,"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/posts\/716\/revisions"}],"predecessor-version":[{"id":1713,"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/posts\/716\/revisions\/1713"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/media\/609"}],"wp:attachment":[{"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/media?parent=716"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/categories?post=716"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/tags?post=716"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}