Re: Faster UTF-8 decoding in GLib



Hi,

Am Dienstag, den 16.03.2010, 21:05 +0200 schrieb Mikhail Zabaluev:

> I have tested your solution as applied to mainline g_utf8_get_char(),
> and not inlined except any intra-file optimizations. The results are
> for ARM this time.
[...]
> From the looks of it, some lesser oomph from the non-inlined version,
> but consistently better for inlining (I assume without looking that
> the optimizer did that in g_utf6_to_ucs4). I think it makes total
> sense to use your implementation internally at least.

Rock!
/me jumps up and down, full of joy

I'm a bit surprised that my version was minimally slower than mainline
for the ASCII case.  Given that the GOT lookup is avoided, I would not
have expected that.  Maybe it would be different on i386.

If you have the time, it would also be very cool if we had a direct
comparison between my implementation and yours, with both functions
inline and both functions non-inline.

In any case, thanks a lot for taking the time to profile this.  I never
got around to doing that myself.  The profiling I did myself was limited
to looking at the assembler output and fine-tuning the code accordingly.

Oh, one thing is important to note, if this is indeed considered for
adoption in GLib:  The new implementation will behave differently for
invalid input.  Not that it matters much, since in that case the result
is undefined anyway.  But it's better to be aware of that.  As far as
stability goes, the code has been in place in glibmm for years now --
indeed, it was added before the first stable release of the 2.0 series.

Cheers,
--Daniel




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