Profanity: Lag when holding cursor movement in input window

Created on 31 Dec 2019  路  2Comments  路  Source: profanity-im/profanity

Expected Behavior

After holding a cursor movement key (like left or right arrow keys) there should not be any delay after releasing the key.

Current Behavior

After holding a cursor movement key, the key action (cursor movement) keeps on a repeating for a duration proportional to the time the key was held, as if profanity is not able to keep up with key input speed and an event queue is building up, which may explain why once released, the action keeps on repeating.

Steps to Reproduce

Write a long text in the input window. Go back and forth with the arrow keys (holding the keys), notice the lag/delay.

Context

I noticed that while wanting to go back towards the beginning of a long sentence to edit it and while releasing the arrow key to go back, the cursor kept moving for some time.

Environment

  • Give us the version and build information output generated by profanity -v
Profanity, version 0.7.1dev.master.5d7f2d15
Copyright (C) 2012 - 2019 James Booth <[email protected]>.
Copyright (C) 2019 Michael Vetter <[email protected]>.
License GPLv3+: GNU GPL version 3 or later <https://www.gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Build information:
XMPP library: libstrophe
Desktop notification support: Enabled
OTR support: Disabled
PGP support: Enabled (libgpgme 1.13.1)
OMEMO support: Enabled
C plugins: Enabled
Python plugins: Disabled
GTK icons: Enabled
  • Operating System/Distribution
    FreeBSD 12.1-STABLE r354337 GENERIC amd64
  • glib version
    2.56.3_6,1
help wanted improvement

Most helpful comment

I can reproduce the issue too with release 0.7.1. It is very noticeable when the keyboard repeat speed is high like 60Hz, such as with xset r rate 200 60. This is what perf record sees when pressing an arrow key. It only happens after login:

# To display the perf.data header info, please use --header/--header-only options.
#
#
# Total Lost Samples: 0
#
# Samples: 3K of event 'cycles:u'
# Event count (approx.): 737337445
#
# Overhead  Command    Shared Object            Symbol                             
# ........  .........  .......................  ...................................
#
    13.02%  profanity  libncursesw.so.6.1       [.] pnoutrefresh
     4.52%  profanity  libglib-2.0.so.0.6200.4  [.] g_hash_table_lookup
     4.45%  profanity  libc-2.30.so             [.] __GI___strcmp_ssse3
     2.69%  profanity  libglib-2.0.so.0.6200.4  [.] g_str_hash
     2.20%  profanity  libncursesw.so.6.1       [.] werase
     1.96%  profanity  libc-2.30.so             [.] malloc
     1.92%  profanity  libc-2.30.so             [.] __vfprintf_internal
     1.89%  profanity  libc-2.30.so             [.] _int_free
     1.87%  profanity  libncursesw.so.6.1       [.] _nc_hash_map_sp
     1.81%  profanity  libc-2.30.so             [.] _int_malloc
     1.43%  profanity  libc-2.30.so             [.] __dcigettext
     1.36%  profanity  libc-2.30.so             [.] wcwidth
     1.30%  profanity  libglib-2.0.so.0.6200.4  [.] g_slice_free1
     1.28%  profanity  libc-2.30.so             [.] __strchrnul_sse2
     1.22%  profanity  profanity                [.] autocomplete_reset
     1.22%  profanity  libc-2.30.so             [.] __memcpy_ssse3
     1.19%  profanity  libncursesw.so.6.1       [.] _nc_waddch_nosync
     1.14%  profanity  libc-2.30.so             [.] cfree@GLIBC_2.2.5
     1.00%  profanity  libc-2.30.so             [.] __tfind

All 2 comments

Right, happens to me too. Don't know yet why.
In the meantime just use your Pos1 key ;)

@pasis do you see why this happens?

I can reproduce the issue too with release 0.7.1. It is very noticeable when the keyboard repeat speed is high like 60Hz, such as with xset r rate 200 60. This is what perf record sees when pressing an arrow key. It only happens after login:

# To display the perf.data header info, please use --header/--header-only options.
#
#
# Total Lost Samples: 0
#
# Samples: 3K of event 'cycles:u'
# Event count (approx.): 737337445
#
# Overhead  Command    Shared Object            Symbol                             
# ........  .........  .......................  ...................................
#
    13.02%  profanity  libncursesw.so.6.1       [.] pnoutrefresh
     4.52%  profanity  libglib-2.0.so.0.6200.4  [.] g_hash_table_lookup
     4.45%  profanity  libc-2.30.so             [.] __GI___strcmp_ssse3
     2.69%  profanity  libglib-2.0.so.0.6200.4  [.] g_str_hash
     2.20%  profanity  libncursesw.so.6.1       [.] werase
     1.96%  profanity  libc-2.30.so             [.] malloc
     1.92%  profanity  libc-2.30.so             [.] __vfprintf_internal
     1.89%  profanity  libc-2.30.so             [.] _int_free
     1.87%  profanity  libncursesw.so.6.1       [.] _nc_hash_map_sp
     1.81%  profanity  libc-2.30.so             [.] _int_malloc
     1.43%  profanity  libc-2.30.so             [.] __dcigettext
     1.36%  profanity  libc-2.30.so             [.] wcwidth
     1.30%  profanity  libglib-2.0.so.0.6200.4  [.] g_slice_free1
     1.28%  profanity  libc-2.30.so             [.] __strchrnul_sse2
     1.22%  profanity  profanity                [.] autocomplete_reset
     1.22%  profanity  libc-2.30.so             [.] __memcpy_ssse3
     1.19%  profanity  libncursesw.so.6.1       [.] _nc_waddch_nosync
     1.14%  profanity  libc-2.30.so             [.] cfree@GLIBC_2.2.5
     1.00%  profanity  libc-2.30.so             [.] __tfind
Was this page helpful?
0 / 5 - 0 ratings