Coder Social home page Coder Social logo

Comments (9)

HDembinski avatar HDembinski commented on May 23, 2024

If you want to run benchmarks to check this claim of bad heap performance, be careful to do it correctly. On Linux, allocating an array of PODs with new will be "very fast", because the OS does not actually do anything yet. The actual allocation only happens when you write to this memory.

from boost-histogram.

henryiii avatar henryiii commented on May 23, 2024

Adding boost::optional adds a dependency, and this is something that should not happen "often", so paying a small cost should be okay. But it should be looked into.

from boost-histogram.

HDembinski avatar HDembinski commented on May 23, 2024

It will hurt in timeit benchmarks of the fill performance in Python. fast-histogram is 25x faster than numpy for small arrays because it doesn't allocate a second array for the bin edges.

from boost-histogram.

HDembinski avatar HDembinski commented on May 23, 2024

Some allocations were removed, but there are more to go.

from boost-histogram.

henryiii avatar henryiii commented on May 23, 2024

Keep in mind that making Python objects makes small allocations too, and also pays a little extra cost as well in Python bookkeeping.

from boost-histogram.

henryiii avatar henryiii commented on May 23, 2024

Immediately reading everything into C++ structures, then working on those (possibly without the GIL) would probably be the fastest way to work. (Thinking of Python arguments here, but could be applied to other places with small allocations possibly) I'm not against adding boost::optional if it helps the design, as well. At the moment I'll be focusing on things needed for 0.5, feel free to work on it though!

from boost-histogram.

HDembinski avatar HDembinski commented on May 23, 2024

Keep in mind that making Python objects makes small allocations too, and also pays a little extra cost as well in Python bookkeeping.

Creating new Python objects, yes. I avoid creating new Python objects. Creating a py::None costs nothing, since there is only one allocated instance of None in a Python program anyway.

from boost-histogram.

HDembinski avatar HDembinski commented on May 23, 2024

Immediately reading everything into C++ structures, then working on those (possibly without the GIL) would probably be the fastest way to work.

I don't believe this is true and you would sacrifice single-thread performance.

from boost-histogram.

HDembinski avatar HDembinski commented on May 23, 2024

I think this can be closed. I haven't noticed anything lately.

from boost-histogram.

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.