We encountered a major performance issue in Forms on Umbraco 7.2.1. and hope this can be resolved in a short term because it's interfering big time with our development and deadline.
summary: when logged in as a member there is an exponential growth of calls to the database compared to unauthenticated.
result: We're building a rather large form with multiple pages and many fields. When logged in as a member, Opening the form and navigation through the form steps takes up to 40-60 seconds per click.
To reproduce it we installed a clean Umbraco installation and installed Forms with the help of the install button in the Forms section. We created a simple form with three steps (pages) and two text input field on each page. We created a member and a simple login form with the help of:
We used ANTS profiler. See the following two screenshots, especially the hit count column. This is only for a simple form with 6 fields. You can imagine what wil happen with larger forms with more fields.
The first screenshot reflects the calls when you're logged in as a member.
The second screenshot reflects if you're unauthenticated.
Hope there is a solution or quick fix. Thanks in advance!
In the meantime we have developed a quick fix which might come in handy for people who also experience this issue.
The issue
Using DotTrace we analysed the following snapshot:
We see that the ParsePlaceHolders is being requested a lot (in the Build(Form) method in 4 foreach loops). And the Membership.GetUser is requested foreach ParsePlaceHolder.
Create a new class that inherits MembersMembershipProvider and overrides the GetUser(string, bool) method.
public class CustomMembersMembershipProvider : MembersMembershipProvider
{
public override System.Web.Security.MembershipUser GetUser(string username, bool userIsOnline)
{
//get the user from HttpContext Items if available.
if (HttpContext.Current.Items.Contains(username))
{
return HttpContext.Current.Items[username] as System.Web.Security.MembershipUser;
}
var user = base.GetUser(username, userIsOnline);
//Only cache if the authenticated user is equal to the user that needs to be received. (prevents misuse of HttpContext Items)
if (HttpContext.Current.User.Identity.Name == username)
{
//we cache the user in the HttpContext Items to prevent roundtripping to the database.
HttpContext.Current.Items.Add(username, user);
}
return user;
}
}
Also, override the existing configuration setting for UmbracoMembershipProvider in the web.config /configuration/system.web/membership/providers to use your class (change the namespace and library name):
Major performance issues when logged in as member
Hi!
We encountered a major performance issue in Forms on Umbraco 7.2.1. and hope this can be resolved in a short term because it's interfering big time with our development and deadline.
summary: when logged in as a member there is an exponential growth of calls to the database compared to unauthenticated.
result: We're building a rather large form with multiple pages and many fields. When logged in as a member, Opening the form and navigation through the form steps takes up to 40-60 seconds per click.
To reproduce it we installed a clean Umbraco installation and installed Forms with the help of the install button in the Forms section. We created a simple form with three steps (pages) and two text input field on each page. We created a member and a simple login form with the help of:
We used ANTS profiler. See the following two screenshots, especially the hit count column. This is only for a simple form with 6 fields. You can imagine what wil happen with larger forms with more fields.
The first screenshot reflects the calls when you're logged in as a member. The second screenshot reflects if you're unauthenticated.
Hope there is a solution or quick fix. Thanks in advance!
My sympathies for your plight. We have been there, not for this issue, but for others.
In the meantime we have developed a quick fix which might come in handy for people who also experience this issue.
The issue
Using DotTrace we analysed the following snapshot:
We see that the ParsePlaceHolders is being requested a lot (in the Build(Form) method in 4 foreach loops). And the Membership.GetUser is requested foreach ParsePlaceHolder.
The Quick fix
Create a new class that inherits MembersMembershipProvider and overrides the GetUser(string, bool) method.
Also, override the existing configuration setting for UmbracoMembershipProvider in the web.config /configuration/system.web/membership/providers to use your class (change the namespace and library name):
Comment author was deleted
Thanks for reporting, has been fixed and will be in new release 4.0.1 coming tomorrow
is working on a reply...