protobuf operation

quite impressed by protobuf performance, that the built in implementation is even better than streaming earlier:

                        .filter(file -> ...)
                        .map(file -> ..)
//read into protobuf
                        .reduce((m1, m2) -> m1.toBuilder().mergeFrom(m2).build())
                        .orElseGet(()-> Stress.StressModels.getDefaultInstance())


is even better performing than

models = Files.list(Paths.get(..)).filter(Files::isRegularFile)
                    .filter(file -> ..)
                    .map(file -> ..)
                    .flatMap(m -> m.getModelsList().stream());


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s