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

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more