WPF Performance Degradation During UI Render

I have the following components in a WPF application:

(1) Window

(2) ContentPresenter in the Window that is bound to a property in the underlying ViewModel. This Property references another ViewModel.

(3) A DataTemplate for the ViewModel that will be bound to the ContentPresenter referenced above. This data template instantiates a third-party grid that displays some data.

Whenever the ContentPresenter renders the data from the DataTemplate, it takes approximately three to four seconds for the UI to render. This causes the UI to hang for the duration of the time that it takes to render the content. Since I have little to no control over how the third-party control renders itself - my question involves whether or not it is possible to render content in a way that the UI will not hang.

Please advise.

Thanks.

Chris

-------------Problems Reply------------

How many rows is the grid displaying? And how many of those rows are visible on screen?

I'm asking because it's possible that you've got a UI layout that defeats virtualization. Usually, controls that show a scrollable list of data will perform virtualization. (The built-in ListBox does this, and any 3rd party grid of tolerable quality should do the same.) This is critical for performance, because it means your UI only needs to instantiate those items that are actually visible, rather than everything in your list.

But it's relatively easy to defeat this virtualization by accident. One way is to wrap the list or grid control in a ScrollViewer. You need virtualizing controls to be able to manage their own scrolling for virtualization to work, so the scrolling needs to happen on the inside. Wrapping a control in a ScrollViewer prevents it from doing its own scrolling. Another way it can go wrong is if you plug in a different ItemsPanel. A third possibility is that your list/grid control actually needs to be told to use virtualization.

But if you're using a control that simply takes a long time to render just the stuff you need to show on screen, then there's not much you can do - you'd need to contact the control vendor, or consider using a different vendor...

Category:wpf Views:0 Time:2010-12-02
Tags: wpf

Related post

  • AS3 large game performance degradation over time 2009-09-21

    I'm currently working on a very large Flash platformer game (hundreds of classes) and dealing with an issue where the game slowly grinds to a halt if you leave it on for long enough. I didn't write the game and so I'm only vaguely familiar with its i

  • Performance degradation of CreateFile API 2009-05-28

    I have an application that is restoring lots of data from a library. We are using Windows server 2003. As the process progresses we are seeing performance degradation. I added some performance counters for 4 of my major tasks, Create file, Read from

  • limit of rows in SQL Server 2005 when performance degrades 2009-06-29

    What is the limit of rows in a table for SQL Server 2005, when SQL query starts getting slower? Is there any way to find out the limit? I understand it will depend upon the data length of a row. This will also depend on how many more data in other ta

  • Sudden SVN performance degradation with VisualSVN locally 2009-11-25

    I have a SVN server instance set up on my desktop for the purposes of demonstrating the many benefits of SVN/TortoiseSVN. Performance has today degrading significantly however when performing actions such as viewing the logs etc. This isn't ideal for

  • WPF performance for large number of elements on the screen 2010-03-30

    Im currently trying to create a Scene in WPF where I have around 250 controls on my screen and the user can Pan and Zoom in and out of these controls using the mouse. I have run the WPF Performance Suite tools on the application when there are a larg

  • WPF Performance Suite Visual Profiler does not work 2010-06-02

    I have installed the latest Windows 7 SDK which contains the WPF Performance Profiler. Perforator does display some data when I launch my app, but the Visual Profiler does not display anything. The timeline moves but not data is collected ... -------

  • select statment performance degradation when using DISTINCT with parameters 2010-12-10

    Note for bounty - START: PARAMETERS SNIFFING (that is the only "idea" that was reported in pre-bounty questions) is not the issue here, as you can read in the "update" section at the end of the question. The problem is really related to how sql serve

  • Mysql BLOB performance degradation after hitting "a limit" (MyISAM) 2010-12-13

    I have a rather small mysql DB in which I store an handful of pretty small images (320x480), it all behaved really well until recently, the table size is about 1.5Gb and there are about 34,000 records. At that point... ...All of a sudden the performa

  • WPF performance issue when resizing the window with lots of controls 2011-01-10

    I have a WPF window that contains a fancy image with roughly 200 controls (derived from buttons), all of which use one of my 5 templates (paths, shadow effects, etc). Agreed, it is a heavy window to draw. I can live with that. My problem comes from r

  • Is there a performance degradation when we ALWAYS use nullable value types instead of value types? 2011-02-05

    Is there a performance degradation when we ALWAYS use nullable value types instead of value types? --------------Solutions------------- As Mitch Wheat pointed about above, no, you should not worry about this. I'm going to give you the short answer re

  • GUI performance degrade when i am making calls more than 20 2011-04-07

    I am newbie to android. In my tablet, if I make calls more 20, performance degrade. GUI response is very slow. why does the gui performance degrade? I have a trace file. I didn't find the root cause. There is no memory problem. Please help me out Log

  • Grails app performance degrades over time 2011-05-21

    I have noticed that after my Grails app has been deployed for about 2 weeks, performance degrades significantly, and I have to redeploy. I am using the Spring Security plugin and caching users. My first inclination is that it has something to do with

  • java threads vs java processes performance degradation 2011-08-01

    Here I would focus on custom application where I got degradation (no need for general discussion about fastness of threads against processes). I've got MPI application on Java which solve some problem using iteration method. The schematic view to app

  • sqlite3 strange performance degradation 2011-08-09

    I'm on osx 10.6.8. I have python 2.6.7 installed via port and natively installed osx python 2.6.1. I use sqlite3 in my script with isolation_level = None. If I use the port python interpreter (2.6.7) my SELECT query takes ~2sec. If I switch to native

  • Will running node.js with Apache causes too much performance degradation? 2011-11-07

    I am trying to run Apache and node.js on the same Amazon EC2 instance. After research online, I came up with the following solution: run Apache on port 9000 run node.js apps on port 8001, 8002 and so on. create a reverse proxy in node.js, running on

  • Hadoop: Performance degradation when increasing block sizes? 2011-11-23

    Has anyone seen any performance degradation when increasing the block size in Hadoop? We're setting up a cluster and we're expecting a large amount of data (100s of GBs) coming in per day that we need to store, so my thought was we could increase the

  • Runtime performance degradation for C FFI Callback when pthreads are enabled 2012-01-17

    I am curious about the behavior of GHC runtime with threaded option in case when C FFI calls back Haskell function. I wrote code to measure overhead of a basic function callback (below). While the function callback overhead has already been discussed

  • Lift application performance degrade 2012-02-17

    I am using lift framework with embedded jetty. My application is running pretty fast if I am it in development. As soon as I make a assembly of it using SBT, the performance degrades upto 20-30 times. The request which was taking 400ms, starts taking

  • Performance degrade while restore a database from SQL 2000 to SQL 2008 R2 2012-03-04

    Hi, We are upgrading our infrastructure from SQL 2000 to SQL 2008 R2. In this process, we are changing our hardware (32 bit to 64 bit), OS (from Windows 2003 to Windows 2008), SQL Server (2000 to 2008 R2). We are running on 2 node cluster. Using Equa

Copyright (C) dskims.com, All Rights Reserved.

processed in 0.096 (s). 11 q(s)