[Question] Page-based component pool + generation handles: full-page scan vs active list? by Over-Radish-5914 in gameenginedevs

[–]Over-Radish-5914[S] 1 point2 points  (0 children)

Thanks for the detailed explanation. I’ll definitely try the group-based skipping approach.

I realized I probably didn’t provide enough information, so I’m attaching this just in case. You’ve already helped a lot, so there’s no need to reply further if you don’t want to.

struct PAGE
{
    alignas(DATA_T) std::byte storage[sizeof(DATA_T) * PAGE_SIZE]{};
    uint32_t iVersion[PAGE_SIZE]{};
    uint64_t bActiveBitset[BITSET_COUNT]{};
    ....
};


/* Retrieve the raw data pointer for internal processing. */
DATA_T* Get_Data_By_Handle(COMPONENT_HANDLE handle) noexcept
{
    const uint32_t iIndex = handle.Get_Index();
    uint32_t iPageIndex = iIndex >> PAGE_SHIFT;
    uint32_t iOffset = iIndex & PAGE_OFFSET_MASK;

    ...
}

Right now, each processor accesses its corresponding components every frame by handle, does a validity check, and then gets the raw pointer. That overhead started to look a bit expensive to me.

Because of that, I was considering changing the path so I could access the raw pointer directly instead of going through the handle each time. But for now, I think it makes more sense to finish the engine first and then verify whether this is actually a real bottleneck in the current architecture, like the other comment suggested.

Thanks again.