Giter Site home page Giter Site logo

Slow about bdsup2subplusplus HOT 1 OPEN

DrXenos avatar DrXenos commented on August 15, 2024
Slow

from bdsup2subplusplus.

Comments (1)

amichaeltm avatar amichaeltm commented on August 15, 2024

Actually it's faster than the Java version in every test run I've ever done and that was with next to zero optimization effort.

Also, no it's not passing containers and strings that are being copied when passed via value. I don't think you actually understand how Qt containers and QString even works. QString is CoW and is only copied if edited. Same with the containers like QVector.

https://doc.qt.io/archives/qt-4.8/implicit-sharing.html

Many C++ classes in Qt use implicit data sharing to maximize resource usage and minimize copying. Implicitly shared classes are both safe and efficient when passed as arguments, because only a pointer to the data is passed around, and the data is copied only if and when a function writes to it, i.e., copy-on-write.

And if you read the list of classes that use implicit sharing, you'll see that all of the ones used in this code base are on that list. Maybe you should have done more than a quick look since your hot take is based in complete ignorance?

If you think you can do better, please feel free to submit a pull request along with actual benchmarking to show your version makes things any faster.

from bdsup2subplusplus.

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.