[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Loading souce Elisp faster
From: |
Kenichi Handa |
Subject: |
Re: Loading souce Elisp faster |
Date: |
Thu, 28 Feb 2013 23:10:57 +0900 |
In article <address@hidden>, Richard Stallman <address@hidden> writes:
> This change in decode_coding_utf_8 should make it considerably faster
> in the usual case where few characters need conversion.
Even with that change, the decoder still copies the source
bytes to the array coding->charbuf, then store characters in
coding->charbuf into the destination buffer. I think the
better place of tuning is in the function decode_coding. It
has do-while loop that basically does this:
do
{
/* decode the source bytes and store characters in charbuf */
(*(coding->decoder)) (coding);
/* insert characters of charbuf in the destination buffer. */
produce_chars (coding, translation_table, 0);
}
while (...)
We can change that to:
do
{
int ascii_bytes = find_ascii_chars_in_source (coding);
if (ascii_bytes > SHORT_CUT_THRESHOLD)
{
/* Copy source bytes directly to destination buffer.
For reading a buffer, source bytes are in a
gap area of the destination buffer. So, with
careful programming, we may even be able to avoid
this coping.
*/
}
else
{
(*(coding->decoder)) (coding);
produce_chars (coding, translation_table, 0);
}
}
while (...)
---
Kenichi Handa
address@hidden
- Re: Loading souce Elisp faster, (continued)
- Re: Loading souce Elisp faster, Leo Liu, 2013/02/25
- Re: Loading souce Elisp faster, Ted Zlatanov, 2013/02/25
- Re: Loading souce Elisp faster, Kenichi Handa, 2013/02/26
- Re: Loading souce Elisp faster, Stefan Monnier, 2013/02/27
- RE: Loading souce Elisp faster, Drew Adams, 2013/02/27
- Re: Loading souce Elisp faster, Werner LEMBERG, 2013/02/27
- Re: Loading souce Elisp faster, Richard Stallman, 2013/02/27
- Re: Loading souce Elisp faster,
Kenichi Handa <=
- Re: Loading souce Elisp faster, Richard Stallman, 2013/02/28
Re: Loading souce Elisp faster, Achim Gratz, 2013/02/25
Re: Loading souce Elisp faster, Richard Stallman, 2013/02/25
- Re: Loading souce Elisp faster, Stefan Monnier, 2013/02/25
- RE: Loading souce Elisp faster, Drew Adams, 2013/02/25
- Re: Loading souce Elisp faster, Stefan Monnier, 2013/02/25
- Re: Loading souce Elisp faster, Lennart Borgman, 2013/02/25
- Re: Loading souce Elisp faster, Stefan Monnier, 2013/02/25
- Re: Loading souce Elisp faster, Lennart Borgman, 2013/02/25
- Re: Loading souce Elisp faster, Stefan Monnier, 2013/02/25