Cleaned up and optimized Message2.cpp. It avoids as many unnecessary copies as it can now.

The unflatten time is now reduced to about a third of the current BMessage implementation but it's still
about half as quick as R5 (we're talking about microseconds here).
A third version of BMessage that operates purely on a flat buffer is in the works. We'll see which one
will be faster for normal uses.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13821 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Michael Lotz
2005-07-25 00:06:34 +00:00
parent 18b5424c5f
commit 63d5a418ab
6 changed files with 1584 additions and 937 deletions
+4 -1
View File
@@ -41,6 +41,7 @@ public:
ssize_t FlattenedSize() const;
status_t Flatten(BDataIO *stream) const;
status_t Unflatten(BDataIO *stream);
status_t AddData(const char *name, BMallocIO *buffer,
type_code type);
@@ -68,8 +69,10 @@ public:
private:
status_t InitCommon();
BMessageField *AddField(const char *name, type_code type,
status_t &error);
BMessageField *FindData(const char *name, type_code type,
status_t &error) const;
status_t &error) const;
BList fFieldList;
BMessageField **fFieldTable;