Re: [Nautilus-list] Cacheing bonobo ui xml

Hi Alex,

On Tue, 21 Aug 2001, Alex Larsson wrote:
> Got some comments from michael on irc, so here is a new and improved
> version. This one seems to give 15% (This is measured using strace
> from nautilus_application_create_window() to
> fm_directory_view_end_loading()).  This one also uses less memory.

	The patch looks great in several respects; I have a few comments
as always:

> +	if (loaded_node_cache == NULL) {
> +		loaded_node_cache = g_hash_table_new (node_hash,
> +						      node_equal);
> +	}

	if (!loaded_node_cache)

	ie. no braces, no == NULL. - too much Nautilus contact time
methinks. Also a g_atexit cache free thing might be appreciated by the
purifying type people.

> +	cached = g_hash_table_lookup (loaded_node_cache, &entry);
> +	if (cached) {
> +		ui = cached->tree;
> +	} else {

	again, redundant braces.

> +		cached->file_name = g_strdup (file_name);
> +		cached->app_datadir = g_strdup (app_datadir);

	app_datadir can be NULL, so it'd be good to handle that nicely,
alternatively one could cache the fname - that might make more sense since
we already generate that.

> -	/* FIXME: we could be caching the tree here */

	Great to have this implemented. If you could fix the above and
send me one last patch as you commit,

	Many thanks,


 mmeeks gnu org  <><, Pseudo Engineer, itinerant idiot

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]