Allow parsing request and writing responses using java streams#41
Allow parsing request and writing responses using java streams#41ansman wants to merge 1 commit intoactions-on-google:masterfrom
Conversation
968dff7 to
0cc75c1
Compare
| companion object { | ||
| private val LOG = LoggerFactory.getLogger(AogRequest::class.java.name) | ||
|
|
||
| private val gson = GsonBuilder() |
There was a problem hiding this comment.
Allocating Gson instances semi heavy and should be cached. Ideally one Gson instance for the whole SDK should be used. Since they are immutable it seems like a reasonable thing to do.
There was a problem hiding this comment.
How many times is create called during a particular request? Will it have any performance changes?
There was a problem hiding this comment.
Probably only once, but it will create a new instance for every server call for no good reason. There is no reason not to cache the instance.
Fleker
left a comment
There was a problem hiding this comment.
Overall LGTM but I'll probably cherry-pick it and see if I can build a sample with it.
@taycaldwell I'd like your comments as well.
| companion object { | ||
| private val LOG = LoggerFactory.getLogger(AogRequest::class.java.name) | ||
|
|
||
| private val gson = GsonBuilder() |
There was a problem hiding this comment.
How many times is create called during a particular request? Will it have any performance changes?
This fixes #39