Simplify redisplay-x/separate_textual_runs
17 years, 6 months
Olivier Galibert
separate_textual_runs was a nice, simple function ages ago, but not
anymore. Now it's a not very readable ifdef mess. Building 4
functions for the mule/nomule, xft/xlib cases allows for drastic
simplifications for most of them.
Please review (it's hairy code, another pair of eyes is no luxury) and
apply if happy. It's probably easier in that specific case to check
the result rather than the diff.
OG.
2007-03-30 Olivier Galibert <galibert(a)pobox.com>
* redisplay-x.c (separate_textual_runs_xft_mule): Create.
(separate_textual_runs_xft_nomule): Create.
(separate_textual_runs_mule): Create.
(separate_textual_runs_nomule): Create.
(separate_textual_runs): Split the ifdef mess into 4 separate
functions and simplify each.
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
Re: Simplify redisplay-x/separate_textual_runs
17 years, 6 months
Aidan Kehoe
Ar an t-aonú lá is triochad de mí Márta, scríobh Stephen J. Turnbull:
> Aidan Kehoe writes:
>
> > My last changes to separate_textual_runs eliminated unnecessary
> > assignments during the loop that had been there since the Mule
> > merge.
>
> But AIUI, optimization by the compiler will do that for you, too.
In every case? No, not really. (Okay, I haven’t looked at the generated
assembler for that case.)
> The resulting code is usually cleaner and more readable, but AFAIK it has
> no impact on performance in an optimized build. Is that wrong?
--
On the quay of the little Black Sea port, where the rescued pair came once
more into contact with civilization, Dobrinton was bitten by a dog which was
assumed to be mad, though it may only have been indiscriminating. (Saki)
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
Re: Simplify redisplay-x/separate_textual_runs
17 years, 6 months
Aidan Kehoe
Ar an t-aonú lá is triochad de mí Márta, scríobh Stephen J. Turnbull:
> Aidan Kehoe writes:
>
> > Thanks! Please profile the two (with etc/HELLO at least working for
> > the CJK languages) and post comparisons, separate_textual_runs is
> > called quite a lot.
>
> With all due respect, I don't think this is very useful at this point.
>
> First, in light usage I perceive no slowdown, and don't expect a
> significant speedup, either.
Perception’s not relevant if we have profiling results.
> Second, before optimizing separate_textual_runs, which has always been
> a one-pass O(text length) algorithm, and thus hard to beat (or screw
> up), redisplay (and therefore separate_textual_runs, I suspect) seems
> to be called multiple times for an awful lot of changes; saving whole
> calls the separate_textual_runs would be more helpful.
And the chances of someone getting to that now, as opposed to when we get
some more tuits, are immeasurably small, while the chances of Olivier
getting some useful results out of profiling code which he currently
understands, are more realistic.
My last changes to separate_textual_runs eliminated unnecessary assignments
during the loop that had been there since the Mule merge. We don’t have a
good record on this, and doing something to improve performance is
preferable to the tuits approach.
> There's also an issue that Xft fonts don't seem to be properly cached
> (although on the server side it may not be implemented, which is a
> fact for PROBLEMS, and the chatter I'm seeing from Xft about
> initializing fonts may be due to me putting the debug printfs in the
> wrong place).
--
On the quay of the little Black Sea port, where the rescued pair came once
more into contact with civilization, Dobrinton was bitten by a dog which was
assumed to be mad, though it may only have been indiscriminating. (Saki)
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
Re: Simplify redisplay-x/separate_textual_runs
17 years, 6 months
Aidan Kehoe
Ar an triochadú lá de mí Márta, scríobh Olivier Galibert:
> On Sat, Mar 31, 2007 at 03:16:08AM +0900, Stephen J. Turnbull wrote:
> > s/str[i]/ucs/ and win (tested). Which is obvious, but only if you
> > don't have to fight through a thicket of #ifdefs that you're trying to
> > disentangle. That the fix is this easy is proof of your concept, IMO.
>
> *DUH*
>
> Did you know Ichar is 32bits even --without-mule?
Of course--it’s an int.
> No memcpy for you.
>
> That new version should take everything into account. The changelog
> is identical, we're still the same day ;-)
Thanks! Please profile the two (with etc/HELLO at least working for the CJK
languages) and post comparisons, separate_textual_runs is called quite a
lot.
--
On the quay of the little Black Sea port, where the rescued pair came once
more into contact with civilization, Dobrinton was bitten by a dog which was
assumed to be mad, though it may only have been indiscriminating. (Saki)
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
Re: Simplify redisplay-x/separate_textual_runs
17 years, 6 months
Aidan Kehoe
Ar an triochadú lá de mí Márta, scríobh Olivier Galibert:
> On Fri, Mar 30, 2007 at 04:49:38PM +0200, Aidan Kehoe wrote:
> > For C, the CONSTANT == VARIABLE idiom has a clear advantage over the
> > other way around (that is, ‘+2 = dimension’ doesn’t compile) and the
> > more it’s used, the more readable it gets. Please don’t change this
> > idiom in future.
>
> I know the why, I utterly disagree with "the more readable it gets".
> There are compiler warnings that detect the wrong version anyway so
> the gain is _zero_. I will not use this idiom is any code I touch.
Readability is something subjective, the advantage to CONSTANT == VARIABLE
is not. Please don’t _change_ this idiom in the future. I’m not asking you
to use it yourself.
> The GNU coding style is atrocious, there is no need to make it worse.
> What next, Systems Hungarian Notation?
--
On the quay of the little Black Sea port, where the rescued pair came once
more into contact with civilization, Dobrinton was bitten by a dog which was
assumed to be mad, though it may only have been indiscriminating. (Saki)
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
[AC21.5] Fix typo in docstring
17 years, 6 months
Stephen J. Turnbull
APPROVE COMMIT 21.5
Not relevant to 21.4 AFAICS.
chibi:git-integration steve$ cvs diff version.sh lisp/ChangeLog lisp/diagnose.el
Index: lisp/ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/ChangeLog,v
retrieving revision 1.787
diff -u -r1.787 ChangeLog
--- lisp/ChangeLog 22 Feb 2007 16:53:20 -0000 1.787
+++ lisp/ChangeLog 30 Mar 2007 14:29:07 -0000
@@ -0,0 +1,4 @@
+2007-03-29 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ * diagnose.el (show-object-memory-usage-stats): Fix docstring typo.
+
Index: lisp/diagnose.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/diagnose.el,v
retrieving revision 1.10
diff -u -r1.10 diagnose.el
--- lisp/diagnose.el 31 Mar 2006 08:39:10 -0000 1.10
+++ lisp/diagnose.el 30 Mar 2007 14:29:07 -0000
@@ -169,7 +169,7 @@
(defun show-object-memory-usage-stats ()
- "Show statistics about object memeory usage in XEmacs."
+ "Show statistics about object memory usage in XEmacs."
(interactive)
(garbage-collect)
(let ((buffer "*object memory usage statistics*")
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
[AC] Make cmuscheme.el work on Windows etc.
17 years, 6 months
Michael Sperber
2007-03-27 Mike Sperber <mike(a)xemacs.org>
* cmuscheme.el (scheme-program-args): Add.
* cmuscheme.el (run-scheme): Ask for the name of the Scheme
program and its arguments separately. Otherwise, we prevent
Windows users from using file names with spaces in them, such as
"c:\Program Files\...".
Index: cmuscheme.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/scheme/cmuscheme.el,v
retrieving revision 1.3
diff -u -c -r1.3 cmuscheme.el
*** cmuscheme.el 9 Jul 1999 07:51:02 -0000 1.3
--- cmuscheme.el 27 Mar 2007 10:03:31 -0000
***************
*** 182,192 ****
(scheme-args-to-list (substring string pos
(length string)))))))))
(defvar scheme-program-name "scheme"
"*Program invoked by the run-scheme command")
;;; *don't* ;;;###autoload in XEmacs, since xscheme.el is our default.
! (defun run-scheme (cmd)
"Run an inferior Scheme process, input and output via buffer *scheme*.
If there is a process already running in `*scheme*', switch to that buffer.
With argument, allows you to edit the command line (default is value
--- 182,205 ----
(scheme-args-to-list (substring string pos
(length string)))))))))
+ (defun scheme-list-to-args (args)
+ (let* ((str (apply #'concat
+ (mapcar #'(lambda (arg)
+ (concat " " arg))
+ args)))
+ (l (length str)))
+ (if (zerop l)
+ str
+ (substring str 1 (length str)))))
+
(defvar scheme-program-name "scheme"
"*Program invoked by the run-scheme command")
+ (defvar scheme-program-args nil
+ "*Command-line arguments to `scheme-program-name'.")
+
;;; *don't* ;;;###autoload in XEmacs, since xscheme.el is our default.
! (defun run-scheme (cmd args)
"Run an inferior Scheme process, input and output via buffer *scheme*.
If there is a process already running in `*scheme*', switch to that buffer.
With argument, allows you to edit the command line (default is value
***************
*** 196,208 ****
(interactive (list (if current-prefix-arg
(read-string "Run Scheme: " scheme-program-name)
! scheme-program-name)))
(if (not (comint-check-proc "*scheme*"))
! (let ((cmdlist (scheme-args-to-list cmd)))
! (set-buffer (apply 'make-comint "scheme" (car cmdlist)
! nil (cdr cmdlist)))
(inferior-scheme-mode)))
(setq scheme-program-name cmd)
(setq scheme-buffer "*scheme*")
(pop-to-buffer "*scheme*"))
;;; *don't* ;;;###autoload (add-hook 'same-window-buffer-names "*scheme*")
--- 209,227 ----
(interactive (list (if current-prefix-arg
(read-string "Run Scheme: " scheme-program-name)
! scheme-program-name)
! (scheme-args-to-list
! (if current-prefix-arg
! (read-string "Command-line arguments: "
! (scheme-list-to-args scheme-program-args))
! scheme-program-args))))
(if (not (comint-check-proc "*scheme*"))
! (progn
! (set-buffer (apply 'make-comint "scheme" cmd
! nil args))
(inferior-scheme-mode)))
(setq scheme-program-name cmd)
+ (setq scheme-program-args args)
(setq scheme-buffer "*scheme*")
(pop-to-buffer "*scheme*"))
;;; *don't* ;;;###autoload (add-hook 'same-window-buffer-names "*scheme*")
--
Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches