Revision 816465Go back to digest for 8th June 2008
Optimization in Educational
StarObject objects for unnamed stars are now created by memcpy()-ing a template object and then filling in the data, instead of using the constructor.
Also replacing call to skyMesh::indexStar(...) by a simple method of obtaining the trixel ID. [Works only for level 3 HTM.
This seems to have brought down the time to load each star by a factor of 6!!
On my system, it now takes about 225 seconds on an average to load 41560 stars, as against ~1745 seconds earlier.
The timing code is currently left as it is, for testing this out.
Some of the newly implemented code could be dangerous, as it uses pointers at a very low level.
This code is almost surely going to result in a segmentation fault when we implement storage and retrieval of observing log data and user-added links.
I didn't realise it would be so easy to do this - I thought I'd have to modify all classes in the inheritance tree starting from SkyPoint!
Many thanks to James, who rightly pointed out that it was the stack of constructors (and the SkyMesh::indexStar()) that were eating away most of the time.