EasyUI
Home
Demo
Tutorial
Documentation
Download
Extension
Contact
Forum
EasyUI Forum
May 13, 2024, 01:31:32 AM
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
:
Home
Help
Search
Login
Register
EasyUI Forum
>
General Category
>
EasyUI for React
>
Form.validate() performance
Pages: [
1
]
« previous
next »
Print
Author
Topic: Form.validate() performance (Read 4563 times)
chrwei
Full Member
Posts: 219
Form.validate() performance
«
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
Re: Form.validate() performance
«
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
Re: Form.validate() performance
«
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
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General Category
-----------------------------
=> News
=> General Discussion
=> EasyUI for jQuery
=> EasyUI for Angular
=> EasyUI for Vue
=> EasyUI for React
=> Bug Report
Loading...