1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

Replace parallel STL with PPQSort.

PPQSort is supposedly quite fast: https://github.com/GabTux/PPQSort

More importantly, it does not depend on TBB fuckery, so there's no longer
a need to link with an external library that people may or may not have.

The NO_PARALLEL_STL option is out, as it was provided solely to deal with
TBB being not available. Sequential sorting is still used on emscripten.
This commit is contained in:
Bartosz Taudul
2024-09-26 14:38:11 +02:00
parent d400183483
commit 1c1faeff2d
22 changed files with 42 additions and 71 deletions
-1
View File
@@ -6,7 +6,6 @@ option(LEGACY "Instead of Wayland, use the legacy X11 backend on Linux" OFF)
option(NO_ISA_EXTENSIONS "Disable ISA extensions (don't pass -march=native or -mcpu=native to the compiler)" OFF)
option(NO_STATISTICS "Disable calculation of statistics" OFF)
option(SELF_PROFILE "Enable self-profiling" OFF)
option(NO_PARALLEL_STL "Disable parallel STL" OFF)
include(${CMAKE_CURRENT_LIST_DIR}/../cmake/version.cmake)
+1 -1
View File
@@ -13,11 +13,11 @@
#include "TracyImGui.hpp"
#include "TracyMicroArchitecture.hpp"
#include "TracyPrint.hpp"
#include "TracySort.hpp"
#include "TracySourceView.hpp"
#include "TracyUtility.hpp"
#include "TracyView.hpp"
#include "TracyWorker.hpp"
#include "tracy_pdqsort.h"
#include "IconsFontAwesome6.h"
@@ -5,6 +5,7 @@
#include "TracyUtility.hpp"
#include "TracyView.hpp"
#include "TracyWorker.hpp"
#include "tracy_pdqsort.h"
namespace tracy
{
@@ -1,6 +1,7 @@
#include "TracyImGui.hpp"
#include "TracyPrint.hpp"
#include "TracyView.hpp"
#include "tracy_pdqsort.h"
namespace tracy
{
@@ -6,6 +6,7 @@
#include "TracyTimelineContext.hpp"
#include "TracyTimelineDraw.hpp"
#include "TracyView.hpp"
#include "tracy_pdqsort.h"
namespace tracy
{
@@ -8,6 +8,7 @@
#include "TracyTimelineItem.hpp"
#include "TracyTimelineContext.hpp"
#include "TracyView.hpp"
#include "tracy_pdqsort.h"
constexpr float MinVisSize = 3;
+4 -2
View File
@@ -7,7 +7,9 @@
#include "TracyImGui.hpp"
#include "TracyMouse.hpp"
#include "TracyPrint.hpp"
#include "TracySort.hpp"
#include "TracyView.hpp"
#include "tracy_pdqsort.h"
namespace tracy
{
@@ -507,10 +509,10 @@ void View::DrawFindZone()
}
}
auto mid = vec.begin() + vszorig;
#ifdef NO_PARALLEL_SORT
#ifdef __EMSCRIPTEN__
pdqsort_branchless( mid, vec.end() );
#else
std::sort( std::execution::par_unseq, mid, vec.end() );
ppqsort::sort( ppqsort::execution::par, mid, vec.end() );
#endif
std::inplace_merge( vec.begin(), mid, vec.end() );
@@ -1,6 +1,7 @@
#include "TracyImGui.hpp"
#include "TracyPrint.hpp"
#include "TracyView.hpp"
#include "tracy_pdqsort.h"
namespace tracy
{
@@ -4,6 +4,7 @@
#include "TracyMouse.hpp"
#include "TracyPrint.hpp"
#include "TracyView.hpp"
#include "tracy_pdqsort.h"
namespace tracy
{
@@ -9,6 +9,7 @@
#include "TracyTimelineContext.hpp"
#include "TracyTimelineDraw.hpp"
#include "TracyView.hpp"
#include "tracy_pdqsort.h"
namespace tracy
{
@@ -5,6 +5,7 @@
#include "TracyPrint.hpp"
#include "TracyMouse.hpp"
#include "TracyView.hpp"
#include "tracy_pdqsort.h"
namespace tracy
{