Skip to content

Visualise where time is spent when serving a request using live_svelte

Notifications You must be signed in to change notification settings

n18abdel/live_svelte_ssr_bench

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LiveSvelteSsrBench

This repository helps visualise where time is spent when serving a request using live_svelte. It leverages eFlambè to generate flamegraphs. This is inspired by elixir_1brc.

Example flamegraph

Existing Flamegraphs

Generating Flamegraphs

Start by launching the server with IEx:

MIX_ENV=prod mix assets.deploy
MIX_ENV=prod iex -S mix phx.server

Next, specify the function you want to capture (e.g. an entire request):

:eflambe.capture({Bandit.Pipeline, :run, 4}, 1, [])

Now, visit http://localhost:4000 in your browser. A .bggg file will be generated in the root directory. You can visualise it using Speedscope.

Notes

Only function calls within a single process are captured. If another process is called (e.g. using GenServer.call/2), the captured graph will show a sleep section while the calling process is waiting.

To gain a more comprehensive understanding, you can capture the function of the called process separately.

:eflambe.capture({NodeJS.Worker, :handle_call, 3}, 1, [])

Then, visit http://localhost:4000 again to generate a new trace.

About

Visualise where time is spent when serving a request using live_svelte

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published