On Freitag 27 Mai 2005 22:14, Andy Ross wrote:
> Even weirder: comment out the split() call, which is 100% CPU-bound
> (let me say that again: split() does no I/O and makes no direct calls
> to the OS kernel), and the runtime goes down to 1.3 seconds.  Huh?

I recently profiled flightgear with gprof and with callgrind.
One of the functions most cpu intensive function under Linux (fedora core 3) 
is the isspace() function in split.
That might be even worse with the windows implementation of isspace.
I am at the moment not shure, but I can imagine that this function needs to be 
locale aware like for example the isupper() function definitly is.
May be this one is a starting point.

Also I can well imagine that allocating that string each time we read some few 
bytes might be time consuming.
By just calling reserve(some number) for the vector and/or for the strings 
appearing here might reduce the allocation/copying overhead a bit.
At least some internal routine from std::vector used to insert a new element 
shows up in the -pg profile of split.

While this will most propably not affect the windows problems, it is still a 
heavyweight function at startup time.

 Greetings

       Mathias

-- 
Mathias Fr�hlich, email: [EMAIL PROTECTED]

_______________________________________________
Flightgear-devel mailing list
[email protected]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d

Reply via email to