Kirill,
> I'm doing some calculations with spherical functions Ylm, and
> the problem is that my code is running painfully slow.
Hmm, sounds like an interesting problem.
About profiling, take a look at the functions timer and timer_info --
timer records function call execution time and timer_info shows
the results.
? timer
at the input prompt should find info about these functions.
Hope this helps,
Robert Dodier