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

Not compatible with S.subclock #82

Open
irisjae opened this issue Jan 18, 2019 · 2 comments
Open

Not compatible with S.subclock #82

irisjae opened this issue Jan 18, 2019 · 2 comments

Comments

@irisjae
Copy link

irisjae commented Jan 18, 2019

Hi Adam! It seems like S.subclock isn't compatible with surplus... which is a shame!

When I substituted s-js in my project for s-js/dist/withsubclocks, the signals from Surplus and the signals from S no longer belong to the same S, and so the dependency detection breaks. So, I tried several things to try fix it. First I tried Surplus.S = S, but then I found out the architecture for subclocks S is quite different from the regular S; surplus promptly complains because S doesn't have S.effect defined. Checking the source code, I assumed S.effect performs a similar function as a regular computation, so I tried adding Surplus.S.effect = S, but then performance basically dies, alas.

Hope you could help clear things up! Cheers

@adamhaile
Copy link
Owner

Shoot, yeah, I've sort of got two experiments going right now, subclocks and another effort around exposing a lower-level API to the internal dependency graph. S.effect() grew out of the second of those two (it itself is not part of the lower-level API, but the changes to make the lower-level API happen made S.effect() easy). But I haven't merged that lower-level API work back into the subclocks variant yet, because it's still in development. Hence your issues.

How bad did perf get when you tried using plain S() instead of S.effect()? Some of the delta may have been from subclocks: it's a considerably more complicated, and also less optimized, piece of code than main S. In fact, that's the main reason it's not the only version of S -- I wasn't willing to do that until I'd brought perf to a closer level.

@irisjae
Copy link
Author

irisjae commented Jan 21, 2019

Ahh I see! Let me revert my project back to the S.subclock commit to take a look at what specifically
caused the performance problems. I do think it was some issue with garbage not being collected. I recall having many computations suddenly show up on the console every second.

Am also interested in how your new experiment changes the dependency graph!

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

No branches or pull requests

2 participants