Commit Graph

13 Commits

Author SHA1 Message Date
Marc Audy
0c3be2b6ad Merge Release-Engine-Staging to Test @ CL# 18240298
[CL 18241953 by Marc Audy in ue5-release-engine-test branch]
2021-11-18 14:37:34 -05:00
danny couture
7cd0b9751f Include mimalloc compilation as part of the core module instead of relying on prebuilt binaries
- This will make maintenance for multiple platforms a lot easier (i.e. just preflight)
  - Will be easy to get callstack and debug since it will be compiled on the machine it is debugged on
  - Easier to try out modifications on mimalloc itself
  - Fix mimalloc compilation under Clang 10
  - Fix mimalloc inconsistent usage of MI_ENCODE_FREELIST define
  - Fix mimalloc inconsistent usage of _WIN32 define
  - Implement MacOS and Unix -mimalloc command-line switch

- Some MacOS changes were contributed by Will.Damon

#rb Brandon.Schaefer, Will.Damon
#preflight 60b4ea613c6c4e000158233e
#rnx

#ROBOMERGE-SOURCE: CL 16512512 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v826-16501804)

[CL 16512522 by danny couture in ue5-release-engine-test branch]
2021-06-01 05:37:40 -04:00
danny couture
f358a5d8a4 Include mimalloc compilation as part of the core module instead of relying on prebuilt binaries
- This will make maintenance for multiple platforms a lot easier (i.e. just preflight)
  - Will be easy to get callstack and debug since it will be compiled on the machine it is debugged on
  - Easier to try out modifications on mimalloc itself
  - Fix mimalloc compilation under Clang 10
  - Fix mimalloc inconsistent usage of MI_ENCODE_FREELIST define
  - Fix mimalloc inconsistent usage of _WIN32 define
  - Implement MacOS and Unix -mimalloc command-line switch

- Some MacOS changes were contributed by Will.Damon

#rb Brandon.Schaefer, Will.Damon
#preflight 60b4ea613c6c4e000158233e
#rnx

[CL 16512512 by danny couture in ue5-main branch]
2021-06-01 05:35:42 -04:00
Marc Audy
8101db7057 Populate -S //UE5/Release-Engine-Test -r //UE5/Release-Engine-Test/...@16259331.
[CL 16259798 by Marc Audy in ue5-release-engine-test branch]
2021-05-10 19:50:10 -04:00
Yuriy ODonnell
4c9842e958 Do not call mi_collect on shutdown. It adds a significant cost but is not needed for our usage of mimalloc.
Library built using toolchain v141 and SDK 10.0.17134.0 from vs2017 solution.

#rb Danny.Couture

[CL 16045011 by Yuriy ODonnell in ue5-main branch]
2021-04-17 10:48:46 -04:00
danny couture
4136c5ab24 Update mimalloc tps to v2.0.0
#rb none

[CL 15885162 by danny couture in ue5-main branch]
2021-03-31 21:21:43 -04:00
danny couture
e6f54c17c4 Update mimalloc to version 2.0.0-2762784 for HUGE memory usage improvement in editor workloads
This version of mimalloc is very efficient at distributing threaded allocations in a way that maintains
    locality which in turn improve the amount of memory that we're able to send back to the system
    after heavily multithreaded workloads. This also improves performance as less page fault and cache misses
    are expected coming from more densily packed allocations.

    mimalloc v1 seemed to waste more memory because of its commit size being larger than TBB.
    However, its allocation patterns was already way tigther than TBB but for it to become apparent, you had
    to activate the "page_reset" and "reset_decommits" options, which came at a performance loss.

    mimalloc v2 offers both better locality and by default will more agressively decommit memory with
    only minor performance loss in some cases and performance gain in many.

    Given the advantages of mimalloc v2 compared to Intel TBB, we should probably consider it
    as our next default allocator for the editor.

 - All tests performed on AMD TR 3970X with 256GB RAM
   - Loading FramingCameraTest map on special project with -ddc=cold and waiting until every asset is built
     - 699s @ 32GB for tbb malloc
     - 655s @ 37GB for mimalloc v1
     - 757s @ 12GB for mimalloc v1 + page_reset and reset_decommits
     - 604s @ 15GB for mimalloc v2
   - Loading P_World on Reverb -ddc=cold and waiting until every asset is built
     - 2372s @ 71GB for tbb malloc
     - 2587s @ 75GB for mimalloc v1
     - 3212s @ 34GB for mimalloc v1 + page_reset and reset_decommits
     - 2503s @ 37GB for mimalloc v2
   - Loading P_Construct_WP on special project with -ddc=cold and waiting until every asset is built
     - 6404s @ 56GB for tbb malloc
     - 6640s @ 37GB for mimalloc v2
   - Loading Apollo_Terrain on FortniteGame with -ddc=cold and waiting until every asset is built
     - 751s @ 33GB for tbb malloc
     - 744s @ 25GB for mimalloc v2
    - Cooking FramingCameraTest map on special project with a warmed-up DDC
     - 379s @ 34GB for tbb malloc
     - 367s @ 29GB for mimalloc v2

#rb Brandon.Dawson, Yuriy.ODonnell, Stefan.Boberg

[CL 15859558 by danny couture in ue5-main branch]
2021-03-30 06:38:15 -04:00
Josh Adams
b0e4357576 - UBT Code changes to remove 32-bit Windows support (C++ code for 32-bit still exists)
#rb marc.audy (concept, not each file)

[CL 15265424 by Josh Adams in ue5-main branch]
2021-01-31 15:09:58 -04:00
stefan boberg
834cfb3532 Fixed mimalloc build script to properly handle builds that do not use the debug CRT. So both SCW and Editor should now build properly in Debug
#jira UE-89981
#rb link.exe

#ROBOMERGE-SOURCE: CL 11897896 in //UE4/Release-4.25/... via CL 11897921
#ROBOMERGE-BOT: RELEASE (Release-4.25Plus -> Main) (v656-11643781)

[CL 11897947 by stefan boberg in Main branch]
2020-03-04 12:13:24 -05:00
stefan boberg
85f1a0cc6c Fixed windows Debug build issue with mimalloc
#rb none
#jira UE-89981

#ROBOMERGE-SOURCE: CL 11880311 in //UE4/Release-4.25/... via CL 11880318
#ROBOMERGE-BOT: RELEASE (Release-4.25Plus -> Main) (v656-11643781)

[CL 11880329 by stefan boberg in Main branch]
2020-03-03 14:45:53 -05:00
eric mcdaniel
b1ebccac9a Align inclusion of mimalloc include path and lib with the PLATFORM_SUPPORTS_MIMALLOC define in WindowsPlatform.h
#jira none
#rb david.harvey

#ROBOMERGE-SOURCE: CL 11507986 in //UE4/Release-4.25/...
#ROBOMERGE-BOT: RELEASE (Release-4.25 -> Release-4.25Plus) (v654-11333218)

[CL 11507987 by eric mcdaniel in 4.25-Plus branch]
2020-02-18 13:43:46 -05:00
paul chipchase
8267e8d0b9 Update copyright notice to the new format
#rnx
#rb trivial

[CL 11152119 by paul chipchase in Dev-Core branch]
2020-01-29 02:17:45 -05:00
Stefan Boberg
8f0e83305e Added mimalloc allocator from https://github.com/microsoft/mimalloc
Performs better than mimalloc in cooker benchmarks, but we still default to TBB malloc until the behaviour has been explored in more depth

To opt in to mimalloc, pass -mimalloc on the command line

#rb none

[CL 11114787 by Stefan Boberg in Dev-Core branch]
2020-01-27 07:08:26 -05:00