Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Opt into Windows SegmentHeap #21263

Merged
merged 1 commit into from
Sep 8, 2024
Merged

Conversation

Andarwinux
Copy link
Contributor

SegmentHeap provides a faster malloc implementation that only available with Dynamic UCRT in Windows 10, version 2004 (build 19041) and later

@glassez glassez added the OS: Windows Issues specific to Windows label Aug 26, 2024
@glassez glassez added this to the 5.1 milestone Aug 26, 2024
@glassez glassez requested a review from a team August 26, 2024 10:13
@xavier2k6
Copy link
Member

xavier2k6 commented Aug 27, 2024

Wrong schema setting being used!!!

It needs to have it's own, see: https://learn.microsoft.com/en-au/windows/win32/sbscs/application-manifests#heaptype

    <asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2020/WindowsSettings">
      <heapType>SegmentHeap</heapType>

Screenshot 2024-08-27 112342

src/qbittorrent.exe.manifest Show resolved Hide resolved
src/qbittorrent.exe.manifest Outdated Show resolved Hide resolved
</asmv3:application>
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<!-- Enable Segment Heap, faster than NT Heap -->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "faster than NT Heap" somehow troubles me. I've seen some reports about it being slower:
https://issues.chromium.org/issues/40138716
microsoft/Windows-Dev-Performance#106

@Andarwinux
Just curious, have you benchmarked qbt with it enabled?
You could just omit faster than NT Heap and we'll be fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SegmentHeap can greatly improve deallocating memory speed, see minetest/minetest#14127 and mpv-player/mpv#13137, which will improve exit speed when qBittorrent has a huge memory cache (32GB). But yes, on the other hand it does reduce performance in some extreme cases.

SegmentHeap provides a faster malloc implementation that only available with Dynamic UCRT in Windows 10, version 2004 (build 19041) and later
@xavier2k6
Copy link
Member

Unsure if comment is ok "as-is", but some alternatives:

<!-- Enable Segment Heap on supported platforms (requires Windows 10 2004 or newer) -->

<!-- Override Windows default heap implementation with more modern "Segment Heap" on supported platforms (requires Windows 10 2004 or newer) -->

@Chocobo1 Chocobo1 merged commit f00c5c9 into qbittorrent:master Sep 8, 2024
14 checks passed
@Chocobo1
Copy link
Member

Chocobo1 commented Sep 8, 2024

@Andarwinux
Thank you!

@Andarwinux Andarwinux deleted the segmentheap branch September 8, 2024 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OS: Windows Issues specific to Windows
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants