Giter Site home page Giter Site logo

Comments (5)

threepointone avatar threepointone commented on June 11, 2024 1

Got a huge win by using 'insertRule' in production, anywhere from 10-2000x.

from glamor.

JakeCoxon avatar JakeCoxon commented on June 11, 2024

Any ideas on recovering unused rules? I like to write css as a function of state like state => style({ color: state.color }) but this has potential to create a bunch of unused rules.

My idea is to keep track of what elements are actually using the rules and discard those rules if they aren't. We can do this with mutation observer, it would keep this library from being react specific which could be nice. But it may be pretty shitty for performance so needs some tests. I can look into it if you want to head in this direction?

from glamor.

threepointone avatar threepointone commented on June 11, 2024

There's an experimental keyed(key, style) that reuses rules with the same key, that might help. That said, I thought a bunch about removing unused rules, and it didn't make much sense to me for css (and is really hard to implement right, especially when using in shared environments).
Some more thoughts here #1 (comment) and I'll be validating some of those theories here #13

from glamor.

threepointone avatar threepointone commented on June 11, 2024

perf is 'mostly solved' over the last few releases. closing.

from glamor.

eladmoshe avatar eladmoshe commented on June 11, 2024

@threepointone as a newcomer, I am really interested to see some info what to expect performance wise (compared to plain CSS). I see there is a placeholder for that in the docs but it appears to be empty. Some benchmarking would be even better.
As migrating existing project to Glamor is a big investment, it would be reassuring to know what to expect.

from glamor.

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.