Skip to content

Commit ea39890

Browse files
committed
perf: make various SharedObjects final to avoid virtual calls
in many cases, certain SharedObject classes are used directly, so there is no need to virtualize calls in these circumstances. this saves a bit of runtime performance especially with CEconItem i didn't finalize the classes whose types were not used directly
1 parent 822f164 commit ea39890

File tree

9 files changed

+10
-10
lines changed

9 files changed

+10
-10
lines changed

src/game/shared/econ/econ_contribution.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ namespace GCSDK
2222
//---------------------------------------------------------------------------------
2323
// Purpose: All the account-level information that the GC tracks for TF
2424
//---------------------------------------------------------------------------------
25-
class CTFMapContribution : public GCSDK::CProtoBufSharedObject< CSOTFMapContribution, k_EEconTypeMapContribution >
25+
class CTFMapContribution final : public GCSDK::CProtoBufSharedObject< CSOTFMapContribution, k_EEconTypeMapContribution >
2626
{
2727
#ifdef GC
2828
DECLARE_CLASS_MEMPOOL( CTFMapContribution );

src/game/shared/econ/econ_game_account_client.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
//---------------------------------------------------------------------------------
1818
// Purpose: All the account-level information that the GC tracks
1919
//---------------------------------------------------------------------------------
20-
class CEconGameAccountClient : public GCSDK::CProtoBufSharedObject< CSOEconGameAccountClient, k_EEconTypeGameAccountClient >
20+
class CEconGameAccountClient final : public GCSDK::CProtoBufSharedObject< CSOEconGameAccountClient, k_EEconTypeGameAccountClient >
2121
{
2222
#ifdef GC
2323
DECLARE_CLASS_MEMPOOL( CEconGameAccountClient );

src/game/shared/econ/econ_item.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ template < typename T > uint32 WrapDeprecatedUntypedEconItemAttribute( T tValue
282282
template < typename TAttribInMemoryType >
283283
schema_attribute_stat_bucket_t ISchemaAttributeTypeBase<TAttribInMemoryType>::s_InstanceStats;
284284

285-
class CEconItem : public GCSDK::CSharedObject, public CMaterialOverrideContainer< IEconItemInterface >
285+
class CEconItem final : public GCSDK::CSharedObject, public CMaterialOverrideContainer< IEconItemInterface >
286286
{
287287
#ifdef GC_DLL
288288
DECLARE_CLASS_MEMPOOL( CEconItem );

src/game/shared/tf/tf_duel_summary.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ const uint32 kWinsPerLevel = 10;
4444
//---------------------------------------------------------------------------------
4545
// Purpose:
4646
//---------------------------------------------------------------------------------
47-
class CTFDuelSummary : public GCSDK::CProtoBufSharedObject< CSOTFDuelSummary, k_EEconTypeDuelSummary >
47+
class CTFDuelSummary final : public GCSDK::CProtoBufSharedObject< CSOTFDuelSummary, k_EEconTypeDuelSummary >
4848
{
4949
#ifdef GC
5050
DECLARE_CLASS_MEMPOOL( CTFDuelSummary );

src/game/shared/tf/tf_ladder_data.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
//---------------------------------------------------------------------------------
2828
// Purpose: The shared object that contains a ladder player's stats
2929
//---------------------------------------------------------------------------------
30-
class CSOTFLadderData : public GCSDK::CProtoBufSharedObject< CSOTFLadderPlayerStats, k_EEConTypeLadderData >
30+
class CSOTFLadderData final : public GCSDK::CProtoBufSharedObject< CSOTFLadderPlayerStats, k_EEConTypeLadderData >
3131
{
3232
public:
3333
CSOTFLadderData();
@@ -55,7 +55,7 @@ CSOTFLadderData *GetLocalPlayerLadderData( EMatchGroup nMatchGroup ); // TODO: G
5555
//---------------------------------------------------------------------------------
5656
// Purpose: The shared object that contains stats from a specific match - for match history on the client
5757
//---------------------------------------------------------------------------------
58-
class CSOTFMatchResultPlayerInfo : public GCSDK::CProtoBufSharedObject< CSOTFMatchResultPlayerStats, k_EEConTypeMatchResultPlayerInfo >
58+
class CSOTFMatchResultPlayerInfo final : public GCSDK::CProtoBufSharedObject< CSOTFMatchResultPlayerStats, k_EEConTypeMatchResultPlayerInfo >
5959
{
6060
public:
6161
CSOTFMatchResultPlayerInfo();

src/game/shared/tf/tf_lobby_server.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#include "tf_matchmaking_shared.h"
1616
#include "playergroup.h"
1717

18-
class CTFGSLobby : public GCSDK::CProtoBufSharedObject<CSOTFGameServerLobby, k_EProtoObjectTFGameServerLobby>
18+
class CTFGSLobby final : public GCSDK::CProtoBufSharedObject<CSOTFGameServerLobby, k_EProtoObjectTFGameServerLobby>
1919
{
2020
typedef GCSDK::CProtoBufSharedObject<CSOTFGameServerLobby, k_EProtoObjectTFGameServerLobby> BaseClass;
2121
public:

src/game/shared/tf/tf_party.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ namespace GCSDK
2424

2525
const int k_nTFPartyMaxSize = 6;
2626

27-
class CTFParty : public GCSDK::CProtoBufSharedObject<CSOTFParty, k_EProtoObjectTFParty>, public GCSDK::IParty
27+
class CTFParty final : public GCSDK::CProtoBufSharedObject<CSOTFParty, k_EProtoObjectTFParty>, public GCSDK::IParty
2828
{
2929
#ifdef GC
3030
DECLARE_CLASS_MEMPOOL( CTFParty );

src/game/shared/tf/tf_rating_data.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
//---------------------------------------------------------------------------------
2222
// Purpose: The shared object that contains a specific MM rating
2323
//---------------------------------------------------------------------------------
24-
class CTFRatingData : public GCSDK::CProtoBufSharedObject< CSOTFRatingData, k_EProtoObjectTFRatingData, /* bPublicMutable */ false >
24+
class CTFRatingData final : public GCSDK::CProtoBufSharedObject< CSOTFRatingData, k_EProtoObjectTFRatingData, /* bPublicMutable */ false >
2525
{
2626
public:
2727
CTFRatingData();

src/game/shared/tf/tf_wardata.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
//---------------------------------------------------------------------------------
2525
// Purpose: The shared object that contains a user's stats for a war
2626
//---------------------------------------------------------------------------------
27-
class CWarData : public GCSDK::CProtoBufSharedObject< CSOWarData, k_EEConTypeWarData >
27+
class CWarData final : public GCSDK::CProtoBufSharedObject< CSOWarData, k_EEConTypeWarData >
2828
{
2929
public:
3030
CWarData();

0 commit comments

Comments
 (0)