Gson slows down Android Studio debugger

I find that Gson deserialization is often very slow (like a few seconds) when I step over from a breakpoint in Android Studio. If the same code is executed in the debugger, but not when manually navigating through it, it works in β€œnormal” time (for example, several milliseconds).

I have not experienced this with any other code, and it does not seem to matter what I am deserializing, or how small or large Json is.

My version of Gson is 2.3.1

Has anyone else experienced this or knew any way to fix it?

+5
source share
2 answers

It's quite normal. I come across this all the time with Gson usually instead of Step Over (F8 on OSX), if you put two break points just before and after deserializing the LOC and use the Resume Program (Option + Cmd + R on OSX), it works well instead.

0
source

Go into Debug mode, click the Two Red Circles icon (view and process all breakpoints and watchpoints), delete all breakpoints, launch the application and add all the necessary breakpoints again.

0
source

Source: https://habr.com/ru/post/1234384/


All Articles