I had done something similar in the past, but this is a more 
well-engineered attempt.  The situation it optimizes is as follows:

1) right-click on a keyword in the keyword pane
2) Select "Connect \"keyword\" to mark" -> Mark N
2a) Optionally, repeat for other keywords
3) Hit "m" or Select -> Show Marks

At this point, it is typically the case that if you restrict the view by 
filtering on a mark, the restriction happens instantly.  At the same 
time, the FileData instances that _don't_ match the filter would be 
freed.  If you subsequently broaden the view at all, geeqie would need 
to reparse the freed files to re-create those FileData instances.  For 
small restrictions in large directories, you could end up reparsing 
almost every file in the directory.  This gets Real Slow, Real Fast.

This set of changes optimizes the situation by adding a secondary 
mechanism to prevent FileData instances from being freed until they go 
out of scope (that is, when the ViewDir changes directories).  Thus, 
when a restriction happens, the non-matching FileData instances remain 
in memory, and thus a subsequent broaden operation becomes instant as 
well.  This makes marks a _lot_ less frustrating to work with.


The changes are below.  I just finished them tonight, so I'd appreciate 
it if someone could review them/try them before I figure out how to send 
a merge request.
https://gitorious.org/geeqie/xsdg-geeqie1/commit/710b009f5c61e7d1643a2a474e5020c760bf6462
https://gitorious.org/geeqie/xsdg-geeqie1/commit/1ea92516e2f91b7f99b1d41d44853f941d98e114
https://gitorious.org/geeqie/xsdg-geeqie1/commit/0ac57169c3c70c9b6c7e68033982a03511b79640

There are FileData leaks with this code, but there are also leaks 
without it.  It's not yet clear if this is _causing_ any leaks.  If 
people have thoughts/findings, lemme know.

Cheers,
--xsdg

------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
Geeqie-devel mailing list
Geeqie-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geeqie-devel

Reply via email to