gchp / iota

A terminal-based text editor written in Rust
MIT License
1.63k stars 81 forks source link

slow character deleting #83

Closed rofrol closed 9 years ago

rofrol commented 9 years ago

in emacs or vi style.

Tested under ubuntu 14.10 inside virtualbox on windows 7

gchp commented 9 years ago

I was just in the middle of logging an issue for this :smile:

What I'm seeing is some slowness in moving the cursor around after inserting/deleting some text. There is also slowness in inserting/deleting text after moving the cursor around a bit.

To reproduce:

  1. Open a file and move the cursor down a few lines
  2. Insert / Delete a few characters
  3. Try to move the cursor (holding down arrow keys works best) and see the delay in movement
  4. Try insert / delete chars again - note same slowness as in 3

@Crespyl is also seeing this. @rofrol is that what you're seeing too?

@dlaronson could this be due to the gap in the gapbuffer having to move to the correct place?

utkarshkukreti commented 9 years ago

And it looks like there's a memory leak too when you do that. I deleted a few chars and pressed the right arrow for about 60 seconds and iota is now using > 2gb of memory.

gchp commented 9 years ago

Seems like termbox is leaking a little, which could cause some issues, but the main cuplrit here is gapbuffer which is leaking a lot.

utkarshkukreti commented 9 years ago

I've submitted a fix for the Termbox leak at https://github.com/nsf/termbox/pull/45.

pythonesque commented 9 years ago

We've tracked down the leak in GapBuffer, and someone will fix it shortly.

gchp commented 9 years ago

Logged a ticket here: https://github.com/dlaronson/gapbuffer/issues/8

pythonesque commented 9 years ago

I fixed GapBuffer (had a second minor commit that is waiting for review) after which I will commit updating Cargo.toml, and pull request #87 can be merged.