jlfwong / jlfwong/speedscope

souremaps arent being applied

Open
#446 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
6.8k
Forks
320
PR merge metrics
No merged PRs in 30d

Description

Hi - trying to run speedscope to help optimize program startup. It doesn't seem like sourcemaps are being applied, making tracing operations challenging.

Screenshot 2023-11-07 at 10 36 16 AM

Here is a standalone script that closely mimics my setup, illustrating the issue:
test.sh

```sh
set -e
tmpdir=$(mktemp -d)

cat << EOF > $tmpdir/bar.ts
import http from "node:http";
function listenCallBack() {
console.log("Server is running");
setTimeout(() => {
console.log("exiting server...");
process.exit(0);
}, 100);
};

const server = () => {
const server = http.createServer((req, res) => {
res.end("Hello World");
});
server.listen("8080", listenCallBack);
return server;
};

export default server;
EOF

cat << EOF > $tmpdir/index.ts
import('./bar.ts').then((bar) => bar.default());
EOF

cd $tmpdir

npx esbuild --bundle --splitting --minify --sourcemap=linked --platform=node --format=esm --out-extension:.js=.mjs --outdir=./ index.ts

node --prof --enable-source-maps $tmpdir/index.mjs
node --prof-process --preprocess -j isolate*.log | npx speedscope -
rm -rf $tmpdir
```

Thanks!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.