[*] Drop SOO suffixes to prevent confusion
[*] Update runtime [Linux optimizations]
This commit is contained in:
parent
0564888ca5
commit
8f7753f831
@ -1 +1 @@
|
||||
Subproject commit 7fa5650d291922c9e2934ae0e13b5be4c1b5673d
|
||||
Subproject commit 936400c1b6ad74f7bf0d9beb467a35c6ea2dfad8
|
@ -1 +1 @@
|
||||
Subproject commit 1f173a879970df05866ceee435982024b4ef7081
|
||||
Subproject commit 2a1556d80c1b4f58a1288054ba699eb3bda4f699
|
@ -17,34 +17,34 @@
|
||||
|
||||
TEST(Allocationless, SOO)
|
||||
{
|
||||
AuThreadPrimitives::ConditionMutexSOO condMutex;
|
||||
AuThreadPrimitives::ConditionVariableSOO condVariable(AuUnsafeRaiiToShared(condMutex.AsPointer()));
|
||||
AuThreadPrimitives::MutexSOO mutex;
|
||||
AuThreadPrimitives::EventSOO event(false, true, false);
|
||||
AuThreadPrimitives::SemaphoreSOO semaphore;
|
||||
AuThreadPrimitives::CriticalSectionSOO cs;
|
||||
AuThreadPrimitives::RWLockSOO rwLock;
|
||||
AuThreadPrimitives::RWRenterableLockSOO rwLock2;
|
||||
AuThreadPrimitives::ConditionMutex condMutex;
|
||||
AuThreadPrimitives::ConditionVariable condVariable(AuUnsafeRaiiToShared(condMutex.AsPointer()));
|
||||
AuThreadPrimitives::Mutex mutex;
|
||||
AuThreadPrimitives::Event event(false, true, false);
|
||||
AuThreadPrimitives::Semaphore semaphore;
|
||||
AuThreadPrimitives::CriticalSection cs;
|
||||
AuThreadPrimitives::RWLock rwLock;
|
||||
AuThreadPrimitives::RWRenterableLock rwLock2;
|
||||
|
||||
#if defined(TO_PROVE_A_POINT)
|
||||
|
||||
static_assert(sizeof(AuThreadPrimitives::MutexSOO) < sizeof(std::mutex));
|
||||
static_assert(sizeof(AuThreadPrimitives::MutexSOO) <= sizeof(std::mutex) / 5); // to really prove a point
|
||||
static_assert(sizeof(AuThreadPrimitives::Mutex) < sizeof(std::mutex));
|
||||
static_assert(sizeof(AuThreadPrimitives::Mutex) <= sizeof(std::mutex) / 5); // to really prove a point
|
||||
// we can be up-to 4x faster, usually at least a few ms at scale.
|
||||
|
||||
static_assert(sizeof(AuThreadPrimitives::RWLockSOO) < sizeof(std::shared_timed_mutex));
|
||||
static_assert(sizeof(AuThreadPrimitives::RWLockSOO) < (sizeof(std::shared_timed_mutex) / 2));
|
||||
static_assert(sizeof(AuThreadPrimitives::RWLock) < sizeof(std::shared_timed_mutex));
|
||||
static_assert(sizeof(AuThreadPrimitives::RWLock) < (sizeof(std::shared_timed_mutex) / 2));
|
||||
|
||||
static_assert(230 < sizeof(std::shared_timed_mutex));
|
||||
static_assert(103 > sizeof(AuThreadPrimitives::RWLockSOO));
|
||||
static_assert(90 > sizeof(AuThreadPrimitives::RWLockSOO));
|
||||
static_assert(89 > sizeof(AuThreadPrimitives::RWLockSOO));
|
||||
static_assert(103 > sizeof(AuThreadPrimitives::RWLock));
|
||||
static_assert(90 > sizeof(AuThreadPrimitives::RWLock));
|
||||
static_assert(89 > sizeof(AuThreadPrimitives::RWLock));
|
||||
|
||||
static_assert(sizeof(AuThreadPrimitives::MutexSOO) < sizeof(SRWLOCK) + sizeof(CONDITION_VARIABLE) + 4); // (SRWLOCKs are too dumb to used by themselves)
|
||||
static_assert(sizeof(AuThreadPrimitives::ConditionVariableSOO) < sizeof(std::condition_variable));
|
||||
static_assert(sizeof(AuThreadPrimitives::ConditionMutexSOO) < sizeof(std::mutex));
|
||||
static_assert(sizeof(AuThreadPrimitives::CriticalSectionSOO) < sizeof(CRITICAL_SECTION));
|
||||
static_assert(sizeof(AuThreadPrimitives::MutexSOO) <= sizeof(SRWLOCK) + 8 /*vtable*/); // should be more featureful than a SRWLock
|
||||
static_assert(sizeof(AuThreadPrimitives::Mutex) < sizeof(SRWLOCK) + sizeof(CONDITION_VARIABLE) + 4); // (SRWLOCKs are too dumb to used by themselves)
|
||||
static_assert(sizeof(AuThreadPrimitives::ConditionVariable) < sizeof(std::condition_variable));
|
||||
static_assert(sizeof(AuThreadPrimitives::ConditionMutex) < sizeof(std::mutex));
|
||||
static_assert(sizeof(AuThreadPrimitives::CriticalSection) < sizeof(CRITICAL_SECTION));
|
||||
static_assert(sizeof(AuThreadPrimitives::Mutex) <= sizeof(SRWLOCK) + 8 /*vtable*/); // should be more featureful than a SRWLock
|
||||
|
||||
// Optimized OS range given this SOO overhead: Windows NT 5.1 through Win 11.
|
||||
// AuRT could be dropped down to XP, if not for other subsystems and deps.
|
||||
@ -57,12 +57,12 @@ TEST(Allocationless, SOO)
|
||||
// less optimization, more slow compatibility layers, and lower res yielding, just to, i dont know, be forced into
|
||||
// "windows 8+ optimization?" "ucrt optimization?" to save like 8-16 bytes???
|
||||
#if 0
|
||||
static_assert(sizeof(AuThreadPrimitives::SemaphoreSOO) <= sizeof(SRWLOCK) + sizeof(CONDITION_VARIABLE) + 4);
|
||||
static_assert(sizeof(AuThreadPrimitives::MutexSOO) <= sizeof(SRWLOCK));
|
||||
static_assert(sizeof(AuThreadPrimitives::RWLockSOO) <= sizeof(std::shared_lock<std::shared_mutex>)); // optimized around winshit apis, not IWaitable
|
||||
static_assert(sizeof(AuThreadPrimitives::Semaphore) <= sizeof(SRWLOCK) + sizeof(CONDITION_VARIABLE) + 4);
|
||||
static_assert(sizeof(AuThreadPrimitives::Mutex) <= sizeof(SRWLOCK));
|
||||
static_assert(sizeof(AuThreadPrimitives::RWLock) <= sizeof(std::shared_lock<std::shared_mutex>)); // optimized around winshit apis, not IWaitable
|
||||
// note: performance will suffer under the stl under older windows versions
|
||||
|
||||
static_assert(sizeof(AuThreadPrimitives::SemaphoreSOO) <= sizeof(std::counting_semaphore)); // once again, this is optimized for a win8+ interface, and will suffer under older oses
|
||||
static_assert(sizeof(AuThreadPrimitives::Semaphore) <= sizeof(std::counting_semaphore)); // once again, this is optimized for a win8+ interface, and will suffer under older oses
|
||||
// wont cuck our apis into being this small and intentionally bad. im not microsoft.
|
||||
#endif
|
||||
|
||||
@ -92,7 +92,7 @@ TEST(Mutex, Benchmark)
|
||||
|
||||
for (AU_ITERATE_N(i, 1'000'000))
|
||||
{
|
||||
AuThreadPrimitives::MutexSOO mutex;
|
||||
AuThreadPrimitives::Mutex mutex;
|
||||
AU_LOCK_GUARD(mutex);
|
||||
}
|
||||
}
|
||||
@ -100,7 +100,7 @@ TEST(Mutex, Benchmark)
|
||||
{
|
||||
SysBenchmark("Mutex 2 Benchmark 1'000'000 [no-new]");
|
||||
|
||||
AuThreadPrimitives::MutexSOO mutex;
|
||||
AuThreadPrimitives::Mutex mutex;
|
||||
for (AU_ITERATE_N(i, 1'000'000))
|
||||
{
|
||||
AU_LOCK_GUARD(mutex);
|
||||
@ -408,7 +408,7 @@ TEST(RWLocks, SlashGod)
|
||||
// Test RWLocks in critical section mode
|
||||
TEST(RWLocks, DoubleReentrant)
|
||||
{
|
||||
AuThreadPrimitives::RWRenterableLockSOO rwlock;
|
||||
AuThreadPrimitives::RWRenterableLock rwlock;
|
||||
|
||||
// Test exclusive ownership
|
||||
ASSERT_TRUE(rwlock->AsReadable()->TryLock());
|
||||
@ -512,8 +512,8 @@ TEST(WaitOnAddress, WaitOnConstantForTimeout20SecondsUpdateAfter50ms)
|
||||
AuUInt64 uEndTime { };
|
||||
AuUInt64 uTimeFromAlert {};
|
||||
AuUInt64 uTimeToAlert {};
|
||||
AuThreadPrimitives::SemaphoreSOO semaphore;
|
||||
AuThreadPrimitives::SemaphoreSOO semaphore2;
|
||||
AuThreadPrimitives::Semaphore semaphore;
|
||||
AuThreadPrimitives::Semaphore semaphore2;
|
||||
|
||||
auto thread = AuThreads::ThreadUnique(AuThreads::ThreadInfo(
|
||||
AuMakeShared<AuThreads::IThreadVectorsFunctional>(
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 7e33b6a1c497ced1e98fc60175aeb4678419281c
|
||||
Subproject commit f42da0e4431a14260946323bff4d856f20973b2c
|
2
Vendor/brotli
vendored
2
Vendor/brotli
vendored
@ -1 +1 @@
|
||||
Subproject commit 9ff341daaf2419e7985c89ec09964c81e4e2f3da
|
||||
Subproject commit 0f2157cc5e7f6a28bf648738c208ca825917589a
|
Loading…
Reference in New Issue
Block a user