Open PikachuEXE opened 7 years ago
Wow, yeah that is really bad. I have no good options for you, I'm afraid. Here's my least worst picks for now:
I also encourage you to time all emails and log them somewhere to see if it's all emails of this type or if it is outliers. If it's outliers you might be able to log the input HTML somewhere to make it easier to replicate in development.
If you are able to identify where the problem comes from, I'd be interested in hearing it.
I apologize for not being able to help you more with this.
I looked at the consume_stylesheets
method. It goes through all stylesheet rules and searches the whole document for nodes matching them. If the number of selectors grow so will the runtime of this method. Same with larger documents.
All in all with M number of selectors and N number of elements in the tree, the searcher will look at M×N elements. This grows quickly if they get large.
We removed the unused styles and the time consumed in consume_stylesheets
has gone down.
Are there other methods to reduce the time?
Not that I can think of right now. I could help more with some profiler output.
We have email jobs running a long time (for even 1 email) We are monitoring the time spent with NewRelic Is there anyway to find out more about what's going on in it?
Screenshots
Code
Our integration code with trace: