GNU bug report logs -
#20887
'make bootstrap' now verrrry slow due to recent isearch changes
Previous Next
Reported by: Paul Eggert <eggert <at> cs.ucla.edu>
Date: Wed, 24 Jun 2015 01:36:01 UTC
Severity: normal
Done: Paul Eggert <eggert <at> cs.ucla.edu>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
> Date: Thu, 25 Jun 2015 00:37:51 +0100
> From: Artur Malabarba <bruce.connor.am <at> gmail.com>
> Cc: 20887 <at> debbugs.gnu.org
>
> I think I see now. Reading the code for `get-char-code-property' shows
> that I had to call a function stored in the extra slot.
> Calling that function on the table seems to be sufficient to populate it.
Indeed, the Unicode tables are tricky, in that with some of them you
need to call the function stored in the 1st extra slot to reconstruct
the value for a character. (And if there's no function in that extra
slot, you should use get-unicode-property-internal to decode the
value.)
However, I think the version you pushed can be further improved. For
starters, you don't need to populate the table first, and only then
use it; you can produce the property value for a character and use it
in the same call to map-char-table. For example, the following
snippet loops only once over the table, and does its job in about 2
sec:
(let* ((table (unicode-property-table-internal 'decomposition))
(func (char-table-extra-slot table 1)))
(map-char-table
(lambda (key val)
(if (consp key)
(message "%s %s" key (funcall func (car key) val table))
(message "%s %s" key (funcall func key val table))))
table))
All you need is replace the silly 'message' calls with the body of
your processing code (and handle all the characters in a range of
codepoints, not just the first one).
Your code also calls unicode-property-table-internal twice, and the
above method will solve that as well.
Thanks.
This bug report was last modified 9 years and 334 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.