From f53bd66da0e5256cb86f06e94e4afda80ccdde7d Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Mon, 30 Sep 2013 15:37:03 +0200 Subject: [PATCH] hazelnut patched so that one single call to fnAddData is made once the 'all' query is done processing measured improvement for the redisplay part is 6 times faster with 1400 users (13 s down to 2s) 3 times faster with 330 resources (3.2s down to 1.2s) --- plugins/hazelnut/static/js/hazelnut.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/plugins/hazelnut/static/js/hazelnut.js b/plugins/hazelnut/static/js/hazelnut.js index dd7f8411..290063e0 100644 --- a/plugins/hazelnut/static/js/hazelnut.js +++ b/plugins/hazelnut/static/js/hazelnut.js @@ -39,6 +39,9 @@ this.listen_query(options.query_uuid); this.listen_query(options.query_all_uuid, 'all'); + /* an internal buffer for keeping lines and display them in one call to fnAddData */ + this.buffered_lines = []; + /* GUI setup and event binding */ this.initialize_table(); }, @@ -283,7 +286,8 @@ line.push(this.checkbox(this.key, record[this.key])); // XXX Is adding an array of lines more efficient ? - this.table.fnAddData(line); +// this.table.fnAddData(line); + this.buffered_lines.push(line) }, @@ -459,6 +463,8 @@ this.unspin(); } + this.table.fnAddData (this.buffered_lines); + this.buffered_lines=[]; this.received_all = true; }, // on_all_query_done -- 2.43.0