Ticket #7788 (closed defect: fixed)

Opened 9 months ago

Last modified 3 months ago

[patch]Performance-regression in Dojo 1.2

Reported by: SteinM Owned by: toonetown
Priority: high Milestone: 1.2.1
Component: Dijit Version: 1.2beta
Severity: major Keywords: performance
Cc:

Description

There is a performance-regression in Dojo 1.2 and it is manifesting itself in NumberTextBox? and I've attached a simple test to demonstrate the case.

The profiler in Firebug shows that the method buildGroupRE in RegEx?.js gets called over 15 000 times for this simpled test compared to around 1 000 in Dojo 1.1.1.

I've havent done any investigation any further than what Firebug tells me about number of calls and calltime-percentage.

The testcase demonstrates resetting fields and inserting values into som NumberTextFields? and ValidationTextBoxes? and in IE7 the task of inserting values into 20 NumberTextBox?-fields have increased from around 100 milliseconds in 1.1.1 to around 900 milliseconds in 1.2.

Attachments

test_numbertextbox_performance.html (6.9 kB) - added by SteinM 9 months ago.
7788_formValidStatePerformance-1.2.patch (10.0 kB) - added by toonetown 9 months ago.
Single patch file (against the 1.2 branch) to potentially merge in.

Change History

Changed 9 months ago by SteinM

Changed 9 months ago by peller

  • owner changed from anonymous to doughays
  • component changed from General to Dijit

Doug - any idea if something changed in validation? I don't think the underlying number code changed much.

Changed 9 months ago by doughays

  • owner changed from doughays to nathan

Performance problem caused by the #4692 Form widget change. On every value change to a Form's children-widgets, every child's isValid() is being called.

Changed 9 months ago by toonetown

  • owner changed from nathan to toonetown

Changed 9 months ago by toonetown

  • priority changed from normal to high
  • status changed from new to assigned
  • milestone changed from tbd to 1.2.1

Changed 9 months ago by toonetown

(In [15416]) Refs #7788 addresses this performance issue in trunk - would like to have someone look over it before committing it to 1.2 branch.

Changed 9 months ago by doughays

Moving the call to this.isValid() to before this.connectChildren() needs to be looked at very closely. I would think that isValid() wouldn't have any children to look at in this case and we need to initialize the _invalidWidgets array in case 1 of the children are invalid on init.

Changed 9 months ago by toonetown

The reasoning for placing this.isValid call before connectChildren is to ensure that the _invalidWidgets array is populated before any of the connected children's onChange events fire.

Perhaps, however, it would make more sense to move the isValid call to *inside* connectChildren() (since if we re-call connectChildren, we probably want to make sure that the array is reset as well there).

Thoughts?

Changed 9 months ago by toonetown

You are correct - adding children after the fact (and then calling connectChildren) doesn't work with this current change. I have made modifications to the logic, and am checking in another fix.

Changed 9 months ago by toonetown

(In [15424]) Refs #7788 - change logic used for tracking valid state so that when connecting new children, our list of valid children is updated.

Changed 9 months ago by toonetown

Single patch file (against the 1.2 branch) to potentially merge in.

Changed 9 months ago by toonetown

  • summary changed from Performance-regression in Dojo 1.2 to [patch]Performance-regression in Dojo 1.2

Changed 9 months ago by toonetown

  • status changed from assigned to closed
  • resolution set to fixed

Fixed in branch in revision [15469]

Changed 3 months ago by bill

This actually caused a regression on a form where multiple fields are initially invalid... fixed in [17106] for 1.3 release.

Changed 3 months ago by bill

Plus typo fix in [17120].

Note: See TracTickets for help on using tickets.