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

High memory consumption #168

Closed
zdila opened this issue Jun 16, 2019 · 16 comments
Closed

High memory consumption #168

zdila opened this issue Jun 16, 2019 · 16 comments
Assignees
Milestone

Comments

@zdila
Copy link

zdila commented Jun 16, 2019

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

@hsz
Copy link

hsz commented Jun 17, 2019

I can confirm that as well. Cold start of tsc still takes too much of the resources and time.

@mmalicki
Copy link

mmalicki commented Jun 17, 2019

Probably related to this, I noticed when I changed all my reducers from standard switch case to createReducer, compiler typechecking and autocomplete (in both VSCode and IntelliJ) slowed down noticably to the point where it's painful to use

@zdila
Copy link
Author

zdila commented Jun 17, 2019

@mmalicki that was actually also my case

@piotrwitek
Copy link
Owner

Thanks for the reproduction case 👍. I have confirmed an issue and will be working on that.

@piotrwitek piotrwitek self-assigned this Jun 17, 2019
@piotrwitek piotrwitek modified the milestones: v4.4.1, v4.4.2 Jun 17, 2019
@issuehunt-oss issuehunt-oss bot added the 💵 Funded on Issuehunt This issue has been funded on Issuehunt label Jun 18, 2019
@issuehunt-oss
Copy link

issuehunt-oss bot commented Jun 18, 2019

@issuehunt has funded $140.00 to this issue.


@hilkeheremans
Copy link

hilkeheremans commented Jun 20, 2019

I can also confirm the issue. Thanks so much for looking into it!

@piotrwitek piotrwitek modified the milestones: v4.4.2, v4.4.3 Jun 23, 2019
@piotrwitek piotrwitek mentioned this issue Jun 24, 2019
9 tasks
@piotrwitek
Copy link
Owner

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

@piotrwitek piotrwitek modified the milestones: v4.4.3, v4.5.0 Jun 24, 2019
@zdila
Copy link
Author

zdila commented Jun 24, 2019

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

@piotrwitek
Copy link
Owner

@zdila you can build the project locally and copy the dist folder or wait for me to release under the next branch in a few hours

@piotrwitek piotrwitek modified the milestones: v4.5.0, next, v5.0.0 Jun 24, 2019
piotrwitek added a commit that referenced this issue Jun 24, 2019
* Updated createReducer api with new method handleType
* Updated API docs
* Released 5.0.0-0
@piotrwitek
Copy link
Owner

Published on npm as @next

@issuehunt-oss issuehunt-oss bot added 🎁 Rewarded on Issuehunt This issue has been rewarded on Issuehunt and removed 💵 Funded on Issuehunt This issue has been funded on Issuehunt labels Jun 24, 2019
@issuehunt-oss
Copy link

issuehunt-oss bot commented Jun 24, 2019

@piotrwitek has rewarded $98.00 to @piotrwitek. See it on IssueHunt

  • 💰 Total deposit: $140.00
  • 🎉 Repository reward(20%): $28.00
  • 🔧 Service fee(10%): $14.00

@hsz
Copy link

hsz commented Jun 24, 2019

Shouldn't that be released as v4.5.0 since it's a major performance issue?

@piotrwitek
Copy link
Owner

There is a breaking change in the API and I'm respecting semver.
But I might consider it if that is something critical to the majority of the users.

@hsz
Copy link

hsz commented Jun 25, 2019

After upgrading to @next release, project hangs on tsc again with memory leak at the end (19x createAsyncAction, 1x createStandardAction).
4.4.2 is working fine.
What can I do to provide you more details?

@zdila
Copy link
Author

zdila commented Jun 25, 2019

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

@piotrwitek
Copy link
Owner

piotrwitek commented Jun 25, 2019

@hsz take a look at a great reproduction example from @zdila above and try to isolate the issue in your project in the same way. Only this way we can confirm the issue is on our end and not within your application setup.

piotrwitek added a commit that referenced this issue Oct 17, 2019
* Updated createReducer api with new method handleType
* Updated API docs
* Released 5.0.0-0
piotrwitek added a commit that referenced this issue Oct 20, 2019
* Updated createReducer api with new method handleType
* Updated API docs
* Released 5.0.0-0
piotrwitek added a commit that referenced this issue Oct 28, 2019
* Updated createReducer api with new method handleType
* Updated API docs
* Released 5.0.0-0
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

5 participants