Giter Site home page Giter Site logo

Comments (3)

idealvin avatar idealvin commented on May 4, 2024

第一个问题这两天在考虑中,fastring 在多线程环境下复制确实不安全,应该用原子操作,调用 base/atomic.h 提供的 atomic_inc 与 atomic_dec 即可。可以提一个 PR。

Json 中的引用计数也没有使用原子操作,则是出于性能上的考虑,一般不会在多线程中复制 Json 对象。

第二个问题可能不需要考虑,推荐使用 jemalloc 进行内存优化。

from coost.

idealvin avatar idealvin commented on May 4, 2024

替换全局的 operator new,operator delete,使用 jemalloc, tcmalloc 这类库应该就可以了

from coost.

lhmouse avatar lhmouse commented on May 4, 2024

allocator 显然应该是可替换的,标准库的容器几乎都支持(除了 std::array 以外)。

fastring 的问题多了去了,不如用 rocket::cow_string 吧(逃

from coost.

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.