[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [CPROG] Laaangsom snprintf()



Egon Andersen, Talura <sslug@sslug> wrote:
: Hej,

: Jeg har et problem med hastigheden af snprintf().

: I et real-tids program har jeg et sted følgende program linie:

: length = snprintf(tmpbuf, bufsize, "%-.*LE", fractional_digits,
: RealValue);

: Ovenstående linie overskygger simpelthen alt andet i programmet, mht.
: tidsforbrug og der foregår faktisk ganske meget andet!

: Jeg har mål forbruget til ca. 20000 clock-cykler, hvilket jeg synes er
: ekstremt meget.

Hmm, måske, måske ikke. Men tilsyneladende er det et 128bit long double floating point 
tal du skriver ud? Det har nok en stor andel af skylden. Hvis der skal 
laves en rigtig effektiv udskriving kunne du måske hacke noget sammen
vha. nogle multimedia SIMD instruktioner. Det er jo lidt afhængig hvilken
processor der sidder på dit (indlejrede??) system. Hvis 20000 clockcykler 
er et problem så burde du måske bruge fixed-point arithmetic, men det 
afhænger self. af hvad du gør med tallene.

Jeg kender ikke lige på stående fod algoritmer smartere end divide/modulus 
methoden.

Mvh Morten
-- 



 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 20:09 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *