Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

File System Event callback only gets one event



Hello again,

This is more idle curiosity more than anything, but I find the FSEvents callback behavior odd.

I have created a File System Events stream and start it running. What I find odd, particularly in light of the API design which is clearly designed to handle large volumes of events, is that I never get any big batches of events passed to my callback routine, even when I start with a stream that asks for hundreds of thousands of historical events.

Every time my callback function is called, the numEvents parameter is 1. It processes one event and returns. When processing thousands of historical events, most of the CPU time is wasted in the run loop. According to Shark & sample, only 10% of the time is spent in my callback function. The other 90% is spent in the run loop. This makes me think that I could get up to an order of magnitude improvement in performance if the stream would just pass more than 1 event at a time to my callback.

I'm also surprised at the number of duplicate consecutive events. I could also deal with these more efficiently if I could process the events in larger batches.
--
James Bucanek


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Filesystem-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/filesystem-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.