Giter VIP home page Giter VIP logo

Comments (1)

leeoniya avatar leeoniya commented on May 25, 2024

i've worked with circular buffers before.

there are a lot of places in the codebase that expect the arrays to be 0-indexed, so this isnt just a case of switching out the loop in one or two places -- it would need to be done everywhere. additionally, you lose the ability to work with these arrays using native functions, or the flexibility of variable length arrays across data updates, etc. then, you now have to build an circular buffer abstraction to do all the same stuff you get for free with plain arrays, and this abstraction is not free, you will pay for it in CPU time in exchange for the memory savings.

i don't think the juice is worth the squeeze here. i'm sure there are cases when this would be helpful, like millions of datapoints being updated frequently, but i dont think it's worth complicating everything just for these extreme cases.

https://github.com/leeoniya/uPlot?tab=readme-ov-file#unclog-your-rendering-pipeline shows a pretty good stress test, with streaming 3600 datapoints at 16ms (60fps). you can see the function that generates the data via slice() + concat is mostly a rounding error in the profile. i'm interested to see your specific use case and what savings you're expecting the proposed changes to yield.

image

from uplot.

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.