Giter VIP home page Giter VIP logo

Comments (10)

Voultapher avatar Voultapher commented on August 30, 2024 1

Regarding how to communicate the performance improvements, saying ~2x for both stable and unstable sort is somewhat based in reality, however I'd much prefer not to mention a single number x or % improvement, as that depends on the input pattern, input length and input type, and we see in our testing changes ranging from no change at all, all the way up to 17x faster execution. I'd rather we say that the performance improved significantly and link to the relevant section in the design documents that explains our methodology and results for evaluating the change in performance slice::sort and slice::sort_unstable.

from rust.

workingjubilee avatar workingjubilee commented on August 30, 2024

cc @Voultapher @orlp if you want to have input on the relnotes here.

from rust.

joshtriplett avatar joshtriplett commented on August 30, 2024

Sketch for the compatibility aspect (not covering the details of the performance improvement):

The implementations of sort functions (sort, sort_by, sort_by_cached_key, sort_by_key, sort_unstable, sort_unstable_by, sort_unstable_by_key) now have higher performance. These functions may now panic if the implementation of Ord or the supplied comparison function is not a total order.

from rust.

Voultapher avatar Voultapher commented on August 30, 2024

select_nth_unstable, select_nth_unstable_by and select_nth_unstable_by_key are also affected. Though we expect to see less impactful performance differences on x86-64, Arm however should see larger improvements as it sees larger improvements for the new unstable partition code.

from rust.

workingjubilee avatar workingjubilee commented on August 30, 2024

Should probably use these permalinks specifically:

from rust.

the8472 avatar the8472 commented on August 30, 2024

Do we have any source of randomness in the unstable sort to ensure it's really unstable (like hashmaps)? If not the compat note could also mention that the order changed in case someone accidentally relied on it.

from rust.

workingjubilee avatar workingjubilee commented on August 30, 2024

No, we do not, it's deterministic within a version.

from rust.

workingjubilee avatar workingjubilee commented on August 30, 2024

...and yes, it was in fact the case that someone asserted on this order in a test and the test was regressed as a result.

from rust.

orlp avatar orlp commented on August 30, 2024

No, we do not, it's deterministic within a version.

We do right now. I don't know if we actually guarantee this, and perhaps we could in the future use randomness for e.g. pivot selection. It's a bit weird because the current stable "current implementation" notes mention determinism, but.. well, it's in the "current implementation" section, not general guarantees.

from rust.

Voultapher avatar Voultapher commented on August 30, 2024

Should probably use these permalinks specifically:

It can be useful to have the ability to fix typos. I plan on keeping these links stable.

from rust.

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.