[Mono-bugs] [Bug 467418] ListView in VirtualMode uses too much memory and is slow
bugzilla_noreply at novell.com
bugzilla_noreply at novell.com
Mon Jan 19 13:49:53 EST 2009
https://bugzilla.novell.com/show_bug.cgi?id=467418
User mono at esar.org.uk added comment
https://bugzilla.novell.com/show_bug.cgi?id=467418#c1
--- Comment #1 from stephen robinson <mono at esar.org.uk> 2009-01-19 11:49:52 MST ---
Created an attachment (id=266062)
--> (https://bugzilla.novell.com/attachment.cgi?id=266062)
patch to fix memory usage and speed issues
I've created a patch against version 2.2 that fixes the issue for my
application. I think it should work for all uses of the list view's virtual
mode but I haven't exhaustively tested it.
I've tested population and basic mouse/keyboard navigation in Details,
SmallIcon, LargeIcon and List views with a virtual list size of 1 million
items.
It makes the following changes:
ListView.cs:
ListView.View: throw exception if View is set to View.Tile while in virtual
mode
ListView.VirtualMode: set View to LargeIcon if it's currently View.Tile
ListView.FirstVisibleIndex: added special case for virtual mode to calc by
arithmetic instead of linear scan
CalculateRowsAndCols(): don't alloc item_index_matrix in virtual mode
LayoutIcons(): skip most layout calculations in virtual mode
LayoutDetails(): skip most layout calculations in virtual mode
CalculateListView(): don't call AdjustItemsPositionArray in virtual mode
GetItemLocation: added special case for virtual mode that calculates location
via arithmetic rather than lookup
GetItemIndex(): index == display_index in virtual mode
GetAdjustedIndex(): calc via arithmetic instead of lookup in virtual mode
ListViewItem.cs
GetBounds(): Always re-layout in virtual mode, there's no way to know if the
columns have been resized since the bounds was cached
TextBounds: As above
--
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
More information about the mono-bugs
mailing list