Coder Social home page Coder Social logo

needless memory allocations about ponder HOT 2 OPEN

billyquith avatar billyquith commented on September 18, 2024
needless memory allocations

from ponder.

Comments (2)

billyquith avatar billyquith commented on September 18, 2024

Thanks for the feedback. Yes, that is something I'd like to deal with at some point. You get the same problem when declaring scripting (e.g. Lua) interfaces. Also, all of the string compares are not efficient.

This library is a fork of CAMP and other users attempted to fix this problem by using hashing, e.g. refer to 16tons/camp@5e382f9

I forked from the source version though as I'd like to tackle the problem slightly differently. I was thinking of adding an "identifier trait" which could be overloaded depending on the project. I've previously used cached strings and hashes, which is much more efficient, and I recently found a nice implementation of this on GitHub: https://github.com/foonathan/string_id

I wasn't aware of string_view, thanks I'll keep an eye on that, a useful concept, and perhaps part of a future solution.

I'd also like to take a closer look at the allocations at some point, the number, and space used. I consider the library in "beta" at the moment. It "works" but needs a good testing in reasonably complex real project. Started doing this in Gwork: https://github.com/billyquith/GWork/tree/ponder

from ponder.

billyquith avatar billyquith commented on September 18, 2024

This is implemented in the 1.3 branch. I have used traits for the identifier types so that the types may be changed in the future, e.g. EASTL, or string_id.

Thanks for the feedback.

from ponder.

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.