insomnia icon indicating copy to clipboard operation
insomnia copied to clipboard

[Performance] Insomnia is laggy when working with large request body strings

Open Zero3 opened this issue 7 years ago • 35 comments

  • Insomnia Version: 5.14.8
  • Operating System: Reproducible on Windows 7 and Windows 10

When working with large strings in request bodies, the request body editor in Insomnia becomes very laggy. These are some of the operations that all take multiple seconds to execute:

  • Pasting a string
  • Deleting any character in the string
  • Selecting all request body with CTRL + A

The lag is clearly visible with a single ~100 KB strings. Using a single ~1 MB string, it is pretty unbearable, with every operation mentioned above taking multiple seconds to execute.

Zero3 avatar Mar 02 '18 14:03 Zero3

I was able to reproduce the "Select All" issue with a larger 4.5MB string but couldn't see any lag when deleting characters. Can you provide a sample string for testing purposes?

gschier avatar Mar 08 '18 09:03 gschier

I'm working with requests that return base64 strings currently and i'm experiencing this issue. It can take several seconds to display the text and editing it can be intermitently choppy.

Insomnia 5.14.9.1895 OSX High Sierra MacBook Pro 2016

Im working with an API where I can receive incrementally large base64 strings so when I have time i'll make some requests and try log some times/actions on these strings

mattjbrent avatar Mar 14 '18 19:03 mattjbrent

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar May 13 '18 19:05 stale[bot]

Hey stalebot!

It's quite annoying that you keep closing my issues. I invested time in reporting them, and if they just get closed automatically when your owner don't fix them fast enough, I might be disencouraged from submitting new issues in the future. Maybe your owner doesn't want to encourage people to submit issues in the first place, of course... But that would be sad, wouldn't it? You would think that it would be appreciated. Either way, your disencouragement is working, because I'm quite annoyed with you by now :(.

(cc @gschier)

Zero3 avatar May 21 '18 17:05 Zero3

Sorry @Zero3! @stalebot works well for things like feature request but, I agree, can be annoying for bugs and issues like this that should be resolved.

gschier avatar May 21 '18 21:05 gschier

Thanks for reopening.

Regarding the issue at hand: Like Matt, I also noticed this issue when calling an endpoint that returned Base64 data. In my case, it was in a string field of a JSON object.

Zero3 avatar May 21 '18 21:05 Zero3

I'm having the same issue with request bodies that are large, regardless of encoding. Just ctrl-A on a big JSON blob inside the request window and insomnia freezes completely. In my usage, this is new since v6.0.2.

hapablap21 avatar Aug 17 '18 13:08 hapablap21

I'm having this issue also: large request body slows things to a crawl. I suspect this has to do with the syntax highlighting? Is it possible to turn syntax highlighting off? In this case I'm working on an XML body, but I see exactly the same behaviour with larger JSON bodies. Wrapping long lines on/off seems to have no effect on the issue.

rubin55 avatar Jan 16 '19 14:01 rubin55

As a workaround for now, if you do not need to edit the JSON, it might be possible to attach the JSON as a file instead?

@rubin55 to test if it's the syntax highlighting, can you change the body type to "Other" and see if the problem continues? Also, as another experiment, can you turn on "Nunjucks power user mode" in the main app settings?

gschier avatar Jan 18 '19 20:01 gschier

Hi @gschier; when I change the body type from XML to Other, syntax coloring remains in effect. Thus I'm not sure that in that case I'm actually turning off something that could slow things down in this case. My test file is a 10000 line soap request body for a POST.

rubin55 avatar Jan 21 '19 10:01 rubin55

Ah yes, you'll need to also remove the Content-Type header too I think

gschier avatar Feb 01 '19 22:02 gschier

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar May 03 '19 02:05 stale[bot]

Please do not close this issue that still occurs:

Steps to reproduce:

  • Bodies with big data structures (JSON or XML) or base64 strings

Tested too storing the base64 string in an Insomnia's environment variable

  • Insomnia Version: 2020.3.3
  • Operating System: MacOS Catalina 10.15.6
  • Hardware Specs: i7-8750H + 32GB RAM + SSD 1TB

eamigo86 avatar Sep 01 '20 08:09 eamigo86

I've since moved onto using Postman as this issue was a deal breaker for me. Still an issue 2 years later and is now closed out.

mattjbrent avatar Sep 01 '20 19:09 mattjbrent

I've recently migrated from Postman which is now pretty much garbage (specially version 8) and just came across this issue.

I'm loving Insomnia but the UI lag is pretty annoying..

Can this please be reopened and looked into..? Thanks!

HeCorr avatar May 27 '21 01:05 HeCorr

I'd like to know a surefire way to reproduce this - something of a baseline I might use to see if there's any kind of systemic issue that can be solved. Can anyone here provide an example request that creates the lag?

I hope it goes without saying, but just to say it, we definitely want the user experience with insomnia to be top-notch. While we have to make tough decisions when we're prioritizing (and that could mean not addressing this issue, even), it does wonders to have clear reproducibility with which we can measure improvements.

dimitropoulos avatar May 27 '21 01:05 dimitropoulos

@dimitropoulos this one lags pretty badly (freezes for about 2 seconds when pressing spacebar in the middle of a base64 string): https://gist.github.com/HeCorr/93ca21ce2d26ae146574ac0246df651c It consists of three 4k images encoded in base64.

My pc specs:

Intel Core i5 3330s @ 2.7GHz
Corsair 8GB DDR3 @ 1600MHz
EVGA 1050Ti 4GB

If you have a better machine than this, you might need to duplicate a few items in the request to push it beyond 3MB.

HeCorr avatar May 27 '21 14:05 HeCorr

~~As a side note... changing the body type to "Other" doesn't seem to disable syntax highlighting. it just keeps using the latest one (possibly a bug. I can open a different issue for that) so I can't really test if the lag is caused by syntax or just by a lot of text in the text box.~~

Edit: Clicking "No Body" and changing back to "Other" seems to correctly disable syntax highlighting but the issue remains so we can pretty much eliminate the highlight being an issue.

HeCorr avatar May 27 '21 14:05 HeCorr

After some quick profiling:

A very small request (a few bytes), after pressing the enter key (new line)

image

A large request (about 3MB, the one from the gist link), after deleting a few characters from a base64 string

image

HeCorr avatar May 27 '21 16:05 HeCorr

So? Is anyone going to reopen this issue or do I have to create another one?

HeCorr avatar Jun 07 '21 20:06 HeCorr

can confirm with the above that there's a lag. this isn't happening on a CodeMirror demo (e.g. https://codemirror.net/demo/theme.html) so I think it should be possible for us to have the same performance.

dimitropoulos avatar Jun 08 '21 11:06 dimitropoulos

I am confused about why I was just assigned to this issue. I gave up contributing to Insomnia a long time ago because stalebot kept closing my issues that I spent a lot of time preparing...

Zero3 avatar Jun 08 '21 15:06 Zero3

@Zero3 I'd like to personally apologize about that. If it's any consolation to you - we agree that there's been a lot of undue friction by the stalebot and decided yesterday that we're just going to remove it altogether. There's a PR that I expect to merge today to do so https://github.com/Kong/insomnia/pull/3457. I don't know why it assigned you.. I've unassigned you.

Please let me know any issue that you worked on that the bot closed and I'll work with you on them to see where they're at and what we can do about it. I looked around and I just found the one https://github.com/Kong/insomnia/issues/668 and I reopened it and left a comment (indeed, I think it's a good issue for you to have raised). please let me know if there are others I missed.

dimitropoulos avatar Jun 08 '21 15:06 dimitropoulos

Sorry folks! This was incorrectly tagged as a feature request along with other bugs. I'm going back through and cleaning up, sorry for the inconvenience.

wdawson avatar Jul 02 '21 18:07 wdawson

@dimitropoulos Thanks a lot :). Good to hear that you are working on improving things! Thanks for re-opening that other issue as well, which indeed was the one I had in mind. I appreciate it.

(I was re-assigned to this issue by just after you removed me though, by another bot, so it seems like your bot troubles are not quite over yet...)

Zero3 avatar Jul 03 '21 19:07 Zero3

From my testing, code mirror seems to lag just as much as Insomnia..

But Postman seems to handle huge texts very well.. even selecting and erasing everything takes less than a second:

https://user-images.githubusercontent.com/75134774/125992955-4e3b89ce-b260-4667-a822-4278182d11ea.mp4

HeCorr avatar Jul 16 '21 18:07 HeCorr

2022 and this is still a problem. It is very very easy to reproduce.

  1. A large text of base 64 string inside of json body.

The performance is very slow and laggy

Tjax33 avatar Mar 28 '22 19:03 Tjax33

We're looking at switching off of code mirror for this reason among others. Nothing to report yet on timelines but there's appetite on the team for sure.

wdawson avatar Mar 29 '22 16:03 wdawson

Im on a 665 row yaml for our API and am about 1/5 in. It is very sluggish ang laggy on my m1 pro. This bug makes me switch to Swagger hub or even postman.

zocom-johan-kivi avatar May 28 '22 08:05 zocom-johan-kivi

Linked with https://github.com/Kong/insomnia/issues/3915 and https://github.com/Kong/insomnia/issues/4890

filfreire avatar Jun 27 '22 10:06 filfreire