[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

cast problem in code conversion

From: YAMAMOTO Mitsuharu
Subject: cast problem in code conversion
Date: Sun, 26 Dec 2004 13:51:00 +0900 (JST)
User-agent: SEMI/1.14.6 (Maruoka) FLIM/1.14.6 (Marutamachi) APEL/10.6 Emacs/21.3.50 (sparc-sun-solaris2.8) MULE/5.0 (SAKAKI)

Calculation of the value of `ratio' in `code_convert_region' is
missing a cast to float.  That makes the result inaccurate.

In Emacs 21.2, the part in question was as follows:
          float ratio = coding->produced - coding->consumed;
          ratio /= coding->consumed;

But in Emacs 21.3,
              ratio = (coding->produced - coding->consumed) / coding->consumed;

Reverting this change drastically improves performance when opening a
large binary file.  For example, opening the Emacs executable becomes
6 times faster for me.

                                     YAMAMOTO Mitsuharu

In GNU Emacs (sparc-sun-solaris2.8, X toolkit, Xaw3d scroll bars)
 of 2004-12-26 on church
Distributor `The XFree86 Project, Inc', version 11.0.40300000
configured using `configure '--x-libraries=/usr/local/lib' 'CFLAGS=-O2 -mv8''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: ja
  locale-coding-system: japanese-iso-8bit
  default-enable-multibyte-characters: t

Major mode: Lisp Interaction

Minor modes in effect:
  tool-bar-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  unify-8859-on-encoding-mode: t
  utf-translate-cjk-mode: t
  line-number-mode: t

reply via email to

[Prev in Thread] Current Thread [Next in Thread]