Hi folks,
After doing some profiling and benchmarking, we've found something odd
in the performance of the stdioa [fs]scanf routines in Windows CE 5.0
vs. 4.2.
With a huge test file (50,000 lines, 3 tokens per line), under 4.2 and
5.0 both it takes about 2 seconds to just chunk my way through it with
CreateFile / ReadFile (all these tests are just throwing away the data,
there's no processing time involved). It takes a little over half a
second to fgets() it one line at a time. But if I either work directly
through it with fscanf() or read it a line at a time with fgets() and
use sscanf() on that line, on 4.2 it takes about 4.5 to 5 seconds, while
on 5.0 it takes _16_ seconds!
And, of course, our standard (and large, and complex <g>) application is
heavy on fscanf usage... :)
Has anybody seen similar behavior from these or other stdioa crt
functions? Can anyone explain what's going on that's causing such a
performance hit?
FWIW, here are a couple of sample runs (they are representative, I've
got many similar runs):
WinCE 4.2:
Readfile took 2386 ms
fread took 622 ms
fgets took 711 ms
fscanf(s) took 5075 ms
(fgets took 854 ms
and sscanf took 4520 ms)
WinCE 5.0:
Readfile took 2197 ms
fread took 570 ms
fgets took 646 ms
fscanf(s) took 15991 ms
(fgets took 777 ms
and sscanf (%d) took 15398 ms)
(fgets took 1530 ms
and sscanf (%s) took 17289 ms)
Thanks,
--
Brian Bender
Vocollect, Inc.
Pittsburgh, PA, USA
[Apologies for the following "disclaimer" -- it's corporate policy.]
-CONFIDENTIAL, PRIVILEGED COMMUNICATION-
This e-mail transmission is private and intended for the addressee(s)
only. It may contain information that is privileged and/or
confidential. If you have received this transmission in error, you are
not authorized to read, copy, disclose or disseminate it in any manner.
If you have received it in error, please delete it and all copies
(including backup copies) that have been made, and transmit a reply
message informing the sender that it was misdirected.