Coder Social home page Coder Social logo

fluh's People

Contributors

streetstrider avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

bit-app-3000

fluh's Issues

eval optimizations for emission

Using eval violates strict CSP policy. However, it can bring huge perf benefits at the same time. I wonder, is it possible to use CSP and allow usage of eval, say, for current domain only.

My tests show that using eval technique for compose function provides almost the same perf as by writing function composition by hand. (web) eval-compose is slower by 5%, while reduce-compose is slower x3 times.

If it would be possible to apply to the graph computation as an optimization on per-graph basis (similar to current graph cache, but inline a lot more) it can yield big perf gain. Keep in mind that it would cause a bigger memory footprint and still worth to measure how much memory would be taken in that case.

Project status

Hello! Thank you for making an awesome library.

I see that there are some recent updates, and it's more active that flyd. I'm thinking of trying this out for a experimental production project, would you recommend me against that?

Stateless architecture

State management libraries usually feature something like createStore method. The purpose of it is to create state root for the current state management instance. This approach is correct, but I dislike it for additional level of instancing. But the alternative is worse: you need to make your module stateful by creating a single state instance inside of the imported module. It is not a big deal. Some packages have their own global state, (like fastdom and flyd itself), but it's not a perfect architecture (however, the real issues are small).

Right now fluh is stateful module. It has global Realm object designated for state. This approach does not break anything, since you can store multiple graphs in one realm, however there are small downsides. For instance, current cache system would invalidate all caches on every graph if one of the graphs changes.

I wonder, is there a way to solve all statefulness issues without introducing explicit «createStore»?

Solution might be to make graphs self-organize. Each graph should create single realm object and connect all Buds to it. In case of extension all newly created Buds (all of them are descendants) would be also connected to the same realm. In case of graph split, which essentially happens when partial ending graph, realm should also split.

Right now Buds have both direct and reverse references for finalization and memory cleaning purposes, so Buds in one graph can reach each other freely. It would not be a problem even to designate leader Bud if it would be required by new design.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.