Giter VIP home page Giter VIP logo

Comments (7)

chrisuehlinger avatar chrisuehlinger commented on May 7, 2024

So I took about an hour and threw together a benchmark that pits d3.geo.length against an "optimized" version of length that doesn't reassign listener methods.

http://bl.ocks.org/chrisuehlinger/5ab433e12fbfa6c7d9b87be1a0c7e6f7

In Chrome I saw speedups ranging from 1.5x to 2.1x. In Mac Safari the gains were much smaller, 0.98x-1.15x. In Firefox it was about 1.1x-1.3x.

from d3-geo.

chrisuehlinger avatar chrisuehlinger commented on May 7, 2024

Any thoughts on this? It sounds like it could be a pretty clear win.

from d3-geo.

mbostock avatar mbostock commented on May 7, 2024

I’ve for this assuming that it tests well in real-world usage (like rendering a rotating orthographic projection). But it’s also a fair amount of work (given the complexity of clipping), and it might be a better long-term strategy to start work on a new composable graphics pipeline.

That said I’ve not started work on that, either… So if you want to take a crack at an optimization I see no harm in it. 😄

from d3-geo.

mbostock avatar mbostock commented on May 7, 2024

Related, it seems that string concatenation (string +=) is now faster than array.join, so perhaps PathString should be reimplemented. See also d3/d3-path#9.

from d3-geo.

chrisuehlinger avatar chrisuehlinger commented on May 7, 2024

You've mentioned the composable graphics pipeline a couple times, any idea when you might want to start work on it?

from d3-geo.

mbostock avatar mbostock commented on May 7, 2024

I started back in mid 2014 but I haven’t had time to work on it since. 😦 Here are two examples:

https://bl.ocks.org/mbostock/e2a20d86124693ef0f93
https://bl.ocks.org/mbostock/e48a00d4db5c3b042145

from d3-geo.

chrisuehlinger avatar chrisuehlinger commented on May 7, 2024

I recall that there was a branch on the old D3 repo (https://github.com/d3/d3/tree/graphics-pipeline) which was moving in this direction. Do you think it would be valuable to try and manually "rebase" this branch into d3-geo to see what kinds of questions it raises?

Also, should we make a new issue to keep track of this project?

from d3-geo.

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.