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

TypeScript env a tad slow? #140

Open
plondon opened this issue Nov 11, 2021 · 1 comment
Open

TypeScript env a tad slow? #140

plondon opened this issue Nov 11, 2021 · 1 comment

Comments

@plondon
Copy link
Contributor

plondon commented Nov 11, 2021

Hey @raxod502! I've noticed that the typescript execution env can be particularly slow, sometimes taking around 10sec to perform simple tasks, like console.logs. Any idea how that can be improved?

@raxod502
Copy link
Member

raxod502 commented Nov 16, 2021

I see this as well:

0 riju@admin:/src$ make sandbox L=typescript  
L=typescript node backend/sandbox.js
Starting session with UUID 14127ad3a0d94e6a9f1019479736a75b
riju@typescript:~/src$ time run </dev/null
ts-node -i -e "$(< main.ts)"
Hello, world!
> 
real    0m2.658s
user    0m1.524s
sys     0m0.077s
riju@typescript:~/src$ time run </dev/null
ts-node -i -e "$(< main.ts)"
Hello, world!
> 
real    0m4.293s
user    0m2.373s
sys     0m0.128s
riju@typescript:~/src$ time run </dev/null
ts-node -i -e "$(< main.ts)"
Hello, world!
> 
real    0m5.115s
user    0m2.866s
sys     0m0.139s
riju@typescript:~/src$ time run </dev/null
ts-node -i -e "$(< main.ts)"
Hello, world!
> 
real    0m4.468s
user    0m2.579s
sys     0m0.083s

It looks like disabling type-checking (per https://github.com/TypeStrong/ts-node#typechecking) speeds it up a lot, but then there's not so much point to using TypeScript...

riju@typescript:~/src$ time ts-node -i -e "$(< main.ts)" -T </dev/null
Hello, world!
> 
real    0m0.673s
user    0m0.362s
sys     0m0.066s

Might be worth reproducing on bare metal and reporting upstream. It doesn't seem reasonable for this to take so long.

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

No branches or pull requests

2 participants