SapphireServer / Sapphire

A Final Fantasy XIV 4.0+ Server Emulator written in C++
GNU Affero General Public License v3.0
677 stars 212 forks source link

[3.x] overall optimizations; add getRows to exd data; #927

Closed hkAlice closed 1 year ago

hkAlice commented 1 year ago

45s -> 28s (37%) to start world server up on debug (5900x)

getRows should be used instead of getIdList then looping through the list to manually get the exd data. I've gone through and replaced most of the getIdList calls on the project.

example:

auto contentListIds = exdData.getIdList< Excel::InstanceContent >();

  for( auto id : contentListIds )
  {
    auto instanceContent = exdData.getRow< Excel::InstanceContent >( id );
    if( instanceContent->data().TerritoryType == territoryTypeId )
    {
      return id;
    }
  }

should now be:

auto contentFinderList = exdData.getRows< Excel::InstanceContent >();

  for( const auto& [ id, instanceContent ] : contentFinderList )
  {
    if( instanceContent->data().TerritoryType == territoryTypeId )
    {
      return id;
    }
  }