I have been a full stack developer at Blue Triangle for a little over a year. Previously I worked in the government and healthcare sectors as a Scientist and Engineer.
What else can I do to optimize my site?
The three parts are:
- the call stack,
- the callback queue, and
- the event loop.
What is the call stack?
Then what’s the callback queue?
So does the event loop really matter?
The event loop is the messenger between the different components that keeps everything running smoothly. It places functions on the top of the call stack and places each asynchronous action in those functions into the callback queue. Not only that, it handles the execution of functions and processes, too.
I get it. But what does Java Script execution have to do with making my page slow?
- Functions that add many actions to the callback queue will take longer to execute.
- Any additional functions in the call stack must wait for the current function to finish executing before they can begin executing.
- Lastly, whenever the event loop executes the function at the top of the call stack, page rending and DOM manipulation stop until the event loop can pick up the changes when execution is complete.
But how do I know if a function is taking too long?
The question Blue Triangle engineers had to answer was how to detect long-running functions so that we and our customers could see where there might be problems with script execution. If we could find long-running tasks on a user’s page load, we could take actions to make them asynchronous, reduce their complexity, or move the function further down the stack to keep it from blocking critical functionality. Blue Triangle’s function tracing feature taps into the Java Script stack and records the timings for every function that gets added to the call stack. We use a waterfall graph to represent the duration and order of each function. We also plot key stages of the page load, like Time To Interactive, to see exactly what functions might be affecting your users’ experience or keeping your page from having the load time you’re targeting.
How can I tell if it’s a persistent issue?
We also store functions performance over time and aggregate the data. Looking at function performance across a week or month can help you figure out which functions are consistently under-performing.
Not only that, but you can chart your progress making the page faster as you tweak your functions, create AB segments for pages that load your functions differently, and a plethora of other performance monitoring features included in Blue Triangle’s synthetic monitoring package.
At the end of the day, we let you make more informed choices for improving your site in a way that is meaningful to your users. Let us know if we can help.