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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf(ts): transpileOnly when using nuxt-ts start #4906

Merged
merged 1 commit into from Feb 1, 2019

Conversation

kevinmarrec
Copy link
Contributor

@kevinmarrec kevinmarrec commented Jan 30, 2019

Types of changes

  • Bug fix (a non-breaking change which fixes an issue)
  • Performance (a non-breaking change which improves performance)
  • New feature (a non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Description

Knowing Runtime TypeScript are already type checked during nuxt-ts build, type checking is not needed during nuxt-ts start.

By using ts-node transpileOnly option for the nuxt-ts start command, it results in a faster startup & lower base RAM usage.

Some stats around my own production server (VPS)

transpileOnly Startup time Memory usage 馃搳
false ~10s 120MB 馃憥
true ~3s 70MB 馃憤

Checklist

  • I have updated tests to cover my changes
  • All updated and existing tests are passing.

@codecov-io
Copy link

codecov-io commented Jan 30, 2019

Codecov Report

Merging #4906 into dev will increase coverage by 0.08%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev    #4906      +/-   ##
==========================================
+ Coverage   91.74%   91.83%   +0.08%     
==========================================
  Files          73       73              
  Lines        2412     2412              
  Branches      593      593              
==========================================
+ Hits         2213     2215       +2     
+ Misses        181      179       -2     
  Partials       18       18
Impacted Files Coverage 螖
packages/typescript/src/index.js 68.42% <酶> (酶) 猬嗭笍
packages/vue-renderer/src/renderer.js 95.65% <0%> (+1.08%) 猬嗭笍

Continue to review full report at Codecov.

Legend - Click here to learn more
螖 = absolute <relative> (impact), 酶 = not affected, ? = missing data
Powered by Codecov. Last update fb13b41...72526cc. Read the comment docs.

@kevinmarrec kevinmarrec changed the title improvement(ts): transpileOnly when using nuxt-ts start perf(ts): transpileOnly when using nuxt-ts start Jan 30, 2019
@dschewchenko
Copy link

can you try typeCheck: false option for server?

@kevinmarrec
Copy link
Contributor Author

@dschewchenko typeCheck is false by default but type-checking is enabled only because transpileOnly is set to false by default : https://github.com/TypeStrong/ts-node/blob/master/src/index.ts#L194

It's kind of weird what they're doing right here, but as far I know, just transpileOnly: true should be fine.

@pi0 pi0 merged commit d7b57e0 into nuxt:dev Feb 1, 2019
@kevinmarrec kevinmarrec deleted the transpile-only-when-start branch February 20, 2019 16:31
@pi0 pi0 mentioned this pull request Mar 14, 2019
@danielroe danielroe added the 2.x label Jan 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants