Skip to content

WrapLayout gallery sample never loads, is unusably slow under Windows App SDKΒ #515

Closed

Description

@Arlodotexe

Describe the bug

The WrapLayout sample in the gallery never fully loads when running under Windows App SDK but is fine when running UWP.

Recording.2024-09-18.141302.mp4

Steps to reproduce

1. Clone the repo
2. Generate the gallery solution, include the Primitives component and the wasdk multitarget/head.
3. Build and deploy the wasdk gallery.
4. Navigate to the 'WrapLayout' sample page and observe laggy behavior.

Expected behavior

Control should load and be reasonably responsive.

Screenshots

No response

Code Platform

  • UWP
  • WinAppSDK / WinUI 3
  • Web Assembly (WASM)
  • Android
  • iOS
  • MacOS
  • Linux / GTK

Windows Build Number

  • Windows 10 1809 (Build 17763)
  • Windows 10 1903 (Build 18362)
  • Windows 10 1909 (Build 18363)
  • Windows 10 2004 (Build 19041)
  • Windows 10 20H2 (Build 19042)
  • Windows 10 21H1 (Build 19043)
  • Windows 10 21H2 (Build 19044)
  • Windows 10 22H2 (Build 19045)
  • Windows 11 21H2 (Build 22000)
  • Other (specify)

Other Windows Build number

No response

App minimum and target SDK version

  • Windows 10, version 1809 (Build 17763)
  • Windows 10, version 1903 (Build 18362)
  • Windows 10, version 1909 (Build 18363)
  • Windows 10, version 2004 (Build 19041)
  • Windows 10, version 2104 (Build 20348)
  • Windows 11, version 22H2 (Build 22000)
  • Other (specify)

Other SDK version

No response

Visual Studio Version

No response

Visual Studio Build Number

No response

Device form factor

No response

Additional context

No response

Help us help you

Yes, I'd like to be assigned to work on this item.

Activity

  1. moved this to πŸ†• New in Toolkit 8.xon Sep 18, 2024
  2. moved this from πŸ†• New to πŸ— In progress in Toolkit 8.xon Oct 10, 2024
  3. self-assigned this
    on Oct 10, 2024
  4. Arlodotexe commented on Oct 10, 2024

    @Arlodotexe
    MemberAuthor

    Looks like there's no slowdowns or unexpected bugs when AoT is disabled. Might be a binding issue or an indication of a deeper layout problem when AoT is on.

    We'll need to run a profiler to see what the hot paths are during the slowdown.

  5. Arlodotexe commented on Oct 10, 2024

    @Arlodotexe
    MemberAuthor

    Looks like the hot paths are found on both the MeasureOverride and ArrangeOverride calls in WrapLayout, with the majority of time spent on ABI.Microsoft.UI.Xaml.Controls.IVirtualizingLayoutContextMethods.GetOrCreateElementAt(WinRT.IObjectReference, int) in both methods:

    MeasureOverride:
    Image

    ArrangeOverride:
    Image

    This seems abnormal, possibly due to a change in CsWinRT?

  6. Arlodotexe commented on Oct 10, 2024

    @Arlodotexe
    MemberAuthor

    Updating to the latest CsWinRT 2.1.5 has no effect, issue is still present.

  7. michael-hawker commented on Feb 13, 2025

    @michael-hawker
    Member
  8. moved this from πŸ— In progress to πŸ”– Ready in Toolkit 8.xon Apr 7, 2025
  9. added
    components::controls::primitivesPrimitive layout controls such as SwitchPresenter, UniformGrid, WrapLayout, StaggeredPanel, etc.
    on Aug 7, 2025
  10. moved this from πŸ”– Ready to βœ… Done in Toolkit 8.xon Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcomponents::controls::primitivesPrimitive layout controls such as SwitchPresenter, UniformGrid, WrapLayout, StaggeredPanel, etc.nativeaotThe dependency on dotnet NativeAOTregressionWhat was working is now brokesample app πŸ–ΌοΈ

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions