How does Spotlight work?

Discussion in 'macOS' started by jhujhiti, Feb 8, 2005.

  1. jhujhiti macrumors newbie

    Joined:
    Feb 8, 2005
    Location:
    Ledyard, CT, USA
    #1
    Is Spotlight a filesystem-level addition or a userland process that indexes files as they change? If it's the latter, I'm not so sure it's worth it for my organized self...
     
  2. Logik macrumors 6502a

    Joined:
    Apr 24, 2004
    #2
    i'm going to take a little guess here and there but someone could correct me if i'm wrong..

    it's a userland application daemon that recieves an event if a file on the filesystem changes. spotlight grabs said file information, if there's a plugin to handle said filetype, data is fed through plugin, and input into a database... you click spotlight icon, type search, database is accessed.
     
  3. jhujhiti thread starter macrumors newbie

    Joined:
    Feb 8, 2005
    Location:
    Ledyard, CT, USA
    #3
    So it's slow, but easily disabled. Excellent.
     
  4. Bear macrumors G3

    Joined:
    Jul 23, 2002
    Location:
    Sol III - Terra
    #4
    I'm not sure how you read that out of the person's answer.

    It didn't seem to be that slow in the demos. And rememebr the person was only guessing in how it works.
     
  5. jhujhiti thread starter macrumors newbie

    Joined:
    Feb 8, 2005
    Location:
    Ledyard, CT, USA
    #5
    By slow, I meant it's slower than it "could be." If it were in-kernel or even built into the filesystem (the way ext3 is ext2 with journalling added), it would be much faster.
     
  6. Bear macrumors G3

    Joined:
    Jul 23, 2002
    Location:
    Sol III - Terra
    #6
    Ahh, but we don't really know where it's built into. And truthfully, it being external to the filesystem drivers would be a good thing.
     
  7. toneloco2881 macrumors 6502

    Joined:
    Jan 23, 2005
    #7
  8. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #8
    This simply is not true! Kernel code does not run faster than non-kernel code. The hooks in the filesystem to detect when new files are created and existing files are modified are in the filesystem (which is not in the kernel, but in a VFS plugin). The dameon is in userland and gets called by the VFS HFS+ plugin.

    This is a better solution than a hard coded kernel component as it is more secure (if there is a security problem with the Spotlight indexer it cannot compromise the kernel), is more stable (if the indexer hangs or crashes it does not take out the whole machine) and is extensible which is very important (so your favourite developers can expose their proprietary files to the indexer). The second and third points go hand in hand as if this was running as part of the kernel process then any developer could have code running as the kernel process simply by providing a meta-data importer!
     

Share This Page