Commit Graph

308 Commits

Author SHA1 Message Date
henrik karlsson
4feb09e0b3 Compile time optimizations Managed to reduce unnamed game's biggest file compiler frontend cost from 113 seconds to 60 seconds. This also impact other things such as pch size and memory footprint when compiling which is great.
Takeaways. Try to use "friend" on functions/operators that are frequently overloaded EXCEPT if they are in a templated type that is frequently instantiated. So do not put friends in TMap, TSet, TObjectPtr etc, this will slow down compile times. There is a break-even somewhere and hard to tell where it is but taking a class that is templatized on character type probably don't matter either way and then it is nicer to use a friend since that simplies error messages when compiler can't resolve functions/operators.

If it is possible to use member functions instead of friend that is the best option in terms of compile time performance. With c++20 you only have to write operator==(Foo, Bar) and the compiler will automatically provide operator==(Bar, Foo), operator!=(Foo, Bar) and operator!=(Bar, Foo).

Changes in this changelist involes
* Making operator<< friends in non-template types and not friends in template types
* Making operator==/!= members where possible and if not possible moved out if type is a frequently instantiated templated type.

#preflight 636970f5376a9cd6a80da54a
#rb steve.robb

[CL 23038965 by henrik karlsson in ue5-main branch]
2022-11-08 15:59:46 -05:00
henrik karlsson
b985fbd1b1 Removed lots of includes in high traffic headers in order to reduce compile times. Headers are still included if UE_ENABLE_INCLUDE_ORDER_DEPRECATED_IN_5_2 is set to 1
List of highlights
* PlayerController - Removed ForceFeedback and and OnlineReplStructs
* Class - Removed Package.h
* World - Pawn, Blueprint and GameInstance
* Actor - CoreNet, HitResult and ActorDatalayer
* EngineBaseTypes - TaskGraphInterface
* AssetManager - AssetData
* Scene/Child/ActorComponent - CoreNet
* AnimInstance - AttributesRuntime, Skeleton, AnimCurveTypes, AnimMontage, BonePose
* BulkData - IoDispatcher
* AssetData - IoDispatcher, LinkerLoad
* SecureHash - AsyncWork
* CanvasTypes - UnrealEngine, StaticMeshResources
* IpAddress - AsyncWork, Stats

#preflight 6363717ece676ae8688f5d8c
#rb none

[CL 22968258 by henrik karlsson in ue5-main branch]
2022-11-03 17:56:44 -04:00
joe pribele
9c02a2df54 [Core] changed FCustomVersionContainer::ToString to use a string builder to be more efficient
#preflight 636170f70c2e7c8f9148eff3

[CL 22889943 by joe pribele in ue5-main branch]
2022-11-01 15:55:16 -04:00
Devin Doucette
4bea045328 CompactBinary: Fixed LoadCompactBinary to gracefully handle read failures and sizes larger than the archive
#preflight 63200c6be93a80888c231104
#rb Zousar.Shaker

[CL 21983905 by Devin Doucette in ue5-main branch]
2022-09-13 11:45:18 -04:00
steve robb
8d78668c12 Removed ignored calculated values from TBigInt::ToInt(), FGenericPlatformMallocCrash::InitializeSmallPools and FArchive::SerializeCompressedNew.
#rb robert.manuszewski
#preflight 62f3acf6e60c9215b9766648

#ROBOMERGE-AUTHOR: steve.robb
#ROBOMERGE-SOURCE: CL 21406572 via CL 21406687 via CL 21406745
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v975-21357124)

[CL 21411875 by steve robb in ue5-main branch]
2022-08-16 15:29:48 -04:00
UnrealBot
73409369c0 Branch snapshot for CL 21319338
[CL 21319338 in ue5-main branch]
2022-08-10 16:03:37 +00:00
chris kulla
a78346a1ea Removing unused raytracing specific code from MemoryLayout and the associated DDPI entry
#rb Josh.Adams,Yuriy.ODonnell
#jira none
#preflight 62d1961da66919b6701d8c5b

[CL 21113474 by chris kulla in ue5-main branch]
2022-07-15 13:34:52 -04:00
Matt Peters
07e55800b0 CompactBinarySerialization: Add operator<< and LoadFromCompactBinary functions for FName, FString, and TArray.
Add them for TMap and TSet as well, but keep them private for now since the write does not sort the keys and hence has determinism problems if used in persistent storage.
#rb Devin.Doucette
#rnx
#preflight 62cc993e1a786c1bbcf90183

[CL 21048418 by Matt Peters in ue5-main branch]
2022-07-11 18:06:55 -04:00
bryan sefcik
a9cc65bca4 Updated Core code to not use CoreMinimal.h when possible.
Core public headers still will contain CoreMinimal.h if any included it before my IWYU changes.
#preflight 62c73594756222ced4e48707

[CL 20991367 by bryan sefcik in ue5-main branch]
2022-07-07 16:02:19 -04:00
bryan sefcik
9905eb52bb Pass 2 on running IWYU on Core.
Things to note regarding this pass:
* No includes are currently being removed from public headers.
* Any private file that has a #if is currently not being updated.
#preflight 62c703bbd13fac04f11da948

[CL 20985655 by bryan sefcik in ue5-main branch]
2022-07-07 12:30:11 -04:00
bryan sefcik
62489fe2b3 Ran a pass of IWYU on Core.
Things to note regarding this pass:
* No includes are currently being removed from public headers.
* Any private file that has a #if is currently not being updated.

#rb Devin Doucette and Marc Audy
#preflight 62c62086756222ced497ff95
#preflight 62c626d12f2d04691814d331
#preflight 62c630107e606620fdd64e31
#preflight 62c635c6756222ced49a13cf

[CL 20979027 by bryan sefcik in ue5-main branch]
2022-07-06 21:44:18 -04:00
steve robb
5f47181981 Direct FTCHARToUTF8_Convert usage replaced with StringCast or FPlatformString in Core.
#rb devin.doucette
#jira UE-132142
#preflight 62bf682d5d53ca5bceba304e

#ROBOMERGE-OWNER: steve.robb
#ROBOMERGE-AUTHOR: steve.robb
#ROBOMERGE-SOURCE: CL 20923000 via CL 20923578 via CL 20923588
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v971-20777995)

[CL 20924503 by steve robb in ue5-main branch]
2022-07-01 21:28:35 -04:00
steve robb
1b2a6972d9 Undo //Fortnite/Main/... changelist 20912148
#rb none

#ROBOMERGE-OWNER: steve.robb
#ROBOMERGE-AUTHOR: steve.robb
#ROBOMERGE-SOURCE: CL 20912525 via CL 20912560 via CL 20912561
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v971-20777995)

[CL 20913042 by steve robb in ue5-main branch]
2022-07-01 07:49:36 -04:00
steve robb
39ffa82638 Direct FTCHARToUTF8_Convert usage deprecated and replaced with StringCast or FPlatformString.
#rb devin.doucette
#jira UE-132142
#preflight 62bd92d71c0b758797185071

#ROBOMERGE-OWNER: steve.robb
#ROBOMERGE-AUTHOR: steve.robb
#ROBOMERGE-SOURCE: CL 20912148 via CL 20912242 via CL 20912250
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v971-20777995)

[CL 20913038 by steve robb in ue5-main branch]
2022-07-01 07:49:22 -04:00
devin doucette
4816001e63 CompactBinary: Added LoadFromCompactBinary as a standardized way to load from compact binary
The intent is that function take a field and an output parameter, with an optional default value:

bool LoadFromCompactBinary(FCbFieldView Field, FTypeName& OutValue, FTypeName Default = {});

Implementations must return true if the field was loaded successfully, and false if any required part of the field was missing or its value had the wrong type or range. The output value must be assigned before the function returns.

#rb Zousar.Shaker

#ROBOMERGE-AUTHOR: devin.doucette
#ROBOMERGE-SOURCE: CL 20741864 via CL 20743724 via CL 20744635
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v970-20704180)

[CL 20751365 by devin doucette in ue5-main branch]
2022-06-20 23:39:28 -04:00
steve robb
fd2a0b1e20 Removal of TEXT literal concatenations, which doesn't work in UTF-8 mode.
#rb devin.doucette
#jira UE-132142
#preflight 62a8748fa76c84377748036b

#ROBOMERGE-OWNER: steve.robb
#ROBOMERGE-AUTHOR: steve.robb
#ROBOMERGE-SOURCE: CL 20647443 via CL 20648283 via CL 20648315
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v955-20579017)

[CL 20651786 by steve robb in ue5-main branch]
2022-06-14 12:46:34 -04:00
devin doucette
a9c5804e52 CompactBinary: Added a compact mode to the conversion to JSON
#rb Zousar.Shaker

#ROBOMERGE-OWNER: devin.doucette
#ROBOMERGE-AUTHOR: devin.doucette
#ROBOMERGE-SOURCE: CL 20646707 via CL 20646763 via CL 20646768
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v955-20579017)

[CL 20649200 by devin doucette in ue5-main branch]
2022-06-14 11:04:47 -04:00
Johan Torp
213dd3f008 Fixed static analysis warning by removing always true check
#preflight 629f00141c7e8f9a18320086

[CL 20534187 by Johan Torp in ue5-main branch]
2022-06-07 03:45:19 -04:00
Devin Doucette
605998206f CompactBinary: Replaced local ReadUnaligned function with FPlatformMemory::ReadUnaligned
#preflight 6294ced34c7bcac173d19fb1
#rb Zousar.Shaker
#rnx

[CL 20431253 by Devin Doucette in ue5-main branch]
2022-05-30 11:19:23 -04:00
Steve Robb
7778bc5c05 GitHub #8600 : Rename Ar to StructuredArchive
#rb steve.robb
#jira UE-134432
#preflight 628e287d2c7cb2d10d65322d

[CL 20363343 by Steve Robb in ue5-main branch]
2022-05-25 09:20:14 -04:00
Johan Torp
cc9fe95874 Speculative fix for bogus PVS warning
#jira UE-150098
#rb none
#preflight 62825666046b81bf93bc31ba

[CL 20225267 by Johan Torp in ue5-main branch]
2022-05-16 11:31:19 -04:00
robert millar
949ed7ba3a Insert dummy values into memory images for names like vtable pointers.
#rb ben.ingram

#ROBOMERGE-AUTHOR: robert.millar
#ROBOMERGE-SOURCE: CL 20115901 via CL 20115948 via CL 20115961 via CL 20115990
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v943-19904690)

[CL 20117747 by robert millar in ue5-main branch]
2022-05-09 23:27:24 -04:00
Jason Adcock
dccca1fb87 Fix Fortnite Networking Versioning between FN and UE branches
#jira UE-147571, UE-149373, UE-146854
#rb ryan.gerleve
#preflight

[CL 20053774 by Jason Adcock in ue5-main branch]
2022-05-04 20:56:28 -04:00
ilya loshchinin
963c439757 FLargeMemoryData NonUnity buildfix
#ROBOMERGE-AUTHOR: ilya.loshchinin
#ROBOMERGE-SOURCE: CL 19971791 via CL 19973251 via CL 19973403
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v943-19904690)

[CL 19974317 by ilya loshchinin in ue5-main branch]
2022-04-28 21:19:22 -04:00
ilya loshchinin
6bd4945ede Optimized StaticDuplicateObject by pooling its temporary memory block allocation.
Added FPooledLargeMemoryData that allows lockless access to temporary memory blocks.

#tests Squads games on WSL, using FramePro to validate performance gains
#rb danny.couture,jamie.dale

#ROBOMERGE-AUTHOR: ilya.loshchinin
#ROBOMERGE-SOURCE: CL 19970339 via CL 19971380 via CL 19972286
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v943-19904690)

[CL 19974304 by ilya loshchinin in ue5-main branch]
2022-04-28 21:18:27 -04:00