[OT] Re: Dijkstra's Shortest Path algorithm

Roy Katz katz at Glue.umd.edu
Wed Dec 13 13:16:24 EST 2000


It was mandated in the assignment that we use cin/cout :)
I considered rewriting them, as they were pretty slow. 
What proved to be the biggest time saver was caching everything: objects,
array indeces, etc.  Given the amount of time I spent optimizing this
project, I have a very profound respect for C now. 


Roey
who would have used only getc(stdin) if it was allowed



On Wed, 13 Dec 2000, Bjorn Pettersen wrote:

> Yes, unfortunately, if you want fast IO you shouldn't use the iostreams
> library (the new standards compliant one is even slower than the old
> iostreams.h version since it has to go through locale *sigh*).
> 
> fopen/fread etc. are still available when you need speed (and usually much
> easier on the eye also <wink>).
> 
> -- bjorn
> 
> 




More information about the Python-list mailing list