typesafe-actions: High memory consumption

Issuehunt badges

Description

Cmpiling application with couple of reducers (~20) and action creators (~200) takes 2 GB RAM and requires passing --max-old-space-size to node when invoking tsc. Before fixing #164 it was much worse but it is still unuseable.

Steps to Reproduce

Steps to reproduce the behavior:

  1. Download and unpack https://drive.google.com/file/d/1FUzk5NeRfxUvwd4eXCxIFcb7Scmvh9D4/view?usp=sharing
  2. run npm i
  3. run node --max-old-space-size=8192 ./node_modules/.bin/tsc --diagnostics
  4. See the result

Expected behavior

Compilation of such project should be a piece of cake πŸ˜‰

Suggested solution(s)

Improve types or identify bug in TypeScript.

Project Dependencies

  • Typesafe-Actions Version: 4.4.1
  • TypeScript Version: 3.5.2
  • tsconfig.json: included in the tgz

Environment (optional)

  • OS: Debian Linux Buster
  • Node Version: 12.4.0
  • Package Manager and Version: npm 6.9.0

IssueHunt Summary

[ < i m g

s r c

’ h t t p s : / / a v a t a r s 0 . g i t h u b u s e r c o n t e n t . c o m / u / 7 3 9 0 7 5 ? v

4 ’

a l t

’ p i o t r w i t e k ’

w i d t h

2 4

h e i g h t

2 4

p i o t r w i t e k ] ( h t t p s : / / i s s u e h u n t . i o / u / p i o t r w i t e k )

h a s

b e e n

r e w a r d e d .

Backers (Total: $140.00)

Submitted pull Requests


Tips


IssueHunt has been backed by the following sponsors. Become a sponsor

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 6
  • Comments: 16 (6 by maintainers)

Commits related to this issue

Most upvoted comments

Thanks for the reproduction case πŸ‘. I have confirmed an issue and will be working on that.

PR is ready, now it’s infinitely scalable. will release a new version tomorrow.

@zdila You can test it now using the following in your project to confirm: npm i piotrwitek/typesafe-actions##168

Screen Shot 2019-06-24 at 3 01 13 AM

In my case typesafe-actions@next works now fine on my project. Thanks Piotr.

@piotrwitek thanks, but with npm i piotrwitek/typesafe-actions##168 there is no more dist in node_modules/typesafe-actions.