Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"are source maps just… really really really slow?" #2558

Open
armanbilge opened this issue Nov 17, 2021 · 3 comments
Open

"are source maps just… really really really slow?" #2558

armanbilge opened this issue Nov 17, 2021 · 3 comments

Comments

@armanbilge
Copy link
Member

Running the tracing example from the docs on Node.js with the exact same tracing parameters.
https://typelevel.org/cats-effect/docs/tracing#complete-code

CATS_EFFECT_TRACING_BUFFER_SIZE=64 CATS_EFFECT_TRACING_MODE=FULL node --enable-source-maps example/js/target/scala-2.13/cats-effect-example-fastopt/main.js

With sourcemaps:

real    0m4.981s
user    0m4.218s
sys     0m1.119s

Without:

real    0m0.169s
user    0m0.152s
sys     0m0.025s

One idea is to provide tooling/utility that takes unsourcemapped exceptions + a sourcemap and provides sourcemapped exceptions.

@armanbilge armanbilge changed the title "source maps just… really really really slow" "are source maps just… really really really slow?" Nov 17, 2021
@armanbilge
Copy link
Member Author

Relevant to #2284.

@armanbilge
Copy link
Member Author

armanbilge commented Nov 17, 2021

Another idea to try is loading source-maps into memory (instead of file access) as demonstrated here:
https://www.npmjs.com/package/source-map-support#options

H/t @ChristopherDavenport

@armanbilge
Copy link
Member Author

armanbilge commented Nov 24, 2021

A follow up on this: my measurements used node --enable-source-maps which actually doesn't use source-map-support (see scala-js/scala-js-js-envs#20, #2582) so the comment above might not be relevant actually.

Also, I'm not sure if using the default source map functionality in Scala.js (which uses source-map-support) has the same performance problem. I don't think so, but should check again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant