diff options
| author | Paul Eggert | 2012-06-25 19:33:51 -0700 |
|---|---|---|
| committer | Paul Eggert | 2012-06-25 19:33:51 -0700 |
| commit | 99027bdd81f63ea690394a153ef49a08f55e498d (patch) | |
| tree | b7b7083784549ae09d9e688441168627262d4b6d /src/ChangeLog | |
| parent | cf38a720e81b545f90dc7be81891d94df6ed059a (diff) | |
| download | emacs-99027bdd81f63ea690394a153ef49a08f55e498d.tar.gz emacs-99027bdd81f63ea690394a153ef49a08f55e498d.zip | |
Use sprintf return value instead of invoking strlen on result.
In the old days this wasn't portable, since some sprintf
implementations returned char *. But they died out years ago and
Emacs already assumes sprintf returns int.
Similarly for float_to_string.
This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
* ccl.c (ccl_driver):
* character.c (string_escape_byte8):
* data.c (Fnumber_to_string):
* doprnt.c (doprnt):
* print.c (print_object):
* xdisp.c (message_dolog):
* xfns.c (syms_of_xfns):
Use sprintf or float_to_string result to avoid need to call strlen.
* data.c (Fnumber_to_string):
Use make_unibyte_string, since the string must be ASCII.
* lisp.h, print.c (float_to_string): Now returns int length.
* term.c (produce_glyphless_glyph):
Use sprintf result rather than recomputing it.
Diffstat (limited to 'src/ChangeLog')
| -rw-r--r-- | src/ChangeLog | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index dec5ee328a7..5b3387b8134 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,25 @@ | |||
| 1 | 2012-06-26 Paul Eggert <eggert@cs.ucla.edu> | 1 | 2012-06-26 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 2 | ||
| 3 | Use sprintf return value instead of invoking strlen on result. | ||
| 4 | In the old days this wasn't portable, since some sprintf | ||
| 5 | implementations returned char *. But they died out years ago and | ||
| 6 | Emacs already assumes sprintf returns int. | ||
| 7 | Similarly for float_to_string. | ||
| 8 | This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64. | ||
| 9 | * ccl.c (ccl_driver): | ||
| 10 | * character.c (string_escape_byte8): | ||
| 11 | * data.c (Fnumber_to_string): | ||
| 12 | * doprnt.c (doprnt): | ||
| 13 | * print.c (print_object): | ||
| 14 | * xdisp.c (message_dolog): | ||
| 15 | * xfns.c (syms_of_xfns): | ||
| 16 | Use sprintf or float_to_string result to avoid need to call strlen. | ||
| 17 | * data.c (Fnumber_to_string): | ||
| 18 | Use make_unibyte_string, since the string must be ASCII. | ||
| 19 | * lisp.h, print.c (float_to_string): Now returns int length. | ||
| 20 | * term.c (produce_glyphless_glyph): | ||
| 21 | Use sprintf result rather than recomputing it. | ||
| 22 | |||
| 3 | Clean out last vestiges of the old HAVE_CONFIG_H stuff. | 23 | Clean out last vestiges of the old HAVE_CONFIG_H stuff. |
| 4 | * Makefile.in (ALL_CFLAGS): | 24 | * Makefile.in (ALL_CFLAGS): |
| 5 | * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H. | 25 | * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H. |