Re: [Nautilus-list] Small optimization



On Friday, June 29, 2001, at 01:16  PM, Ettore Perazzoli wrote:

I have started playing with Nautilus last night, hoping to maybe
contribute something useful to optimize it a bit, and I came across
get_metafile() in nautilus-directory-metafile.c, which seems to be doing
a useless alloc/free and CORBA_exception_init/free in the case where you
already have the CORBA interface set up.

  This gets called for each file when opening a directory, and the CORBA
interface is already up in that case, so I think it should be fixed.

I'm not sure I'd consider this a real optimization. I'd bet that it doesn'
t make a measurable difference; it's usually a mistake to "optimize" existing code in a way that users can't detect.

On the other hand, since it's annoying to have code that does extra stuff I don't see a compelling reason to leave it the way it is.

  Can I commit this patch?

The concept of the patch is just fine, but it doesn't follow Nautilus coding style guidelines. As described in nautilus/doc/style-guide.html, we put all declarations at the top of the function, so the declarations should be left outside the if statement.

Otherwise the patch looks fine and committing would be fine either way; they are just guidelines and we can change them if we like, too.

  BTW, what is the reason for having a hard limit on the number of files
that can be displayed in a Nautilus directory view
(NAUTILUS_DIRECTORY_FILE_LIST_HARD_LIMIT)?

I believe the reason had to do with major performance problems. Without the hard limit, if you did a search that returned most of the files on your disk (like searching for *.*) Nautilus would try to display a window that contains them all and come to a dead halt.

But I think a hard limit is not a great idea, and it would be nice if there was some other solution to this problem.

    -- Darin




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