Best way to benchmark parsing

Good day and I hope everyone reading this is well. I wanted to try to figure out if in the Android Client there is a good way to benchmark the data parsing?

I don’t see any hooks in the ApolloParseInterceptor nor a seemingly easy way to do this. Outside of vendoring the library, using reflection to unlock the chain.interceptors in ApolloInterceptor and replace the ApolloParseInterceptor with something we built or adding an additional gradle task for modifying the generated query/mutation class’s parse() methods to include something which would allow timing the parsing, I don’t see a solution to this.

Would love if anyone had any insight. Thanks!

1 Like

Oh my, sorry Adam I completely missed this :person_facepalming:. Thanks @JeffAuriemma for surfacing this :pray:.

I’m going to assume you found a solution since we spoke since July :sweat_smile:. In case anyone bumps into this, we have parsing benchmarks in the repo (here)

The longer answer for benchrmarking inside an app is more complicated because parsing is happening in parallel to network I/O so any measurement you do is most likely going to be I/O bound. This is usually what you want because that means your parsing is amortized during network I/O but anyone looking at pure parsing benchmark should look into the microbenchmarks instead.

1 Like