[openbeos] Re: A new BMessage implementation (Message4)
From: Michael Lotz <mmlr@xxxxxxxx>
To: openbeos@xxxxxxxxxxxxx
Date: Tue, 01 Nov 2005 17:39:45 +0100
I don't understand why the speed of message4 is a lot slower than
the message3 version in the tests for reading 5000Int32 or
5000strings.
The data are kept pretty much the same way (as far as i understand) in
message3 and 4.
Yes the data is stored in the exact same way actually. But in the
Message3 case there is a BList that holds direct offsets to the fields.
This speeds up the lookup extremly, as you don't have to iterate through
all the size/data pairs. But as always with keeping offsets - you have
to change them when removing or resizing something in front of them. So
not using an offset table is preferrable for smaller messages. And I
think that most messages will be in the range from 1-500 where speed
should be acceptable. Some caching could be done though.