[Kstars-devel] What's up tonight - Speed issues
Khudyakov Alexey
alexey.skladnoy at gmail.com
Fri Jun 26 19:21:04 CEST 2009
On Пятница 26 июня 2009 20:59:59 Prakash Mohan wrote:
> Hey,
> In the What's up tonight dialog, certain categories take too long to
> load ( >5 or >10 seconds). I've seen this problem earlier when I tried
> to create an "all objects" list for the observation planner where it
> took over 20 seconds to do similar stuff which the WUT does. Any idea
> on what might consume this long a time? (Also I'm using a small
> catalog, I wonder what would happen if use the USNO/Nomad catalog).
> As I see it, in the WUT dialog, we're calling of every component in
> the skyComposite, doing a foreach on the selected category, cast to
> SkyObject if needed and then do a couple of O(1) queries, so, the
> trouble might be due to the usage of "foreach" instead of the
> conventional for loop, or due to some other larger error in
> skyComposite or the casts to SkyObject.
>
Profiling is the answer. You could use valgrind. It doesn't need any special
binary instrumentation but you'd better use fast computer because it create
~30x slowdown. Or you could use gprof, but it need binary instrumentation.
Without measurements one can only guess.
For profiling with valgrind. It can do other nice things too.
$ valgrind --tool=callgrind path/to/program
P.S. There is nice program for inspecting valgrind result - kcachegrind.
More information about the Kstars-devel
mailing list