Looking for some guidance on possibly the fastest way to read multiple
messages in a file that has multiple MessageRoots
So far I have this written:
capnp::MallocMessageBuilder messageBuilder;
//What is a good size for our words? As long as its smaller?
capnp::word scratch[1024];
kj::ArrayPtr<capnp::word> scratchSpace(scratch);
kj::FdInputStream stream(fd);
kj::BufferedInputStreamWrapper buff(stream);
unsigned long count = 0;
while (buff.tryGetReadBuffer().size() != 0) {
capnp::InputStreamMessageReader message(buff, capnp::ReaderOptions(),
scratchSpace);
Message::Reader chunk = message.getRoot<Message>();
count++;
}
I tried the helper methods first, but they seem too slow I think without the
BufferedInputStreamWrapper.
I don't do much C++ so I appreciate any help :)
Btw, Is there an IRC chat or something ?
--
You received this message because you are subscribed to the Google Groups
"Cap'n Proto" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
Visit this group at https://groups.google.com/group/capnproto.