Git Product home page Git Product logo

Comments (3)

antoyo avatar antoyo commented on June 29, 2024

Your first suggestion was the way used in the very first versions of relm and I switch to the more idiomatic &mut Model and it will probably come back to be an attribute to self.

In any case, neither of these solutions solve the issue with efficiently updating the view.

Are you worried about performance?

One solution that I thought to produce a more efficient version is currently described in a comment.

This idea can be schematized as follow:

            *
          /   \
        A       A
          \    /
            1

where 1 updates the properties bound to the model attribute A.
This is the case of a condition: this will result in generating one call to set_property() instead of 2.
I believe the same logic can be applied to loops so that the view is only updated after the loop.

However, it is complex to implement, so it will probably take some time before I do it.

from relm.

jeandudey avatar jeandudey commented on June 29, 2024

Are you worried about performance?

No, i'm not worried about performance, i just thought that it was too magical and slightly hard to know was going under the hood.

from relm.

antoyo avatar antoyo commented on June 29, 2024

If you're not worried about performance, then I believe you want to view to be updated as a whole with the new model, right?
I think recreating the view each time is a huge cost, so it will degrade the performance in a visible way when creating complex view.

One solution (that is currently impossible because not implemented in GTK+ yet) is to switch to GTK Scene Graph. As the API is not yet available, I'm not sure how it will look, but that will fix this issue, I think, amongs others.

from relm.

Related Issues (20)

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.