Performance Impact of Spotlight

Krevinek

Evil PPC Tweaker
While Spotlight is very cool, there is a slight issue with the effect of the indexing method on performance. I realized part of the Quicktime playback issues in 8A294 on older systems are actually due to Spotlight, not CoreVideo. When you first have Tiger installed, it starts a process called mdimport (metadata import) and tells it to index EVERYTHING. This process on a Pismo 400 has a noticable impact on performance as it takes up an average of 15% CPU time, and then spikes up to 40-50% every 10-20 seconds. This seems to have the major impact on Quicktime playback. Worse is that you try to kill mdimport, and it is just started again to start over. Ouch.

Anyone else notice the indexing performance hit on lower-end systems?
 
Well: This performance hit certainly goes down once your filesystem is indexed. So I wouldn't count that as a performance impact. I'm sure Apple's still working on it as well, but it's quite 'normal' that an indexing facility actually needs time for a first, big, complex, complete index. Just imagine you'd have to learn the contents and design of all the books in your library. Once you _have_ done that work, though, indexing new entries will be much easier to handle.
 
Yes, this was mostly to clarify where all the CoreVideo slowdowns I was complaining of were really coming from, and it didn't seem like it made sense to post it in an existing thread, since it was never really a main topic in anything so far. I don't know why I didn't think of this earlier, as I am well aware of the slowdown indexing can cause. I just didn't expect the 40-50% CPU spikes I was seeing. Maybe there should be some sort of configuration on how indexing is handled by the OS so older machines don't see spikes of that sort in already CPU intensive taks?

Another thing that occurs to me is that Spotlight might index removable media as well (I haven't confirmed this yet, but it would make sense), which would cause the same spikes when new disks are mounted.

And I would count it as a performance impact if CPU usage spikes cause noticable lag in other applications when indexing is occurring.
 
Sadly, I can't confirm this... _Does_ it happen when you attach an external drive? Btw.: What about CD or DVD media? That'd certainly be more noticeable, since the CDs and DVDs wouldn't spin down for quite a while...
 
I haven't done much with external media yet, it only happened after a fresh install of Tiger so far. The indexing of my current HD (which is something like 60-80 thousand files) took awhile, but the performance hit was gone when the indexing finished (you can tell when it is indexing by a pulsing icon in the Spotlight menu)
 
I guess 'low priority' depends on perception, too. An old/slow machine is certainly more prone to show the impact of Spotlight. However: Even _if_ it takes some performance indexing file systems, its merits (the actual speed of search later, for example) are still worth it in my opinion. Even more so if it doesn't have a noticeable impact after a while (when it's only keeping the db up to date).
 
you should look up "renice" in terminal. This allows you to background a process. So it will use 100% of processor as long as nothing else is using it. Everything else has priority.

man-pages are a wounderful thing!
 
Then again, we _are_ discussing how Apple intends Spotlight to index, so I guess 'nice' should not be necessary in the first place, to get a nice indexing experience... I won't change its process for now - and hope that with each new Tiger build we'll see more clearly where the development on Spotlight is leading...
 
Oddly, I think I found a possible explination of the impact I was seeing in 8A294:

MacOSRumors said:
Build A294 experienced a number of issues, including a serious problem with the MDImport process which often spiralled out of control on test machines - particularly any G5 Mac, consuming 100% of idle resources and bringing the system to a crawl

Granted, I know this is MacOS Rumors which has the tendancy to be slightly off in their grapevine, but if this is true, that would definitely explain the impact I saw, because it was definitely consuming 100% of my idle resources, and bringing video playback to a crawl in 8A294.
 
Back
Top