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

After upgrading to version 11.2.1, the usercontrol response speed has become very slow. #17585

Closed
nipeone opened this issue Nov 22, 2024 · 6 comments

Comments

@nipeone
Copy link

nipeone commented Nov 22, 2024

Describe the bug

I designed a usercontrol to display search images and text content. Each page shows 20 records, and each record is wrapped in the usercontrol. With version 11.2.0, resizing the mainform was very smooth, but after upgrading to version 11.2.1, the response speed has significantly slowed down, and it feels very laggy.

To Reproduce

<UserControl xmlns="https://github.com/avaloniaui"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             x:Class="OmnipocketLiteAvalonia.SearchResultItem">
    <Border BorderBrush="{DynamicResource SystemControlForegroundBaseMediumBrush}" 
            BorderThickness="1" Margin="0,0,0,10" Padding="10" CornerRadius="15">
        <Grid ColumnDefinitions="Auto,*">
            <Image Grid.Column="0"
				   x:Name="DocTypeImage"
				   Width="64"
				   Height="64"
				   Margin="0,0,10,0" />
            <StackPanel Grid.Column="1">
                <TextBlock x:Name="TextContent"
						   TextWrapping="Wrap"
                           Foreground="{DynamicResource SystemControlForegroundBaseHighBrush}"
                           Margin="0,0,0,5"/>
                <Separator Height="1"
						   Margin="0,5,0,5"
                           Background="{DynamicResource SystemControlForegroundBaseLowBrush}"/>
                <Button x:Name="FilePathButton" 
                        Foreground="{DynamicResource SystemControlForegroundBaseMediumBrush}" 
                        FontStyle="Italic"
                        Background="Transparent"
						BorderThickness="0"
						Padding="0"
                        HorizontalAlignment="Left"
						Cursor="Hand"/>
            </StackPanel>
        </Grid>
    </Border>
</UserControl>

Expected behavior

No response

Avalonia version

11.2.1

OS

Windows

Additional context

No response

@nipeone nipeone added the bug label Nov 22, 2024
@timunie
Copy link
Contributor

timunie commented Nov 22, 2024

@nipeone please provide a full minimum sample to reproduce. Also I wonder how you set the data, are you doing it in code behind? Is the image loading async?

@nipeone
Copy link
Author

nipeone commented Nov 23, 2024

@timunie thks for your reply, i upload code here example code
after running, input anything in search box and then press enter. when search results showed, If you drag the border to change the width of the form, version 11.2.1 will be too laggy But this situation will not occur in version 11.2.0.

@nipeone
Copy link
Author

nipeone commented Nov 23, 2024

i have found another problem.In 11.1.5, my settings button and theme button icon was displayed perfectly, but in versions 11.2.0 and 11.2.1, there were some missing.
11.1.5:
1732349771202
11.2.*
1732349846671

@timunie timunie added question and removed bug labels Nov 23, 2024
@MrJul
Copy link
Member

MrJul commented Nov 23, 2024

The slowness in 11.2.1 is fixed by #17519 - this fix will be part of 11.2.2.

@robloo
Copy link
Contributor

robloo commented Nov 26, 2024

Note that slowness of custom controls has been an older issue as well. I have custom controls that are very slow during debug and blazing fast at release. I seem to recall reading some time ago (By @TomEdwardsEnscape perhaps) there was suspicion that debug outputs, diagnostics or logging were slowing things down quite a bit but I personally never bothered to dig into it more.

Long story short -- do let us know if the above issue doesn't fix the problem.

@nipeone
Copy link
Author

nipeone commented Nov 28, 2024

@robloo yes, update to 11.2.2, the problem of slowness has addressed.

@nipeone nipeone closed this as completed Nov 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants