Re: [PATCH] proc: optimize render_sigset_t()

From: Alexey Dobriyan
Date: Wed Nov 09 2016 - 05:19:10 EST


On Wed, Nov 9, 2016 at 12:37 AM, Andrei Vagin <avagin@xxxxxxxxxx> wrote:

> @@ -245,10 +247,13 @@ void render_sigset_t(struct seq_file *m, const char *header,
> if (sigismember(set, i+2)) x |= 2;
> if (sigismember(set, i+3)) x |= 4;
> if (sigismember(set, i+4)) x |= 8;
> - seq_printf(m, "%x", x);
> + buf[j++] = hex_asc[x];
> } while (i >= 4);
>
> - seq_putc(m, '\n');
> + buf[j++] = '\n';
> + buf[j++] = 0;
> +
> + seq_puts(m, buf);

seq_write() should be used to avoid re-reading in strlen().
Anyway I suspect bulk conversion SIMD-style will still be faster.


Alexey