Skip to content
This repository has been archived by the owner on Sep 23, 2021. It is now read-only.

hacker slides slow down #37

Open
servusoft opened this issue Feb 24, 2018 · 11 comments
Open

hacker slides slow down #37

servusoft opened this issue Feb 24, 2018 · 11 comments

Comments

@servusoft
Copy link
Contributor

The behavior of big slides is slower. It is stored too often.
If the saving takes a long time, you have to wait before you can continue typing.

I have made a small optimization:
servusoft@8314861

It helps a bit, but in optimal case the time should change automatically,
depending on the duration of the storage process.

@msoedov
Copy link
Owner

msoedov commented Feb 24, 2018

@servusoft interesting. It not very optimized for IO and even 1 byte change in the slide will result sending entire file content to the server and writing it to the filesystem.

The optimal way would be just sending the changed diff and writing this diff to file but initially it seemed as not easy to implement.
Your change with the last cursor seems to be a good first step in optimization :)

I will pay locally with a large file to see if I can optimize anything else.

@servusoft Please make the pull request with 8314861 commit 👍

@servusoft
Copy link
Contributor Author

While working with hacker slides, I noticed that it freezes from time to time and I have to wait a bit before I can continue typing. The investigations have shown that the data is permanently sent to the server, even with cursor movement.

It certainly depends on the speed of the connection. In the local connection, it does not matter. But the hosted on a remote server docker instance can hang something.

Sure, sending the differenial data would be quite optimal, but that's not easy to implement. A compromise would be to send only the current slide. The delay can also happen by page rendering.

To get a feeling, I temporarily created a page with docker:
http://www.wolfonstage.de:1291/stash

@msoedov
Copy link
Owner

msoedov commented Feb 25, 2018

Happy Saturday @servusoft ! Have you tried #38 patch? It suppose to boost editing performance at-least for a bit. I got an another idea to just send the changed line and line offset to the server on any keystroke or/and periodically

@msoedov
Copy link
Owner

msoedov commented Feb 25, 2018

I just tagged and pushed msoedov/hacker-slides:1.0.0 image which includes some optimizations

@servusoft
Copy link
Contributor Author

servusoft commented Feb 25, 2018

Now I have the same slide - README.md on
0.9 (without chaching) on http://www.wolfonstage.de:1291/stash/edit/README.md
and on 1.0.0 (with chaching) http://www.wolfonstage.de:1292/stash/edit/README.md
I think, it is not significantly better.

@msoedov
Copy link
Owner

msoedov commented Feb 25, 2018

Does 0.9 version include your changes servusoft/hacker-slides@8314861 ? It feels like 1.0.0 version doing even worse than 0.9 :)

@servusoft
Copy link
Contributor Author

servusoft commented Feb 25, 2018

I have not sent the PR yet.. I wanted to look at the slide with cachinng.
Now I have my own build (master) with my optimazation.
http://www.wolfonstage.de:1293/stash/edit/README.md

@servusoft
Copy link
Contributor Author

it does not look like it really helps. The cause may be due to the reendering.

@msoedov
Copy link
Owner

msoedov commented Feb 25, 2018

There are two different issues

  • Freezes during typing which is kind of solved by combination of yours patch and caching
  • Delays in re rendering - this is not really trivial to fix and will require some additional work

@servusoft
Copy link
Contributor Author

Ok then let's go first. then I send the PR

@msoedov
Copy link
Owner

msoedov commented Feb 26, 2018

@servusoft good caught man! I will see what can optimize on front end side this week

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants