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

Slow rendering of large emails with tables #247

Open
ldodds opened this issue Oct 10, 2023 · 0 comments
Open

Slow rendering of large emails with tables #247

ldodds opened this issue Oct 10, 2023 · 0 comments

Comments

@ldodds
Copy link

ldodds commented Oct 10, 2023

What version of Bootstrap Email are you using?

v1.1.5

How are you compiling?

Rails

Code example

No response

Describe your issue

I've provided a bit of context in this issue which I originally reported on the premailer gem: premailer/premailer#434.

But to summarise:

  • we are generating some emails which use table layouts to present reports to users
  • some of these tables are large, e.g. a few hundred rows with a number of columns
  • a lot of the Bootstrap styles are of a form (e.g. h1 .badge > tbody > tr > td) which premailer is unable to optimise so the NokogiriFast adapter falls back to using nokogiri.
  • This results in very slow email compilation with periods of high CPU usage. Performance degrades with the size of the table in the email

It's difficult to see how to work around this, although open to suggestions! For now I think we are going to have to stop using bootstrap-email for at least some of our mailers.

This might also be causing, e.g. slow down in test suites depending on what layout/data people are using.

But this issue is almost certainly affecting anyone with tables in their email content.

Reviewing the bootstrap-email code I also see there's a final stage of beautifying the HTML. Is that needed, or could it be optional? Am wondering if there's other opportunities to optimise processing of large DOMs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant