eygraber
11/18/2024, 10:44 PMApolloInterceptor
and there seems to be a lot of overhead for the non-network execution. I have an OkHttp HttpLoggingInterceptor
installed as well, and it is showing me ~100ms RTT using
val startNs = System.nanoTime()
val response = chain.proceed(request)
val tookMs = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - startNs)
When I do the same thing in the ApolloInterceptor
it takes ~600ms
val startNs = System.nanoTime()
chain.proceed(request).onEach { response ->
val tookMs = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - startNs)
...
}
Is that kind of overhead expected?Stylianos Gakis
11/18/2024, 10:50 PM0 = {LoggingInterceptor@44117}
1 = {LogoutOnUnauthenticatedInterceptor@44118}
2 = {WatcherInterceptor@44119}
3 = {FetchPolicyRouterInterceptor@44120}
4 = {ApolloCacheInterceptor@44121}
5 = {DefaultRetryOnErrorInterceptorImpl@44122}
6 = {NetworkInterceptor@44123}
Your Apollo interceptor would start the time before 0 starts, and it would end after 6 ends.
While the Okhttp one would start counting before 6 starts, and it would end after 6 ends.
This is the first thing that comes to my mind. It's definitely possible that I have a wrong understanding of where the OkHttp request starts and ends. But what do you think, do you think that this explanation would make sense here?mbonnin
11/18/2024, 10:55 PMApolloCacheInterceptor
, especially if using a SQL cache. Writing large response to the disk can be slow. If you have that kind of results without a cache, that's unexpectedeygraber
11/18/2024, 10:56 PMStylianos Gakis
11/18/2024, 10:56 PMeygraber
11/18/2024, 10:57 PMmbonnin
11/18/2024, 10:58 PMmbonnin
11/18/2024, 11:00 PMeygraber
11/18/2024, 11:01 PMeygraber
11/18/2024, 11:04 PMeygraber
11/18/2024, 11:07 PMmbonnin
11/18/2024, 11:09 PMmbonnin
11/18/2024, 11:16 PMeygraber
11/18/2024, 11:18 PMmbonnin
11/18/2024, 11:19 PMmbonnin
11/18/2024, 11:20 PMeygraber
11/18/2024, 11:20 PMmbonnin
11/18/2024, 11:47 PMI --> POST <https://confetti-app.dev/graphql> (875-byte body)
I <-- 200 <https://confetti-app.dev/graphql> (1157ms, 262214-byte body)
I took 1554
mbonnin
11/18/2024, 11:47 PMmbonnin
11/18/2024, 11:50 PMI --> POST <https://confetti-app.dev/graphql> (875-byte body)
I <-- 200 <https://confetti-app.dev/graphql> (536ms, 262214-byte body)
I took 663
mbonnin
11/18/2024, 11:51 PMwasyl
11/18/2024, 11:52 PMmbonnin
11/18/2024, 11:53 PMmbonnin
11/19/2024, 12:01 AM--> POST <https://confetti-app.dev/graphql> (875-byte body)
<-- 200 <https://confetti-app.dev/graphql> (493ms, 262214-byte body)
took 631
--> POST <https://confetti-app.dev/graphql> (875-byte body)
<-- 200 <https://confetti-app.dev/graphql> (523ms, 262214-byte body)
took 748
--> POST <https://confetti-app.dev/graphql> (875-byte body)
<-- 200 <https://confetti-app.dev/graphql> (488ms, 262214-byte body)
took 611
--> POST <https://confetti-app.dev/graphql> (875-byte body)
<-- 200 <https://confetti-app.dev/graphql> (584ms, 262214-byte body)
took 690
eygraber
11/19/2024, 12:14 AMeygraber
11/19/2024, 12:37 AMeygraber
11/19/2024, 4:17 AMmbonnin
11/19/2024, 8:14 AMephemient
11/19/2024, 11:49 PM