davidmarkclements / 0x

🔥 single-command flamegraph profiling 🔥
MIT License
3.23k stars 106 forks source link

Passing stdin to the target script #243

Closed bitboxx closed 2 years ago

bitboxx commented 2 years ago

So I am trying to generate a flamegraph for this benchmark script: https://benchmarksgame-team.pages.debian.net/benchmarksgame/program/regexredux-node-4.html

The way the input is passed is using stdin:

/opt/src/node-v16.8.0/bin/node regexredux.node-4.js 0 < regexredux-input5000000.txt

0x doesn't seem to pass stdin to the target script. Is there a way to do this?

I've tried:

0x node-4.js 0 < regexredux-input5000000.txt

and

0x -- node node-4.js 0 < regexredux-input5000000.txt

But the input doesn't get passed through.

Note: I can of course replace fs.readFileSync('/dev/stdin'..., but then this could be the "bottleneck" to optimize.

mcollina commented 2 years ago

I don't think so. You might want to send a PR to support it, put it behind a flag.

github-actions[bot] commented 2 years ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] commented 2 years ago

This issue was closed because it has been stalled for 5 days with no activity.