Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Laggy input #480

Closed
ovalseven8 opened this issue Mar 29, 2018 · 4 comments · Fixed by #475
Closed

Laggy input #480

ovalseven8 opened this issue Mar 29, 2018 · 4 comments · Fixed by #475
Assignees
Labels
bug It's a bug! performance Impacts performance

Comments

@ovalseven8
Copy link
Contributor

ovalseven8 commented Mar 29, 2018

Expected Behavior

No input latency.

Current Behavior

Laggy input.

Steps to Reproduce (for bugs)

  1. Go to https://pixabay.com/de/s%C3%A4ugetiere-wildlife-teuer-fox-3218028/
  2. Right click -> Copy image
  3. Go to a Threema Web conversation (e.g. ECHOECHO)
  4. Paste image using Ctrl+V
  5. Write something in the image description (type fast, so the problem is more visible)
  6. Extremely laggy input

Now try the following:

  1. Go to https://de.wikipedia.org/wiki/Threema#/media/File:Threema.png
  2. Right click -> Copy image
  3. Go to a Threema Web conversation (e.g. ECHOECHO)
  4. Paste image using Ctrl+V
  5. Write something and you should notice that the input is faster now. So it seems like it has something to do with the media (perhaps media size?).

Your Environment

  • Threema Web version: 1.8.2
  • Threema for Android version: 3.41
  • Browser name and version: Firefox 59.0.2
@dbrgn dbrgn added the bug It's a bug! label Mar 29, 2018
@dbrgn
Copy link
Contributor

dbrgn commented Mar 29, 2018

Thanks for the detailed description, I can confirm the problem.

@LtPatterson
Copy link

Also able to duplicate in Chrome 65

@dbrgn dbrgn added the performance Impacts performance label Jun 17, 2018
@dbrgn dbrgn self-assigned this Jul 2, 2018
@dbrgn
Copy link
Contributor

dbrgn commented Jul 2, 2018

Very slow key and input event handling, time increasing with media size:

img

The key event takes 124ms to process. After some debugging, it turns out that the bufferToUrl filter is called dozens or even hundreds of times when typing.

Pre-converting the buffer to an URI reduced key event handling times down to 14ms.

img

Further optimizations in the codebase are possible and planned.

Main issue fixed in the ios branch as of commit ca93785.

@dbrgn
Copy link
Contributor

dbrgn commented Jul 4, 2018

Released in 2.0.0-beta.7.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug It's a bug! performance Impacts performance
Development

Successfully merging a pull request may close this issue.

3 participants