Git Product home page Git Product logo

Comments (4)

kishorenc avatar kishorenc commented on May 14, 2024

@elfring I'm generally a fan of smart pointers as raw pointers can become hard to manage. In this case, however I refrained from wrapping for a couple of reasons:

  1. Parts of Typesense initially began as a C project, and still uses some C-style code so those parts just used raw pointers.
  2. To a lesser extent, I was worried about the performance overhead introduced (admittedly this is more of a case for shared_ptr than unique_ptr) in hot loops. I did do some initial benchmarks where I saw some serious degradation.

In the end, instead of adopting a mixed style, just ended up not using it anywhere. To detect and prevent leaks, we have an integration test suite (which is not part of this repo) that's run under Valgrind.

from typesense.

elfring avatar elfring commented on May 14, 2024

How do you think about to improve the implementation of the member function “array::remove_index” (for example)?

from typesense.

kishorenc avatar kishorenc commented on May 14, 2024

@elfring I'm sorry for going silent on this thread. We're comfortable with using raw pointers as of today, given the heavy interoperability with the C libraries we're using. We might relook this at future. Thanks for bringing this up though!

from typesense.

elfring avatar elfring commented on May 14, 2024

The interoperability concerns do not matter for affected C++ classes.
Under which circumstances will you start to care for exception safety?

from typesense.

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.