Giter Site home page Giter Site logo

Comments (9)

arximboldi avatar arximboldi commented on September 28, 2024

Hmmm, interesting, but it is hard to know if this is our problem with the few details you provided. A full stack trace would be nice. Also, to work around the problem, you could try using an alternative memory_policy.

from immer.

martinfinke avatar martinfinke commented on September 28, 2024

Yeah, I understand..I have the case in the Xcode debugger right now; I don't know if I can save the stack trace, but here's the call stack in words 😬:

  • We're on the com.apple.main-thread in _dyld_start
  • It calls ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&)
  • It calls __cxx_global_var_init.833(). This initializes the template <typename T, typename MP, bits_t B, bits_t BL> const rrbtree<T, MP, B, BL> rrbtree<T, MP, B, BL>::empty (in immer/detail/rbts/rbbtree.hpp:1274).
  • The initializer calls node_t::make_inner_n(0u).
  • In node.hpp:216, it executes the statement auto m = heap::allocate(sizeof_inner_n(n));.
  • This calls into immer/heap/with_data.hpp:42, where it executes: auto p = base_t::allocate(size + sizeof(T), tags...);.
  • This calls into immer/heap/unsafe_free_list_heap.hpp:64, where it executes: auto n = storage::head.data;.
  • Then we're in the thread-local wrapper routine at the point in the screenshot above.

With IMMER_NO_FREE_LIST set to 1, the crash doesn't occur.

from immer.

arximboldi avatar arximboldi commented on September 28, 2024

from immer.

martinfinke avatar martinfinke commented on September 28, 2024

Thanks, I'll use the workaround for now. Because it's about the allocation, it only affects the mutation performance, and not the iteration performance, right?

from immer.

arximboldi avatar arximboldi commented on September 28, 2024

@martinfinke that is correct, access performance should not be affected. Updates might become slower, depending on the particular data patterns you use. I wouldn't worry too much about it. (Btw, IMMER_NO_FREE_LIST to 1 has the same effect as passing that policy explicitly, but in that case that is affecting all immer instances.)

from immer.

martinfinke avatar martinfinke commented on September 28, 2024

Great, then performance is fine for now πŸ‘ (I'll leave this open, you can keep it if you want to fix something about this)

from immer.

arximboldi avatar arximboldi commented on September 28, 2024

Addressed by #42. @martinfinke can you check that this solves your problem once this lands master?

from immer.

martinfinke avatar martinfinke commented on September 28, 2024

Just tested it with optimisations, I can confirm that this has solved the problem. Thanks so much! πŸ‘

from immer.

arximboldi avatar arximboldi commented on September 28, 2024

from immer.

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.