[Kstars-devel] Binary star data loading accomplished in Branch!

James Bowlin bowlin at mindspring.com
Mon Jun 2 21:26:40 CEST 2008


On Mon June 2 2008, Akarsh Simha wrote:
> > Are you dealing with star names?  I think it is fine to ignore them
> > for now.  But if you are dealing with names it might be good to
> > load the entire starnames file into memory to avoid extra seeks
> > while loading stars.  Once the stars are loaded, the memory for the
> > names can be freed.
>
> Yes, I'm dealing with star names. I could re-implement it that way,
> too. But I don't clearly understand what we are going to gain out of
> this. Would help if you could elaborate on this.

Disk seeks are like a thousand times slower than most other disk 
operations.  They take several milliseconds  while we can read a 
StarData struct in about a microsecond.  The time to do one seek is
equivalent to reading in about 5,000 stars.

If you are reading from two files at the same time, you are causing
a bunch of seeks to occur as the disk head has to ping pong between
the two files on disk.  If one of the files is small, it is much more
efficient to read the entire small file first and store it in memory.
That way the data file can be read sequentially without having to seek
over to the names file and then back to the data file.

If either of the files are already cached then this problem goes away.  
But since this will generally be run as part of the KStars startup, 
most users won't have either file cached.

As a simple test, you could eliminate the reading of names and see what
effect this has on the time it takes to load the stars.

Also, you don't want to run HTMesh->index() when initializing stars 
because this call is very expensive.  We want to use the trixel numbers
that were stored in the datafile.



-- 
Peace, James


More information about the Kstars-devel mailing list