Skip to content

v0.4.0

Choose a tag to compare

@davidesantangelo davidesantangelo released this 03 Apr 14:15
· 10 commits to master since this release

Added

  • Parallel Merge Dispatch (GCD): Implemented parallel execution for merge passes within the parallel sorting algorithm (vsort_parallel_int, vsort_parallel_float) on Apple platforms using dispatch_apply. This replaces the previous sequential merge loop, significantly improving performance for large arrays by leveraging multiple cores during the merge phase.

Changed

  • vsort_float Optimization: Removed the fallback to standard qsort. vsort_float now uses the internal adaptive sorting framework (parallel dispatch, quicksort, insertion sort) consistent with vsort for integers.
  • Hardware Detection (macOS): Improved robustness and efficiency by replacing popen calls with direct sysctlbyname system calls for detecting CPU cores, cache sizes, and other hardware characteristics.
  • Benchmark Mergesort: Refactored the custom_mergesort implementation in examples/benchmark.c to use a single, pre-allocated temporary buffer, making it more efficient and a fairer comparison against vsort.
  • Documentation (README.md): Significantly updated to accurately reflect the v0.4.0 implementation status, including the new parallel merge dispatch, NEON status (planned), revised technical details, and updated roadmap. Removed placeholder performance tables.
  • Quicksort Stack: Increased default stack capacity in iterative quicksort and improved safety checks.

Fixed

  • Build Warnings/Errors: Resolved various compiler warnings identified in previous builds, including MIN/MAX macro redefinitions (renamed to VSORT_MIN/VSORT_MAX), unused variables (pushed, timing_errors), unused functions (P/E core distribution logic, default float comparator), and issues with posix_memalign preprocessor checks.
  • Benchmark Example (examples/benchmark.c): Replaced INFINITY with DBL_MAX to resolve warnings/issues related to the -ffast-math flag. Moved srand call to the beginning of main for proper seeding. Corrected algorithm name reference from std::sort to std_sort. Improved result reporting logic.