home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.vxworks
- Path: sparky!uunet!gatech!destroyer!ncar!rsf.atd.ucar.edu!vanandel
- From: vanandel@rsf.atd.ucar.edu (Joe Van Andel)
- Subject: performance of fprintf() for floating point
- Message-ID: <1993Jan11.211242.16776@ncar.ucar.edu>
- Sender: news@ncar.ucar.edu (USENET Maintenance)
- Organization: National Center for Atmospheric Research
- Date: Mon, 11 Jan 1993 21:12:42 GMT
- Lines: 22
-
- I am having a performance problem with fprintf(). I have an application that
- samples antenna position at 15 Hz, and stores the binary positions in a
- dynamically allocated buffer. When I'm done sampling, I convert from binary to
- floating point (angles in degrees), and write the values in ASCII,
- using the following loop:
-
- for (ULONG i= 0; i < CSampleCount_; ++i)
- {
- fprintf(Cfout_, "%8.2f %8.2f\n",
- p->az * BIN_TO_DEG, p->el * BIN_TO_DEG);
- ++p;
- }
-
- On a MVME133 (68020 @ 20Mhz), running under VxWorks 5.02b, release 1, I can only
- write 3-4 lines/second, even if I'm writing to "/null". The MVME133 has a
- co-processor, and I can't figure out what could possibly be taking so long . .
-
- I suppose I could convert from binary to ASCII floating point on my networked Sun
- SPARC instead, but this solution isn't as "clean".
- --
- Joe VanAndel Internet:vanandel@ncar.ucar.edu
- National Center for Atmospheric Research
-