artur-shaik / vim-javacomplete2

DEPRECATED in favor of jc.nvim
Vim License
973 stars 83 forks source link

Really slow java file opening time #333

Closed deskwebs closed 7 years ago

deskwebs commented 7 years ago

Actual behavior (Required!)

time java -cp javavi/target/classes:javavi_log4j-api.jar:javavi_log4jar:javaparser.jar kg.ash.javavi.Javavi -version gives me: 2.3.7.3 real 0m5.753s user 0m1.375s sys 0m0.107s

nvim --startuptime profile1.log Test.java gives me:

...
801.845  000.275  000.275: sourcing /Users/deskwebs/.local/share/nvim/plugged/vim-javacomplete2/autoload/javacomplete/server.vim

6810.870  000.121  000.121: sourcing /Users/deskwebs/.local/share/nvim/plugged/vim-javacomplete2/autoload/javacomplete/version.vim

server.vim to version.vim takes a long time and most likely:

7167.550 6367.479: opening buffers

This plugin causes about 7~10s delay on average.

Expected behavior (Required!)

Should be a lot faster than the time above.

The steps to reproduce actual behavior (Required!)

  1. Tried installing maven and compiling it (which succeeded using mvn compile within javavi folder with POM file) but I cannot compile the server. It gives me this error:
Error detected while processing function <SNR>16_JobNeoVimResponseHandler[3]..javacomplete#server#Compila
tionJobHandler:
line   10:

POM file "/Users/deskwebs/.local/share/nvim/plugged/vim-javacomplete2/libs/javavi//pom.xml" specified with the
 -f/--file command line argument does not exist
  1. https://github.com/artur-shaik/vim-javacomplete2/issues/326

cleared ~/.m2/repository (and ~/.gradle/caches) but still having the issue

  1. https://github.com/artur-shaik/vim-javacomplete2/issues/267

Tried JCserverEnableDebug / JCServerLog, JCServerLog gives me:

could not open socket, try again
Error detected while processing function javacomplete#server#GetLogContent:
line   14:
E484: Can't open file
  1. https://github.com/artur-shaik/vim-javacomplete2/issues/328

Tried starting server, no message on console, when trying to terminate shows this error:

Error detected while processing function javacomplete#server#Terminate[1]..<SNR>63_Poll:
line    2:
E492: Not an editor command: JavacompletePy << EOPC
line    3:
E488: Trailing characters: try:
"poll())" [New File]
Cannot open file "poll())"
line    4:
E480: No match: command("let value = '%d'" % bridgeState
line    5:
E492: Not an editor command: except:
line    6:
E488: Trailing characters:   # we'll get here if the bridgeState variable was not defined or if it's None
.
line    7:
E488: Trailing characters:   # In this case we stop the processing and return the default 0 value.
line    8:
E492: Not an editor command:   pass
...

Config

autocmd FileType java setlocal omnifunc=javacomplete#Complete
let g:JavaComplete_ShowExternalCommandsOutput = 1

Environment (Required!)

Q&A