Published unlisted
Edited
Aug 10, 2020
Importers
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
demangledProfile = profile.map(p =>
p.cat === 'disabled-by-default-v8.cpu_profiler' &&
p.args.data.cpuProfile &&
p.args.data.cpuProfile.nodes
? {
...p,
args: {
...p.args,
data: {
...p.args.data,
cpuProfile: {
...p.args.data.cpuProfile,
nodes: demangle(p.args.data.cpuProfile.nodes)
}
}
}
}
: p
)
Insert cell
Insert cell
demangleMap = demangleOutput
? new Map(demangleOutput.split('\n').map(line => line.split(' ---> ')))
: new Map()
Insert cell
Insert cell
names = profile
.filter(
p =>
p.cat === 'disabled-by-default-v8.cpu_profiler' &&
p.args.data.cpuProfile &&
p.args.data.cpuProfile.nodes
)
.flatMap(p => p.args.data.cpuProfile.nodes)
.map(f => f.callFrame.functionName)
Insert cell
Insert cell
function demangle(nodes) {
return nodes.map(n =>
demangleMap.has(n.callFrame.functionName)
? {
...n,
callFrame: {
...n.callFrame,
functionName: demangleMap.get(n.callFrame.functionName)
}
}
: n
);
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more