I recently got some comments on osync about performance issues with large filesets (600k files).
[Edit] Probem actually raised with rsync < 3.1.2 when transferring xattrs.[/Edit]
Before going insane with a debugger and some pretty hard tools, I decided to write a very small performance profiler function.
My scripts often use forks in order to keep control over the execution time, and that's where I hook the performance profiler (which actually is a big term just for something to log cpu & memory usage).