grpcpp slice.h

30 views
Skip to first unread message

Saroj Mahapatra

unread,
Nov 2, 2019, 4:13:24 PM11/2/19
to grpc.io
Hello,

Why does grpcpp slice.h not call functions like grpc_empty_slice directly from grpc/slice.h instead of through the g_core_codegen_interface?

Thank you.

Vijay Pai

unread,
Nov 12, 2019, 1:27:30 AM11/12/19
to grpc.io
Great question. This is part of our code-generation layering, actually. We have a requirement that generated code can only include headers in the impl/codegen directories, including transitively. This has long been part of our story for supporting code generation for multiple platforms. At the same time, we've tried to reduce the number of headers in those directories, especially in the Core surface. I don't have a measurement on the performance impact if we were to move grpc_empty_slice etc to the impl/codegen directory, but this overhead doesn't seem to show up noticeably in our performance profiles.

Thanks,
Vijay

Ctmahapa95

unread,
Nov 12, 2019, 4:06:22 PM11/12/19
to Vijay Pai, grpc.io
That makes perfect sense. I was looking at using the class outside non-gRPC code, but it requires grpinit to be called beforehand. A utility class to do rpcinit only once  in Envoy code is illustrative of my dilemma. I ended up using seastar core include temporary_buffer.h as an alternative to slice even though seastar refcount is single-threaded.

Thank you.


--
You received this message because you are subscribed to the Google Groups "grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/13b51ddf-86b2-4f78-be74-74011d213f7b%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages