Skip to content

Commit f9013e9

Browse files
committed
Replace _superApply with _super for performance critical hooks
Close mar10#684
1 parent 82968d9 commit f9013e9

File tree

3 files changed

+19
-5
lines changed

3 files changed

+19
-5
lines changed

doc/fancytree_benchmarks.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Fancytree benchmarks
2+
3+
Results for
4+
http://localhost:8080/test/unit/test-bench.html
5+
6+
## MacBook Pro early 2011, i5, 2,3GHz, 4GB
7+
Safari 10.0.3
8+
- 2017-02-14: jQuery 3.1.1, jQuery UI 1.12.1,
9+
use _super instead of _superApply: 2220 ms
10+
1440
11+
- 2017-02-14: jQuery 3.1.1, jQuery UI 1.12.1: 2180 ms
12+
1413
13+
- 2017-02-14: jQuery 1.12.1, jQuery UI 1.11.4: 2440 ms

src/jquery.fancytree.table.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ $.ui.fancytree.registerExtension({
336336
opts = ctx.options,
337337
isStatusNode = node.isStatusNode();
338338

339-
res = this._superApply(arguments);
339+
res = this._super(ctx, title);
340340

341341
if( node.isRootNode() ) {
342342
return res;
@@ -364,7 +364,7 @@ $.ui.fancytree.registerExtension({
364364
node = ctx.node,
365365
opts = ctx.options;
366366

367-
this._superApply(arguments);
367+
this._super(ctx);
368368

369369
$(node.tr).removeClass("fancytree-node");
370370
// indent
@@ -436,6 +436,7 @@ $.ui.fancytree.registerExtension({
436436
treeDestroy: function(ctx) {
437437
this.$container.find("tbody").empty();
438438
this.$source && this.$source.removeClass("ui-helper-hidden");
439+
return this._superApply(arguments);
439440
}
440441
/*,
441442
treeSetFocus: function(ctx, flag) {

test/unit/test-bench.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
<html>
33
<head>
44
<title>Fancytree benchmarks</title>
5-
<script src="//code.jquery.com/jquery-1.12.1.min.js"></script>
6-
<script src="//code.jquery.com/ui/1.11.4/jquery-ui.min.js"></script>
5+
<script src="//code.jquery.com/jquery-3.1.1.min.js"></script>
6+
<script src="//code.jquery.com/ui/1.12.1/jquery-ui.min.js"></script>
77

8-
<link rel="stylesheet" href="../../lib/qunit.css" media="screen" />
8+
<link href="../../lib/qunit.css" rel="stylesheet" media="screen" />
99
<script src="../../lib/qunit.js"></script>
1010

1111
<link href="../../src/skin-win8/ui.fancytree.css" rel="stylesheet">

0 commit comments

Comments
 (0)