Comments (7)
Modern garbage collectors should work just fine cleaning up for references once the Var / Val is dereferenced or out of scope.
As for obs.detach()
, the Observer
can be attached to several Observable
s, so would you really want that to detach from everything referencing it? Further, it would be problematic as it would create a double-linking, which would create a GC issue as both sides would have to be dereferenced before either could be GD'd.
If you have any other suggestions, contributions, or are interested in providing documentation, I would be very happy to assist in any way I can. Reactify is incredibly powerful, but hasn't received a lot of visibility.
from reactify.
Hey, thank you very much for the clarifications. After taking a closer look your source code I understand now, how you avoid leaks - I initially assumed a slightly different architecture, where Vars and Vals are Observers and Observables at the same time - so exactly the double linking issue you mentioned :-)
I will look definitely further into using reactify. If I have further suggestions or ideas, I'll let you know or send a pull request.
from reactify.
Feel free to create a PR adding some explanation to the README if you think you can add some clarification regarding memory leaks before closing this ticket.
from reactify.
I will do so, if I have an idea how to make it clearer.
Staying with the topic of memory leaks - are you sure that the functions map
and collect
in the Observable
class are not leaking? From my understanding, upon detaching from the Observable
they return, there still remains the Observer
on the original Observable
created in both of the functions (line 106 and 113) in the file Observable.scala
.
I did also some small Benchmarks (nothing which is solid enough to share numbers) comparing reactify to Monix. On the JVM Monix was roughly twice as fast when it came to data propagation. With Scala.js on Chrome the same story. Intrestingly on Firefox reactify was three to four times slower than Monix. Though for most applications this difference in performance should be negligible as both libraries are fast enough for UI programming.
from reactify.
It's not unreasonable to assume Reactify will be somewhat slower. I haven't done a lot of optimizations, but the way Reactify works is a little bit more processing-centric than the other options. If you'd like to create a little benchmark project to show this I'd be happy to see if I can't improve it. I'm actually in the middle of doing exactly that with my logging framework right now.
from reactify.
@joschuafink is there anything left to be done on this issue or can it be closed?
from reactify.
@joschuafink closing the issue due to non-response. If you have any further issues please either create another ticket or comment here and I'll re-open the ticket.
from reactify.
Related Issues (18)
- Fix recursive bug with Dep
- Observable.wrap fixes HOT 1
- Support Managed Observable Changes
- Listener Notification Type
- scalajs 1.0.0-M1 build HOT 4
- Fix StateInstance recursion bug HOT 2
- Add capability to set `monitoring` during assignment.
- Future Assignment
- Support State Saving / Loading HOT 1
- Capture method
- Bug in `and`
- Weird binding problem in scalajs! HOT 4
- Add Support for Try HOT 1
- Observable Builder
- FutureObservable
- Transaction Support
- Performance Benchmarks
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from reactify.