kean / Pulse

Network logger for Apple platforms
https://pulselogger.com
MIT License
6.32k stars 302 forks source link

Scroll lag #167

Closed hugovanderlei closed 1 year ago

hugovanderlei commented 1 year ago

First of all, thank's a lot for this incredible tool!!

When i open a large request body or any large text, i always get scrolling lags, i guess this something new.

I'm using Pulse 3.5.2.

kean commented 1 year ago

I don't think it changed much. What device and platform version are your running on?

hugovanderlei commented 1 year ago

I'm running on iPhone 14 Pro Max, Pulse 3.5.2, iOS 16.3.1

kean commented 1 year ago

I tested it with a 25 MB JSON file. I've done many optimizations to the syntax highlighter in v3, so it opens it pretty quickly; faster than some other tools (Xcode).

The way UITextView works is it incrementally loads the content as your open it. I'm not sure there is much I can do to improve it. I could run ensureLayoutForCharacterRange as you open it, but it takes a significant amount of time. I don't think it's the right trade-off.

I think I should start looking for other ways to render these files. Maybe a web view would be faster. Alternatively, it could limit how much text is displayed by default and manually preload it as you scroll.

kean commented 1 year ago

Fixed in 3.5.6. TextKit 2 was the culprit.

hugovanderlei commented 1 year ago

Thank's for the fix, now it's perfect!