• Stars
    star
    19
  • Rank 1,163,249 (Top 23 %)
  • Language
    C++
  • License
    zlib License
  • Created over 4 years ago
  • Updated 7 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A sort wrapper enabling both use of random-access sorting on non-random access containers, and increased performance for the sorting of large types.

plf_indiesort

A sort wrapper enabling use of random-access (eg. std::sort) sorting on non-random access containers, and increased performance for the sorting of large types in random-access containers.

It has a temporary memory cost of N * (sizeof(pointer) + sizeof(size_t)) for sorting non-random-access iterators/containers,
and a N * sizeof(U) cost for random-access iterators/containers, where U = the smallest unsigned integer able to store N. For example if the size of the range being sorted is <= 255, U will be unsigned char.

Indiesort should be used when:

  • The temporary memory cost mentioned is non-problematic,
  • The container or iterators are not random_access and therefore std::sort cannot be used, and/or
  • The element type is large or non-trivially-movable/copyable.

It is, on average across all numbers of sorted elements:

  • +146% faster than std::sort when used on vectors or arrays of large structs (496 bytes). Crossover point for increased performance over std::sort is any type larger than 152 bytes.
  • +28% faster than std::list's internal sort, on types smaller than 272 bytes.

std::list's internal sort is faster for types larger than 272 bytes (as it only writes previous and next pointers) and std::sort is faster on vectors and arrays for types smaller than 152 bytes. C++98/03/11/14/etc-compatible.

More Repositories

1

plf_colony

An unordered C++ data container providing fast iteration/insertion/erasure while maintaining pointer/iterator validity to non-erased elements regardless of insertions/erasures. Provides higher-performance than std:: library containers for high-modification scenarios with unordered data.
C++
397
star
2

plf_list

A drop-in replacement for std::list with 293% faster insertion, 57% faster erasure, 17% faster iteration and 77% faster sorting on average. 20-24% speed increase in use-case testing.
C++
149
star
3

plf_nanotimer

A simple C++ 03/11/etc timer class for ~microsecond-precision cross-platform benchmarking. The implementation is as limited and as simple as possible to create the lowest amount of overhead.
C++
131
star
4

Windows-10-11-Simplifier

Windows 10/11 Simplifier - A script for automating simplifications and maintenance
Batchfile
122
star
5

plf_hive

plf::hive is a fork of plf::colony to match the current C++ standards proposal.
C++
70
star
6

plf_stack

A C++ data container replicating std::stack functionality but with better performance than standard library containers in a stack context.
C++
62
star
7

plf_queue

A C++ data container replicating std::queue functionality but with better performance.
C++
30
star
8

plf_engine

A modern(ish) cross-platform open-source 2D game engine built on top of SDL2. C++98/03/11/14/17 compatible. Requires plf::colony and plf::stack.
C++
16
star
9

plf_rand

A replacement for rand()/srand() that's ~700% faster and typically has better statistical distribution. An adaptationof Melissa O'Neill's PCG rand with a fallback to xor-rand for 32-bit code.
C++
13
star
10

plf_reorderase

A faster method for singular erasures, ranged erasures, and erase_if-style erasures for vector/deque/static_vector when element order is not important.
C++
5
star
11

win10_disable_defender

A simple script to disable the Defender antivirus in Windows 10. This can occasionally be useful, for example when wanting to avoid overhead during benchmarking or for low-latency applications like audio hosts.
Batchfile
4
star
12

plf_colony_old

Deprecated version of colony which will be updated when and if bugs are found. For backwards compatibility with users of colony version 5.
C++
1
star