EasyUI Forum
April 28, 2024, 04:17:01 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Form.validate() performance  (Read 4485 times)
chrwei
Full Member
***
Posts: 219


View Profile Email
« on: February 04, 2020, 02:50:13 PM »

I have a complex form with about 50 fields, but only 20 of them have rules, though I'll likely expand that.

when i call validate(), whether or not there are any rule errors, I'm seeing a fairly consistent 4.5 second delay on an N3350 Chromebook and 1.2 second delay on an i5-8400.  latest Chrome browser versions.  my timing is logging `Date().getTime()` on the line before calling validate and again on the first line in the callback.  1 second I can deal with, 4 seconds I cannot.

I do have a custom validateRules and most of the 20 fields do have more than one. 

in testing, I've changed it to "rules={{}}" and the delay remains, so I don't see how it could be my rules, which aren't very complex.  I've also removed "rules={myModelrules}" and the callback is never called, which I guess is expected, but it is very fast.

Logged
chrwei
Full Member
***
Posts: 219


View Profile Email
« Reply #1 on: April 10, 2020, 05:26:13 PM »

I'm still finding this to be an issue. I've optimized so that it doesn't call the full validate very often, and that helps, but in some cases it just needs done.

is my only option to split it into multiple forms and hope I don't need to validate more than one form in any given process?
Logged
chrwei
Full Member
***
Posts: 219


View Profile Email
« Reply #2 on: April 20, 2020, 08:54:24 AM »

I think I've worked out what's killing performance on this, at least in my case.

it's looping ALL fields and checking if they have a rule.  it would be a lot faster if it looped the rules and check for the fields, as not all fields have rules.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!