[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-dev] Re: Bitwise stream reading performance
From: |
strk |
Subject: |
[Gnash-dev] Re: Bitwise stream reading performance |
Date: |
Sat, 25 Aug 2007 12:35:36 +0200 |
On Sat, Aug 25, 2007 at 12:05:54PM +0200, Udo Giacomozzi wrote:
> For an introduction to this discussion, see
> http://www.gnashdev.org/wiki/index.php/NinjaProfile
...
> of a local file). Maybe it would be better to implement a
> internal buffered memory stream (sort of a read-ahead buffer for the
> "stream" class.
Yes, I think we need this.
> Secondly, the read_uint() function masks the used bits after having
> consumed them:
>
> m_current_byte &= ((1 << (m_unused_bits - bits_needed)) - 1);
>
> Maybe it would be faster to leave m_current_byte as-is and mask the
> needed bits when updating "value". Should avoid a write access to
> memory and we don't need masking at all in the "consume all the unused
> bits" case.
>
> Setting m_current_byte = 0 should be unnecessary, too. And instead of
> setting bits_needed = 0 a "break" would do as well (ok, not very nice,
> but sligtly faster).
I've implemented the optimization above (except for the mask, which I was
thinking about) tonite, and it does give a slight
improvement, but not enough for my taste.. I think a buffered read
would do much better.
--strk;
- [Gnash-dev] Bitwise stream reading performance, Udo Giacomozzi, 2007/08/25
- [Gnash-dev] Re: Bitwise stream reading performance,
strk <=
- Re: [Gnash-dev] Re: Bitwise stream reading performance, strk, 2007/08/27
- Re[2]: [Gnash-dev] Re: Bitwise stream reading performance, Udo Giacomozzi, 2007/08/27
- Re: [Gnash-dev] Re: Bitwise stream reading performance, strk, 2007/08/27
- Re: [Gnash-dev] Re: Bitwise stream reading performance, strk, 2007/08/27
- Re: [Gnash-dev] Re: Bitwise stream reading performance, strk, 2007/08/27
- Re[2]: [Gnash-dev] Re: Bitwise stream reading performance, Udo Giacomozzi, 2007/08/27
- Re: [Gnash-dev] Re: Bitwise stream reading performance, strk, 2007/08/27
- Re[2]: [Gnash-dev] Re: Bitwise stream reading performance, Udo Giacomozzi, 2007/08/28
- Re: [Gnash-dev] Re: Bitwise stream reading performance, strk, 2007/08/28
- Re[2]: [Gnash-dev] Re: Bitwise stream reading performance, Udo Giacomozzi, 2007/08/28