Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webforms are very slow #14

Closed
lsolesen opened this issue Dec 18, 2013 · 5 comments
Closed

Webforms are very slow #14

lsolesen opened this issue Dec 18, 2013 · 5 comments
Assignees
Milestone

Comments

@lsolesen
Copy link
Member

The submissions of webforms are very, very slow. I tried switching the e-mail backend, but it did not do the trick. And the e-mails actually arrive in my mailbox some time before the form has finished loading.

Reported here: https://drupal.org/node/2159385

@ghost ghost assigned googletorp Dec 18, 2013
@lsolesen
Copy link
Member Author

I've also tested disabling mailchimp integration, but that does not speed up the process either.

@lsolesen
Copy link
Member Author

lsolesen commented Jan 8, 2014

It seems that other is also experiencing this: https://drupal.org/node/2159385

@googletorp
Copy link
Contributor

I found out why you are experiencing this, it all comes down to one line of code:

usort($all_selectors, array('self', 'sort_selector_precedence'));

In the mimemail module, it does something when sending mails related to CSS. You have 2848 style rules for your mails, and this explodes the above code.

I tried to trace the number of times the sort_selector_precedence is called, and after reaching 633705 times my PHP timed out.

If you reduce the mail styles for the mail - it should also work.

The code causing this can be found at mimemail_crompress.inc line 106

@lsolesen
Copy link
Member Author

Ok. Strange because the web form actually sends in plain text, I think. I would sponsor you making this method more robust and create a patch on d.o. Also maybe you would help reducing the number of styles for the e-mail. It is especially used for vih_short_course_commerce where commerce_message is used to send out e-mail, and the mail.scss is used for the needed mail styles, but guess it uses all the styles from all the stylesheets.

Den 10/01/2014 kl. 14.35 skrev Jakob Torp notifications@github.com:

I found out why you are experiencing this, it all comes down to one line of code:

usort($all_selectors, array('self', 'sort_selector_precedence'));

In the mimemail module, it does something when sending mails related to CSS. You have 2848 style rules for your mails, and this explodes the above code.

I tried to trace the number of times the sort_selector_precedence is called, and after reaching 633705 times my PHP timed out.

If you reduce the mail styles for the mail - it should also work.


Reply to this email directly or view it on GitHub.

@googletorp
Copy link
Contributor

I've looked through the code, and it's not really possible to improve it, since it needs to do the sorting in order for the code to actually work. The problem is that the styles needs to be organized by importance, since the styles are added to the from the CSS to the HTML.

I've solve the long load time by creating the mail.css in the sport theme, by running compass compile. This makes so that only the mail.css styles is used for the mails, which is a lot less styles, and the sorting time practically 0 now.

@ghost ghost assigned lsolesen Jan 12, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants