Giter VIP home page Giter VIP logo

Comments (2)

yoshuawuyts avatar yoshuawuyts commented on May 13, 2024

For example, rather than using childNode, use firstChild and loop through via nextSibling as DOM nodes are based on a two-way linked list – not a graph/array structure.

Oh, that's cool! Had no idea 😁


Also, I did some tests recently and its far more effective to create a lightweight "vdom" object upon inspecting and calculating what exists in a real DOM node and storing this in a WeakMap based on the DOM node itself being the key

Very interesting. What do you mean by "monomorphic" - I'm not familiar with the term in this context.

I like the idea you sketch out with WeakMap, though it's a shame it's not supported widely enough yet. We'd have to pull in a polyfill and given we seem to optimize for simplicity & file size it's probably not worth it. I was wondering if it'd be possible to do the same with an LRU-cache, but given we'd store the DOM nodes longer than we need to the potential of leaking means we could end up being worse off - I'd rather not hog too much memory haha.

To be honest I think between isSameNode() caching and requestIdleCallback in polite-element we should already be fast enough for most applications 🚀 - thanks heaps for the feedback!! ✨

from nanomorph.

kristoferjoseph avatar kristoferjoseph commented on May 13, 2024

COURAGE

from nanomorph.

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.