⚙ D113413 Add introsort to avoid O(n^2) behavior and a benchmark for adversarial quick sort input. (original) (raw)

This is an archive of the discontinued LLVM Phabricator instance.

Table of Contentst-libcxx/-benchmarks/-algorithms.bench.cpp-include/__algorithm/-__algorithm/2/6sort.h-test/std/algorithms/alg.sorting/alg.sort/sort/-std/-algorithms/-alg.sorting/-alg.sort/-sort/-sort.pass.cppHide PanelfKeyboard Reference? Differential D113413 Authored by nilayvaish on Nov 8 2021, 8:48 AM.Download Raw DiffReviewers jdoerfertldionne Group Reviewers Restricted Project Commits rG7f287390d78d: [libc++] Add introsort to avoid O(n^2) behavior Repository rG LLVM Github Monorepo Event Timelinenilayvaish created this revision.Herald added a subscriber: mgrang. Harbormaster completed remote builds in B133037: Diff 385518.Comment ActionsHarbormaster completed remote builds in B133073: Diff 385570.Comment Actionsnilayvaish edited the summary of this revision. (Show Details)nilayvaish published this revision for review.nilayvaish edited the summary of this revision. (Show Details)Herald added a reviewer: jdoerfert. Herald added a project: Restricted Project. Herald added a reviewer: Restricted Project. Herald added subscribers: libcxx-commits, sstefan1. nilayvaish added a reviewer: ldionne.nilayvaish mentioned this in D93233: [libc++] Replaces std::sort by Bitset sorting algorithm..Harbormaster completed remote builds in B133130: Diff 385648.ldionne requested changes to this revision.ldionne added inline comments.libcxx/include/__algorithm/sort.h 264–273This revision now requires changes to proceed.Comment ActionsComment ActionsComment ActionsComment Actionsnilayvaish edited the summary of this revision. (Show Details)nilayvaish added inline comments.libcxx/include/__algorithm/sort.h 264–273Harbormaster completed remote builds in B133268: Diff 385833.danlark mentioned this in D96946: [libcxx][RFC] Unspecified behavior randomization in libcxx.Comment ActionsComment Actionslibcxx/include/__algorithm/sort.h 265This revision is now accepted and ready to land.Comment ActionsClosed by commit rG7f287390d78d: [libc++] Add introsort to avoid O(n^2) behavior (authored by nilayvaish, committed by ldionne). This revision was automatically updated to reflect the committed changes.ldionne added a commit: rG7f287390d78d: [libc++] Add introsort to avoid O(n^2) behavior.Comment Actions• Quuxplusone added a subscriber: • Quuxplusone.• Quuxplusone added inline comments.libcxx/include/__algorithm/sort.h 477• Quuxplusone mentioned this in D114133: [libc++] Minor fixups in the new introsort code..nilayvaish added inline comments.libcxx/include/__algorithm/sort.h 477• Quuxplusone added inline comments.libcxx/include/__algorithm/sort.h 477Comment ActionsHerald added a project: Restricted Project. Comment ActionsComment Actionshans mentioned this in D125958: [libc++] Use __libcpp_clz for a tighter __log2i function.Comment Actionshans mentioned this in rG865ad6bd2165: [libc++] Use __libcpp_clz for a tighter __log2i function.Comment ActionsComment Actionsphilnik mentioned this in D36423: [libc++] Introsort based sorting function.Comment ActionsComment Actionsnilayvaish mentioned this in D122780: Modify std::sort: add BlockQuickSort partitioning algorithm for arithmetic types.FilesHistoryCommitsPathSizelibcxx/benchmarks/algorithms.bench.cpp56 linesinclude/__algorithm/sort.h38 linestest/std/algorithms/alg.sorting/alg.sort/sort/sort.pass.cpp60 linesDiffIDBaseDescriptionCreatedLintUnitBaseBaseDiff 1385518c3b15b7Nov 8 2021, 8:48 AM★★Diff 2385570c3b15b7Fix compilation issues with cxx03Nov 8 2021, 10:50 AM★★Diff 338564843bb5f0Updated the commit message.Nov 8 2021, 3:32 PM★★Diff 4385819cba40c4Moved the diffs due to formatting by arc to a separate commit.Nov 9 2021, 7:44 AM★★Diff 5385823cba40c4Remove formatting diffs from the diff. It seems Phabricator is unable to show…Nov 9 2021, 7:49 AM★★Diff 6385824cba40c4Another attempt at uploading changes without formatting diff.Nov 9 2021, 7:50 AM★★Diff 7385833cba40c4Move the depth check after the initial switch so that small sized sorts are not…Nov 9 2021, 8:15 AM★★Diff 83876644eda928rG7f287390d78d301956e8e925a84349fd4408a11eNov 16 2021, 8:38 AM★★