Performance seems like it could be optimized in areas

Aug 15, 2010 at 12:15 AM

Though I haven't yet delved into the code, I have noticed a couple things just running this in a test implementation in my program:

  • First of all I have a short test "beep" occur whenever an item in my panel signals IsVisibleChanged with a value of true (i.e. the item is loaded and "shown")
  • When I switch my view from a VirtualizingStackPanel to VirtualizingWrapPanel, there are a buttload of beeps, even though only 6 items are initially visible after it finally loads. I'm guessing an order of maybe 10-20 beeps per item. Contrast this to one beep per item in VirtualizingStackPanel
  • Secondly, scrolling seems to cause more beeps than are necessary
  • Furthermore, scrolling back up a list that has been scrolled down causes yet more beeps to occur. In the V.StackPanel this does not occur at all: once an item has been loaded it remains loaded, at least in the short term so that scrolling up causes no beeps.
  • Oddly, scrolling the mousewheel "up" at the top of the list, though nothing visual changes, causes further beeps.

This behavior is odd, and the sheer number of beeps I'm getting indicates that this could be optimized. Perhaps items are being removed and re-added, causing them to fire IsVisibleChanged multiple times. I will look into the code and see if there's anything obvious that is the cause of this.