diff options
author | Chris Kuethe <chris.kuethe@gmail.com> | 2008-12-27 09:15:40 +0000 |
---|---|---|
committer | Chris Kuethe <chris.kuethe@gmail.com> | 2008-12-27 09:15:40 +0000 |
commit | e6b2b986ff8c91f2ec1f8dbc05a62f5bf9fcd91b (patch) | |
tree | a0b4e270d5b7fdf0c2e9aa2551c29bce51dc088a /bits.c | |
parent | d4bee24389232b37dd0ae816789806f8fe1f34fa (diff) | |
download | gpsd-e6b2b986ff8c91f2ec1f8dbc05a62f5bf9fcd91b.tar.gz |
Add a wrapper function around gpsd_hexdump to avoid hexdumping buffers...
...and copying ascii strings around when they're not going to be printed.
This saves quite a lot of CPU. I processed a 50MB ubx binary file. With
no "-D" options, this saved nearly 2.2M calls to gpsd_hexdump and the
processing time for this file went from 84 seconds to 35 seconds.
Diffstat (limited to 'bits.c')
-rw-r--r-- | bits.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -31,7 +31,8 @@ unsigned long long ubits(char buf[], unsigned int start, unsigned int width) fld |= (unsigned char)buf[i]; } #ifdef DEBUG - printf("Extracting %d:%d from %s: segment 0x%llx = %lld\n", start, width, gpsd_hexdump(buf, 12), fld, fld); + printf("Extracting %d:%d from %s: segment 0x%llx = %lld\n", start, width, + gpsd_hexdump(buf, 12), fld, fld); #endif /* DEBUG */ end = (start + width) % BITS_PER_BYTE; |