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

Vertical movement lags significantly #84

Closed
ararslan opened this issue Nov 7, 2016 · 14 comments
Closed

Vertical movement lags significantly #84

ararslan opened this issue Nov 7, 2016 · 14 comments

Comments

@ararslan
Copy link
Member

ararslan commented Nov 7, 2016

This was brought up a bit in #37. I was not experiencing this issue prior to the introduction of highlighted symbols. Apparently others experienced the same issue, though it they claimed it to be mostly resolved for them. When I hold down j (yes I know that's not proper Vim use), it lags so much that I can't even tell where the cursor will end up.

This may be an upstream issue, in which case feel free to close this, though I figured it'd be good to have this issue available to track the problem.

@carlobaldassi
Copy link
Contributor

I was afraid of this, although I don't experience the issue any more. Can you help me reproduce it/understand it?

  1. Do you have a specific test file where this happens?
  2. Does it happen consistently or is it sporadic? Does it always happen right after opening a file or does it sometimes get triggered after a while?
  3. Vim version, other plugins installed, operating system, CPU, system load...?

(about the last part: it seems unlikely, but I wonder if e.g. it's just that my CPU is faster and I don't notice the lag, I have an Intel i7-4710HQ.)

@ararslan
Copy link
Member Author

ararslan commented Nov 7, 2016

I can get you the versions and stuff later once I get back to my computer, but in the meantime:

  1. The Julia repo, base/linalg/symmetric.jl
  2. It happens consistently for me at any amount of time after opening the file.
  3. OS X 10.11 El Capitan (will get other info later)

I'm not entirely sure how to determine the system load on Mac but I'm sure Google can help with that.

@carlobaldassi
Copy link
Contributor

Good news, I also observe a slight lag in that file, although not dramatic, specifically when these lines are displayed, while it's fine on the other parts of the file. Can you confirm?

@ararslan
Copy link
Member Author

ararslan commented Nov 7, 2016

Will check once I'm at my computer. Thanks for investigating!

@ararslan
Copy link
Member Author

ararslan commented Nov 7, 2016

System info:

  • Vim: NeoVim 0.1.6
  • Plugins (using Vim-Plug):
    • morhetz/gruvbox
    • vim-airline/vim-airline
    • vim-airline/vim-airline-themes
    • JuliaEditorSupport/julia-vim
    • rust-lang/rust.vim
    • cespare/vim-toml
    • tpope/vim-fugitive
    • ararslan/license-to-vim
  • OS: OS X 10.11 El Capitan
  • CPU: 2.3 GHz Intel Core i7
  • CPU load: The iTerm2 process (Activity Monitor doesn't seem to differentiate Vim from iTerm2, at least that I can tell) jumps to about 18% when doing laggy scrolling. Otherwise it stays at 3% or below.

When I scroll through that file, I start to see lag as early as this line.

@bicycle1885
Copy link

bicycle1885 commented Nov 8, 2016

I encounter the same problem. :syntime reports juliaMacroCall, juliaOperator, and juliaSymbol are the major bottlenecks of this lag (Scrolling symmetric.jl from top to bottom takes about 20 seconds for me).

  TOTAL      COUNT  MATCH   SLOWEST     AVERAGE   NAME               PATTERN
 16.016684   8687   512     0.014506    0.001844  juliaMacroCall     \(@[^[:space:])\U5D}^A-^G^N-^_"#$'(,.:;=?@`\U5B{<80>-¡§¨«­¯´¶-¸»¿0-9!+\U2D~¬√∛∜=+\U2D*/\%÷
  3.249490   40807  32828   0.004671    0.000080  juliaOperator      \%(\.\%([-+*/^÷%|&]\|//\|\\\|<<\|>>>\?\)\?=\|[:$<>]=\|||\|&&\||>\|<|\|<:\|:>\|::\|<<\|>>>\?\|//\|[-=]>
  1.543683   18451  10423   0.002287    0.000084  juliaSymbol        \%(^\s*\|\s\{6,\}\|\%([^A-^G^N-^_"#$'(,.:;=?@`\U5B{<80>-¡§¨«­¯´¶-¸»¿+\U2D~¬√∛∜=+\U2D*/\%÷^
  0.576869   7275   736     0.000583    0.000079  juliaDollarVar     \([[:space:])\U5D}^A-^G^N-^_"#$'(,.:;=?@`\U5B{<80>-¡§¨«­¯´¶-¸»¿+\U2D~¬√∛∜=+\U2D*/\%÷^&|⊻
  0.266522   8175   0       0.004470    0.000033  juliaBaseTypeOther0506 \<\%(Future\|RemoteChannel\|IPAddr\|Stack\%(Trace\|Frame\)\|\(Caching\|Worker\)Pool\|AbstractSerializer
  0.260294   19329  11384   0.004224    0.000013  juliaCTransOperator [^[:space:])\U5D}^A-^G^N-^_"#$'(,.:;=?@`\U5B{<80>-¡§¨«­¯´¶-¸»¿+\U2D~¬√∛∜=+\U2D*/\%÷^&|⊻<
  0.209821   21277  13431   0.000756    0.000010  juliaBaseTypeArray \<\%(\%(Sub\)\?Array\|\%(Abstract\|Dense\|Strided\)\?\%(Array\|Matrix\|Vec\%(tor\|OrMat\)\)\|SparseMatr
  0.141799   10618  2443    0.000608    0.000013  juliaBaseTypeBasic \<\%(Tuple\|NTuple\|Symbol\|\%(Intrinsic\)\?Function\|Union\|Type\%(Name\|Constructor\|Var\)\?\|Any\|AN
  0.136757   8175   0       0.003420    0.000017  juliaConstEnv      \<\%(ARGS\|ENV\|CPU_CORES\|OS_NAME\|ENDIAN_BOM\|LOAD_PATH\|VERSION\|JULIA_HOME\)\>
  0.111999   8286   111     0.000496    0.000014  juliaBaseTypeError \<\%(\%(Bounds\|Divide\|Domain\|\%(Stack\)\?Overflow\|EOF\|Undef\%(Ref\|Var\)\|System\|Type\|Parse\|Arg
...

@carlobaldassi
Copy link
Contributor

Thanks, this has been very helpful. I just pushed some commits with a few performance tweaks, can you check that the problem is fixed? (It is for me.)

@bicycle1885
Copy link

Thank you! Now my vim works smoothly and the same benchmark looks much much better:

  TOTAL      COUNT  MATCH   SLOWEST     AVERAGE   NAME               PATTERN
  0.750178   43840  35535   0.000905    0.000017  juliaOperator      \%(\.\%([-+*/^÷%|&]\|//\|\\\|<<\|>>>\?\)\?=\|[:$<>]=\|||\|&&\||>\|<|\|<:\|:>\|::\|<<\|>>>\?\|//\|[-=]>
  0.260856   19762  11467   0.000423    0.000013  juliaCTransOperator [^[:space:])\U5D}^A-^G^N-^_"#$'(,.:;=?@`\U5B{<80>-¡§¨«­¯´¶-¸»¿+\U2D~¬√∛∜=+\U2D*/\%÷^&|⊻<
  0.168620   22402  14204   0.000524    0.000008  juliaBaseTypeArray \<\%(\%(Sub\)\?Array\|\%(Abstract\|Dense\|Strided\)\?\%(Array\|Matrix\|Vec\%(tor\|OrMat\)\)\|SparseMatr
  0.143376   11189  2662    0.000201    0.000013  juliaBaseTypeBasic \<\%(Tuple\|NTuple\|Symbol\|\%(Intrinsic\)\?Function\|Union\|Type\%(Name\|Constructor\|Var\)\?\|Any\|AN
  0.123030   715    0       0.000832    0.000172  juliaSymbolS       \%([])}[:space:]]\)\@1<=:\%([^[:space:])\U5D}^A-^G^N-^_"#$'(,.:;=?@`\U5B{<80>-¡§¨«­¯´¶-¸»¿0-9!+\U2
  0.114922   8527   0       0.000870    0.000013  juliaBaseTypeIO    \<\%(IO\%(Stream\|Buffer\)\?\|RawFD\|StatStruct\|DevNull\|FileMonitor\|PollingFileWatcher\|Timer\|Base6
  0.107726   8638   111     0.000198    0.000012  juliaBaseTypeError \<\%(\%(Bounds\|Divide\|Domain\|\%(Stack\)\?Overflow\|EOF\|Undef\%(Ref\|Var\)\|System\|Type\|Parse\|Arg
  0.094909   12029  3708    0.000212    0.000008  juliaBaseTypeNum   \<\%(U\?Int\%(8\|16\|32\|64\|128\)\?\|Float\%(16\|32\|64\)\|Complex\%(32\|64\|128\)\?\|Bool\|Char\|Numb
  0.090811   7487   736     0.000251    0.000012  juliaDollarVar     \([[:space:])\U5D}^A-^G^N-^_"#$'(,.:;=?@`\U5B{<80>-¡§¨«­¯´¶-¸»¿+\U2D~¬√∛∜=+\U2D*/\%÷^&|⊻
  0.077394   8527   0       0.000405    0.000009  juliaConstNum      \<\%(NaN\%(16\|32\|64\)\?\|Inf\%(16\|32\|64\)\?\|eu\?\|pi\|π\|eulergamma\|γ\|catalan\|φ\|golden\)\>
  0.075040   8527   0       0.000217    0.000009  juliaConstEnv      \<\%(ARGS\|ENV\|CPU_CORES\|OS_NAME\|ENDIAN_BOM\|LOAD_PATH\|VERSION\|JULIA_HOME\)\>
  0.074881   8527   0       0.000254    0.000009  juliaBaseTypeOther \<\%(RemoteRef\|Task\|Condition\|VersionNumber\|IPv[46]\|SerializationState\|WorkerConfig\)\>

@ararslan
Copy link
Member Author

ararslan commented Nov 9, 2016

This is great, thanks so much @carlobaldassi! It's much, much better now. I experience some very minor cursor flashing, but it's hardly noticeable overall.

@ararslan ararslan closed this as completed Nov 9, 2016
@albinahlback
Copy link

albinahlback commented Oct 2, 2024

I experience the same issue on Neovim v0.10.1. It does not happen immediately, but rather when I have edited the file. After a few edits, I have to reopen the file again, which is very annoying. Let me know if you'd like me to provide more information.

Edit: Perhaps not, I'll go through my plugin list again and check if julia-vim is actually to blame.

Edit 2: Yes, I believe I was correct. With only Vundle, Gruvbox and Julia-Vim loaded, I get the same issue.

@ararslan
Copy link
Member Author

ararslan commented Oct 2, 2024

@albinahlback, thanks for the report. To confirm, you do not experience any lag when moving through a file in normal mode (e.g. by holding down j as in the OP) after opening a file, but you do experience lag using the same movement over the same region(s) of the file after you've made changes? Does it change based on whether you've written your changes to disk?

@albinahlback
Copy link

Okay, I think I have a MWE. In Nemo.jl, open src/flint/fmpq_poly.jl and search for ZZRingElem. Then try to scroll down with j. Perhaps it is related to searches.

My CPU is i5 6300U (i.e. not that strong or modern), and my keyboard speed is quite fast (on Linux, I set it through xset r rate 220 50), both probably exaggerating the issue.

@ararslan
Copy link
Member Author

ararslan commented Oct 5, 2024

I actually just observed this today as well in the Julia repo, stdlib/REPL/test/replcompletions.jl, scrolling with the laptop's trackpad with search results highlighted. Trackpad scrolling is smooth without the search, so I think you're right that it's related to searches. Do you want to open a separate issue for that?

@albinahlback
Copy link

Sure, opened #318.

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

No branches or pull requests

4 participants