www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/07/20/04:28:57

Date: Mon, 20 Jul 1998 11:27:46 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Mariano Alvarez Fernández <malfer AT teleline DOT es>
cc: djgpp AT delorie DOT com
Subject: Re: About DJGPP v2.02, more results
In-Reply-To: <35B27366.1AC1@teleline.es>
Message-ID: <Pine.SUN.3.91.980720112724.3059R-100000@is>
MIME-Version: 1.0

On Mon, 20 Jul 1998, Mariano Alvarez Fernández wrote:

>   0.87    479.39     4.33  2688065     0.00     0.00  strtol

This (and other) entries indicate that you convert strings to integers
quite a lot.  You might consider storing the integer values instead,
to cut the number of these conversions.

>   0.63    482.56     3.17  5284125     0.00     0.00  strcopnb
>   0.52    485.17     2.61  5284126     0.00     0.00  strncpy
>   0.48    487.56     2.39  5284125     0.00     0.00  strlen

These entries seem to imply that you call strlen for each call to
strcpy/strncpy.  It would be faster to call memcpy/memmove instead,
since once you know the length of a string, there's no reason to use
the string-copy functions (which are slower because they look for the
terminating null character).

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019