vt-clj
Immer
vt-clj | Immer | |
---|---|---|
2 | 142 | |
35 | 27,034 | |
- | 0.9% | |
10.0 | 7.1 | |
about 5 years ago | 19 days ago | |
Clojure | JavaScript | |
Apache License 2.0 | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
vt-clj
-
4x Smaller, 50x Faster
Perhaps, you should ask a question, why didn't the author reverse the question? Something like "How on earth was my implementation in a JITed language 50x slower on a warmed-up benchmark?" Where is the output of the profiler showing the exact bottlenecks? Of course, you can look at the repo and deduce some stuff, but it is a good habit to mention some key points about the environment such as compiler/ language/ browser versions, compiler settings, the hardware used etc.
Could he use more appropriate data structures? Could he avoid all the schema stuff that doesn't really improve the readability? Could he use better data structures later avoiding slow functions like update-in and migrating the bottlenecks to transducers and transients perhaps?
The author just did a rewrite and that is totally ok. He is trying things out and that is also quite alright. He provided some rather high-level benchmarks that would be really time consuming the reproduce and explain in more detail.
We have looked at the cljs code (e.g. https://github.com/asciinema/vt-clj/blob/master/src/asciinem...) with my colleague and it definitely isn't the best possible Clojure(Script) code around from a readability nor it seems performance standpoint.
To summarize, good that @sickill got a discussion going but it is best to step back and think about it in more depth. We all should apply more of this "extraordinary claims require extraordinary evidence" https://en.wikipedia.org/wiki/Sagan_standard
-
Asciinema rewrite from clojurescript to js&rust
This appear to be the source for the ClojureScript: https://github.com/asciinema/vt-clj
Immer
-
Comparing React state tools: Mutative vs. Immer vs. reducers
Immer is a lightweight package that simplifies working with immutable states. Immutable data structures ensure efficient data change detection, making it easier to track modifications. Additionally, they enable cost-effective cloning by sharing unchanged parts of a data tree in memory.
-
Immer VS mutative - a user suggested alternative
2 projects | 25 Jan 2024
-
Show HN: Cami.js – A No Build, Web Component Based Reactive Framework
```
It looks like it’s mutating, but both the reducers and update() uses immer* under the hood, so we still respect immutability under the hood.
Cami supports redux devtools so you can use that for time-travel debugging too!
—-
* https://github.com/immerjs/immer
- Why do we need modules at all?
-
Making Sense of React Server Components
I heard that immutability libraries like immer.js [0] help with this. Anyone go this way and had good success? Is this 'the way'?
[0]: https://immerjs.github.io/immer/
-
How We Fixed Performance With JS Object Variable Mutation
So, that's what we built, and we built it in the most obvious way — using JavaScript Proxy objects to track mutations and reflect those changes across Appsmith’s framework. Initially things looked good — it worked, aside from a few hacks to make some data types work with map and set, and we were following the example of other projects that had similar requirements. If it was good enough for them, it should be good enough for us, right?
-
The sword refers to immer, the faster and stronger immutable data js tool limu stable version released!
But is immer really the ultimate answer? The performance problem of immer is more prominent in large arrays and deep-level object scenarios. See this issue description, many authors in the community began to try to make breakthroughs, and noticed that structura and mutative, I found that it is indeed many times faster than immer as they said, but it still fails to solve the problem of both fast speed and good development experience. I will analyze the two issues in detail below.
-
Ramda: A practical functional library for JavaScript programmers
I like immer for this kind of thing: https://github.com/immerjs/immer
It gives you immutable updates without getting bogged down in FP abstractions.
-
Why my variable is being mutated if I make any changes to my data ?
I've always been a huge fan of immer for these case. For your code, it would simply turn into setGridData((prev) => produce(prev, draft => applyChanges(changes, draft)) but I recommend you go over their documentation to fully understand how it works
-
Is there a better way to do read-only types
If you're trying to make things actually immutable, Object.freeze and deep copies can clutter things up pretty good, have you considered using something like immer? (https://immerjs.github.io/immer/)