More SqliteTreeStore, and python

Being that I love python, I decided to do another iteration of the sqlite store in my language of choice. I have to admit, the ease of creating GtkTreeModels in python is mind blowing. Couple that with the awesomeness of python decorators, and you can get way more done in way less code.

This python recipe is particularly awesome. You simply add the @lru_cache decorator to your method and instantly you have a LRU based on the method parameters.

Point being, I've added another example of the SqliteTreeStore in pure python with LRU caching of high-velocity methods found in cProfile. GtkTreeModel or gtk.GenericTreeModel finds it necessary to iterate completely through the list even though they can get the number of rows via iternchildren. Perhaps setting fixed size columns and fixed-hieght-mode on the GtkTreeView solves this.

The associated test.db.bz2 should be extracted before using. It expands to roughly 33Mb and contains a grip of imported rss data. While running, the writable memory should hover around 6Mb if the LRU's are effective.

Show me the code!

Edit: I meant iternchildren, not n_columns.

-- Christian Hergert 2007-06-03

Back to Index