helping branch prediction

This commit is contained in:
d1str4ught
2026-01-30 03:29:58 +01:00
parent 1eb9743742
commit 30ff18e982
11 changed files with 28 additions and 118 deletions

View File

@@ -71,7 +71,7 @@ struct FEffectUpdator
}
void operator () (CEffectElementBaseInstance * pInstance)
{
if (pInstance->Update(fElapsedTime))
if (pInstance->Update(fElapsedTime)) [[likely]]
isAlive = TRUE;
}
};

View File

@@ -67,16 +67,13 @@ void CEffectManager::Update()
pEffectInstance->Update(/*fElapsedTime*/);
if (!pEffectInstance->isAlive())
{
itor = m_kEftInstMap.erase(itor);
CEffectInstance::Delete(pEffectInstance);
}
else
{
if (pEffectInstance->isAlive()) [[likely]] {
++itor;
continue;
}
itor = m_kEftInstMap.erase(itor);
CEffectInstance::Delete(pEffectInstance);
}
}

View File

@@ -300,15 +300,13 @@ bool CParticleSystemInstance::OnUpdate(float fElapsedTime)
{
CParticleInstance * pInstance = *itor;
if (!pInstance->Update(fElapsedTime,fAngularVelocity))
{
if (!pInstance->Update(fElapsedTime,fAngularVelocity)) [[unlikely]] {
pInstance->DeleteThis();
itor = m_ParticleInstanceListVector[dwFrameIndex].erase(itor);
m_dwCurrentEmissionCount--;
}
else
{
else [[likely]] {
if (pInstance->m_byFrameIndex != dwFrameIndex)
{
m_ParticleInstanceListVector[dwFrameCount+pInstance->m_byFrameIndex].push_back(*itor);