tamasfe / taplo

A TOML toolkit written in Rust
https://taplo.tamasfe.dev
MIT License
1.37k stars 113 forks source link

Slow formatting when using @taplo/cli #606

Closed tifandotme closed 1 month ago

tifandotme commented 4 months ago

I tried installing both using @taplo/cli through npm and taplo-cli through cargo.

I've noticed that when using the latter, formatting time is instantaneous compared to the JavaScript wrapper, which took around 1 second.

Would you care to explain why this is the case?

Thank you for the amazing tool

panekj commented 1 month ago

Would you care to explain why this is the case?

It's because taplo-cli is a native executable build for your host while @taplo/cli is a JS script that is roundtripping via NodeJS runtime and loading WASM build of taplo-cli, therefore you get the overhead of the runtime + WASM.