Opened 13 years ago

Closed 13 years ago

#8968 closed defect (fixed)

dojox.gfx calls dojo.clone() waaaaaaay too much

Reported by: alex Owned by: Eugene Lazutkin
Priority: high Milestone: 1.4
Component: DojoX GFX Version: 1.3.0b3
Keywords: gfx, performance, charting Cc:
Blocked By: Blocking:


a relatively simple chart (the first in the chart2d test list) calls dojo.clone() 1337 times (no pun intended). Many of these calls are due to superclass chaining and blocks like this:

constructor: function(rawNode){
    this.shape = dojo.clone(dojox.gfx.defaultRect);

Given that nearly all of these constructors are effectively the same code, and given that we're using clone() as a way of copying in default value, it seems better to just have a function that either creates inlined versions of these data structures for use inside constructors or finds some other way to avoid the iteration and type checking overhead inherent in calling clone().

In general the GFX code looks to contain serious copy/iteration overhead in the fast path. We should find ways to do better.

Change History (4)

comment:1 Changed 13 years ago by alex

Keywords: charting added

comment:2 Changed 13 years ago by bill

Ref'd in [17110] and [17111].

comment:3 Changed 13 years ago by Eugene Lazutkin

Status: newassigned

Why is it still open? More work is expected or needs a review?

comment:4 Changed 13 years ago by alex

Resolution: fixed
Status: assignedclosed

I think there's a bit more to do on this front, but I'll file another bug to track GFX/charting performance stuff I'm working on.

Note: See TracTickets for help on using tickets.