Comments (42)
These buffers are indeed used when emacs-eclim calls eclipse asynchronously. I tried to ensure that the buffers are reused as much as possible, but maybe that's not working. How many buffers do you typically have?
from emacs-eclim.
I have to test this a bit more, but sometimes up to eight. Is it possible to delay the completion, while typing? I rather want the completion to start when idle, or when I hit C-return only. Otherwise Emacs gets very laggy, because it is constantly trying to complete using eclim, which seems to be a bit costly.
from emacs-eclim.
I did some further research on the performance issue: Whenever I save my buffer in Emacs, Eclipse rebuilds the current project. Is that an Eclim feature, or rather an Eclipse thing? Because that's where the performance goes. I guess if this were not the case, I wouldn't get so many async buffers either. Compilation takes a while, since the project is large and we use a custom build tool...
from emacs-eclim.
And one more thing: I found it, my Eclipse was set to "Build automatically". :)
I will try to keep an eye on the async buffers, but performance went massively up. :)
from emacs-eclim.
Every time you save (or remove) a java file, emacs-eclim tells Eclipse to refresh that file, which will usually trigger a compilation. It shouldn't rebuild the whole project though, just the changed file.
I've been thinking it might be best just to discard the async buffers when we're done with them. I decided to keep them around as I was unsure how costly creating new buffers are.
from emacs-eclim.
Question: can't you use temp-buffers? Or is that not possible because of the async calls?
from emacs-eclim.
I just checked: right now I had 22 old eclim-async buffers open. Our project is huge, and generates quite a few warnings (deprecated function calls etc). So each buffer was 750KB in size (mainly the warnings output). This slows down auto-completion significantly, so I disabled auto-build in Eclipse. After that, I get only a few async buffers.
from emacs-eclim.
We can't use with-temp-buffers
due to the asynchronous communication (as you noted).
I've made an experimental branch in my own repo where we don't reuse the async buffers, instead killing them when we're done. Could you have a look at b7b04aa and see if it's any help to you?
from emacs-eclim.
Testing your commit right now. Will report back when I have used it for some hours. Over night the async buffers grew to 160 (750kB each). :) So I guess it will definitely help. Maybe we can make the re-use behaviour optional, by introducing a defcustom boolean.
from emacs-eclim.
I would advise against customize options, which change internal behavior. It's very hard for users to decide if they want to use some internal stuff for optimizations, when they don't know the problems it could cause. I hope we find a solution to keep the tmp buffers down, which works in all circumstances.
from emacs-eclim.
Seems fine. So far I haven't experienced any problems. Performance is good. Emacs/Eclim is only getting slow when a syntax check is performed. As mentioned above, our project generates thousands of warnings, and this stalls Emacs for about 10 seconds. Is it possible to disable syntax checks and/or do them on demand?
from emacs-eclim.
I stand corrected: even with the change, I now have a problem of leftover buffers. I started typing something, completion went up, and the I left my computer. When I came back, Emacs was busy at 100% CPU, and I had 25 async buffers. I guess there is some idle stuff going on, even during completion? This was while using the ac-complete-emacs-eclim-* functions.
from emacs-eclim.
It could be that while eclipse is compiling, emacs makes additional calls which are then queued. How large is your project? The one I'm working on is ~3500 classes spread over 12 maven modules. It's a bit slow, but definitely workable.
You could try (setq eclim-print-debug-messages t)
, which makes eclim print out every call it makes to eclipse in the messages buffer. That way we might be able to see what's going on.
from emacs-eclim.
9965 source files (i.e. roughly the same number of classes). I will try to gather some debug output, as soon as I have some spare time.
from emacs-eclim.
I anonymized the debug output, it looks like this:
Completion started at 4046, ac-point is 4046
Saving file MyClass.java...
Wrote MyClass.java
Executing: ~/bin/eclipse/eclim -command ping
Executing: ~/bin/eclipse/eclim -command java_src_update -p my.project -f MyClass.java
Executing: ~/bin/eclipse/eclim -command java_complete -p my.project -f MyClass.java -e iso-8859-1 -l standard -o 4045
Completion started at 4051, ac-point is 4046
Saving file MyClass.java...
Wrote MyClass.java
Executing: ~/bin/eclipse/eclim -command ping
Executing: ~/bin/eclipse/eclim -command java_src_update -p my.project -f MyClass.java
Executing: ~/bin/eclipse/eclim -command java_complete -p my.project -f MyClass.java -e iso-8859-1 -l standard -o 4050
Completion started at 4050, ac-point is 4046
Saving file MyClass.java...
Wrote MyClass.java
Executing: ~/bin/eclipse/eclim -command ping
Executing: ~/bin/eclipse/eclim -command java_src_update -p my.project -f MyClass.java
Executing: ~/bin/eclipse/eclim -command java_complete -p my.project -f MyClass.java -e iso-8859-1 -l standard -o 4048
Completion started at 4048, ac-point is 4046
Saving file MyClass.java...
Wrote MyClass.java
Executing: ~/bin/eclipse/eclim -command ping
Executing: ~/bin/eclipse/eclim -command java_src_update -p my.project -f MyClass.java
Executing: ~/bin/eclipse/eclim -command java_complete -p my.project -f MyClass.java -e iso-8859-1 -l standard -o 4047
Completion started at 4045, ac-point is 4033
Saving file MyClass.java...
Wrote MyClass.java
Executing: ~/bin/eclipse/eclim -command ping
Executing: ~/bin/eclipse/eclim -command java_src_update -p my.project -f MyClass.java
Executing: ~/bin/eclipse/eclim -command java_complete -p my.project -f MyClass.java -e iso-8859-1 -l standard -o 4044
What I did was that I started typing somewhere in the code. After the first character, Emacs hangs for several seconds, and then returns with the autocompletion. I am not sure which step is the costly one, but what I noticed is (as I said before) that my eclim-async buffers are about 750kb each. And especially when I go away and come back, there will be dozens of buffers running, which are eventually killed, but which make Emacs unresponsive.
from emacs-eclim.
This looks like a loop problem within emacs-eclim. It seems that the 4 commands result in an endless loop.
from emacs-eclim.
Not sure about that. I just typed a couple of characters before. When I type only one character, I get this:
Completion started at 3349, ac-point is 3349
Saving file MyClass.java...
Wrote MyClass.java
Executing: ~/bin/eclipse/eclim -command ping
Executing: ~/bin/eclipse/eclim -command java_src_update -p my.project -f MyClass.java
Executing: ~/bin/eclipse/eclim -command java_complete -p my.project -f MyClass.java -e iso-8859-1 -l standard -o 3348
And it still takes 5-10 seconds for Emacs to respond.
from emacs-eclim.
Now I have the debug output for when I go away and/or switch to some C++ buffers in between:
Executing: ~/bin/eclipse/eclim -command project_list
refreshing... MyClass.java
Using async buffer *eclim-async*<2>
Executing: ~/bin/eclipse/eclim -command problems -p my.project
refreshing... MyClass.java
Using async buffer *eclim-async*<3>
Executing: ~/bin/eclipse/eclim -command problems -p my.project
refreshing... MyClass.java
Using async buffer *eclim-async*<4>
Executing: ~/bin/eclipse/eclim -command problems -p my.project
refreshing... MyClass.java
Using async buffer *eclim-async*<5>
Executing: ~/bin/eclipse/eclim -command problems -p my.project
refreshing... MyClass.java
Using async buffer *eclim-async*<6>
Executing: ~/bin/eclipse/eclim -command problems -p my.project
refreshing... MyClass.java
Using async buffer *eclim-async*<7>
Executing: ~/bin/eclipse/eclim -command problems -p my.project
refreshing... MyClass.java
Using async buffer *eclim-async*<8>
Executing: ~/bin/eclipse/eclim -command problems -p my.project
refreshing... MyClass.java
Using async buffer *eclim-async*<9>
Executing: ~/bin/eclipse/eclim -command problems -p my.project
refreshing... MyClass.java
Using async buffer *eclim-async*<10>
Executing: ~/bin/eclipse/eclim -command problems -p my.project
refreshing... MyClass.java
Using async buffer *eclim-async*<11>
Executing: ~/bin/eclipse/eclim -command problems -p my.project
refreshing... MyClass.java
Using async buffer *eclim-async*<12>
Executing: ~/bin/eclipse/eclim -command problems -p my.project
refreshing... MyClass.java
Using async buffer *eclim-async*<13>
Executing: ~/bin/eclipse/eclim -command problems -p my.project
refreshing... MyClass.java
Using async buffer *eclim-async*<14>
Executing: ~/bin/eclipse/eclim -command problems -p my.project
refreshing... MyClass.java
Using async buffer *eclim-async*<15>
Executing: ~/bin/eclipse/eclim -command problems -p my.project
refreshing... MyClass.java
Using async buffer *eclim-async*<16>
Executing: ~/bin/eclipse/eclim -command problems -p my.project
refreshing... MyClass.java
Using async buffer *eclim-async*<17>
Executing: ~/bin/eclipse/eclim -command problems -p my.project
refreshing... MyClass.java
Using async buffer *eclim-async*<18>
Executing: ~/bin/eclipse/eclim -command problems -p my.project
refreshing... MyClass.java
Using async buffer *eclim-async*<19>
Executing: ~/bin/eclipse/eclim -command problems -p my.project
refreshing... MyClass.java
Using async buffer *eclim-async*<20>
Executing: ~/bin/eclipse/eclim -command problems -p my.project
Executing: ~/bin/eclipse/eclim -command project_list [18 times]
Eclim reports 8 errors, 1355 warnings.
Executing: ~/bin/eclipse/eclim -command project_list
Eclim reports 8 errors, 1355 warnings.
Executing: ~/bin/eclipse/eclim -command project_list
Eclim reports 8 errors, 1355 warnings.
Executing: ~/bin/eclipse/eclim -command project_list
Eclim reports 8 errors, 1355 warnings.
Executing: ~/bin/eclipse/eclim -command project_list
Eclim reports 8 errors, 1355 warnings.
Executing: ~/bin/eclipse/eclim -command project_list
Eclim reports 8 errors, 1355 warnings.
Executing: ~/bin/eclipse/eclim -command project_list
Eclim reports 8 errors, 1355 warnings.
Executing: ~/bin/eclipse/eclim -command project_list
Eclim reports 8 errors, 1355 warnings.
Executing: ~/bin/eclipse/eclim -command project_list
Eclim reports 8 errors, 1355 warnings.
Executing: ~/bin/eclipse/eclim -command project_list
Eclim reports 8 errors, 1355 warnings.
Executing: ~/bin/eclipse/eclim -command project_list
Eclim reports 8 errors, 1355 warnings.
Executing: ~/bin/eclipse/eclim -command project_list
Eclim reports 8 errors, 1355 warnings.
Executing: ~/bin/eclipse/eclim -command project_list
Eclim reports 8 errors, 1355 warnings.
Executing: ~/bin/eclipse/eclim -command project_list
Eclim reports 8 errors, 1355 warnings.
Executing: ~/bin/eclipse/eclim -command project_list
Eclim reports 8 errors, 1355 warnings.
Executing: ~/bin/eclipse/eclim -command project_list
Eclim reports 8 errors, 1355 warnings.
Executing: ~/bin/eclipse/eclim -command project_list
Eclim reports 8 errors, 1355 warnings.
Executing: ~/bin/eclipse/eclim -command project_list
Eclim reports 8 errors, 1355 warnings.
Executing: ~/bin/eclipse/eclim -command project_list
Eclim reports 8 errors, 1355 warnings.
This really blocks Emacs for quite a long time...
from emacs-eclim.
I guess emacs-eclim keeps calling eclim over and over while eclipse is busy building the project. I've added some experimental performance tweaks to try and keep track of the currently running calls in order to avoid making the same one again. Please have a look at https://github.com/fred-o/emacs-eclim/commits/no-pooling-of-async-buffers and see if it helps.
I've also changed the behaviour of the problems list; if your are filtering on 'errors' emacs-eclim will now only fetch the errors, which cuts down on the amount of data we need to transfer and parse quite a bit.
from emacs-eclim.
I just checked it out and will test it for a couple of hours. I'll probably report back tomorrow. As for a quick test, it feels quite snappy. But let me code for a while and see how it fares.
from emacs-eclim.
Performance seems vastly improved. Sometimes I have to wait a bit still, but that's when Eclipse has to rebuild lots of subprojects. I guess that is ok.
from emacs-eclim.
One problem that I still see: After a morning of work, I now had 140 leftover buffers... :-/ However, they were all empty. Performance ist definitely better, though.
from emacs-eclim.
There was a bug that caused buffers to be created even if no call was made. Should be fixed now.
from emacs-eclim.
Looks better, so far. Now I only had two async buffers when returning from lunch, both contained: Missing required option: p
.
from emacs-eclim.
Yeah, those are from when an error is raised during the result parsing, I think. I'll need to go through the error handling routines before this is merged into the master branch.
from emacs-eclim.
Fixed that last issue and merged everything into master. I think I'll also have a closer look at the calls we're making; for example it doesn't really seem that necessary to trigger a problem buffer refresh while we're autocompleting.
from emacs-eclim.
I'll check out your master and test it for a while, to see if it works. Thanks.
from emacs-eclim.
It should be pushed to the regular master repo, but it seems github is acting up and won't display it.
from emacs-eclim.
Quick result: Now auto-complete (no output in Messages) does not work anymore, and eclim-project-build gives this:
error in process sentinel: cond: Missing required option: p
error in process sentinel: Missing required option: p
Any ideas?
from emacs-eclim.
Hm... works fine on my end. The 'Missing required option: p' message usually means that emacs-eclim couldn't figure out which project the current file belonged to. What buffer are you executing eclim-project-build from?
Also, have you restarted emacs since the update?
from emacs-eclim.
Yes, I have restarted Emacs. I am executing eclim-project-build from one of my Java-source-file buffers. Completion doesn't work, neither does eclim-java-find-declaration. That gives an exception in eclim:
cond: org.eclipse.core.runtime.AssertionFailedException: null argument:
at org.eclipse.core.runtime.Assert.isNotNull(Assert.java:85)
at org.eclipse.core.runtime.Assert.isNotNull(Assert.java:73)
at org.eclipse.core.runtime.Path.initialize(Path.java:577)
at org.eclipse.core.runtime.Path.<init>(Path.java:185)
at org.eclipse.core.internal.resources.WorkspaceRoot.getProject(WorkspaceRoot.java:182)
at org.eclim.plugin.core.util.ProjectUtils.getProject(ProjectUtils.java:110)
at org.eclim.plugin.core.util.ProjectUtils.getProject(ProjectUtils.java:96)
at org.eclim.plugin.core.util.ProjectUtils.getFilePath(ProjectUtils.java:130)
at org.eclim.plugin.core.command.AbstractCommand.getOffset(AbstractCommand.java:79)
at org.eclim.plugin.jdt.command.search.SearchCommand.executeSearch(SearchCommand.java:155)
at org.eclim.plugin.jdt.command.search.SearchCommand.execute(SearchCommand.java:112)
at org.eclim.command.Main$1.run(Main.java:98)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3563)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3212)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2701)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2665)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2499)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:679)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:668)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
at org.eclipse.equinox.launcher.Main.main(Main.java:1386)
from emacs-eclim.
I have a hunch that the variable eclim--project-name
has been set to something other for some reason. Could you check the value of that variable when you are in the java buffer?
Also, could you eval the function with the same name?
from emacs-eclim.
C-h v eclim--project-name
:
eclim--project-name is a variable defined in `eclim.el'.
Its value is nil
Local in buffer Foo.java; global value is nil
M-x eval-expression (eclim--project-name)
also returns nil
.
from emacs-eclim.
Hm... I rolled back a couple of revisions, and still get the same behaviour. Could it be that something is wrong with my eclim? Are there any settings that can break / caches that can deteriorate? If so, how can I undo this?
from emacs-eclim.
I reinstalled Eclips & Eclim, deleted ~/.eclim and I deleted my Workspace. Nothing did help. I am currently clueless what is going wrong here. I have now enabled debug information again, and get this upon eclim-project-build
:
Executing: ~/bin/eclipse/eclim -command project_list [3 times]
Executing: ~/bin/eclipse/eclim -command project_build
Using async buffer *eclim-async*
error in process sentinel: cond: Missing required option: p
error in process sentinel: Missing required option: p
When I run eclim -command project_list
on the command line, I get a long JSON answer with all my projects.
from emacs-eclim.
It looks like the java file isn't recognized as belonging to an eclipse project, for some reason. Is the .project file missing from the project root? Emacs-eclim uses this when trying to determine the name of the current project.
Also, what does (eclim/project-list)
and (eclim--project-dir buffer-file-name)
eval to?
from emacs-eclim.
FWIW I just experienced the same thing that you have, when I tried to interact with files belonging to a project that I'd mistakenly deleted from the eclipse workspace.
from emacs-eclim.
First, M-x eval-expression (eclim/project-list)
yields (anonymized):
[((path . "/path_to/my/project") (name . "my_project_name") (open . t)) ((path . "/path_to/my/project") (name . "my_project_name") (open . t)) ((path . "/path_to/my/project") (name . "my_project_name") (open . t)) ((path . "/path_to/my/project") (name . "my_project_name") (open . t)) ((path . "/path_to/my/project") (name . "my_project_name") (open . t)) ((path . "/path_to/my/project") (name . "my_project_name") (open . t)) ((path . "/path_to/my/project") (name . "my_project_name") (open . t)) ((path . "/path_to/my/project") (name . "my_project_name") (open . t)) ((path . "/path_to/my/project") (name . "my_project_name") (open . t)) ((path . "/path_to/my/project") (name . "my_project_name") (open . t)) ((path . "/path_to/my/project") (name . "my_project_name") (open . t)) ((path . "/path_to/my/project") (name . "my_project_name") (open . t)) ...]
And M-x eval-expression (eclim--project-dir buffer-file-name)
yields (anonymized):
"/valid/path/to/one/project/in/workspace"
The path is valid, and I examined it even via ls
.
from emacs-eclim.
PS: each entry in the anonymized list is distinct... I just cannot hand out our project names. ;)
from emacs-eclim.
Allright, I found the error! We have a symlink from the project base to another directory. Eclipse uses that symlink, instead of the "real" path, that I use in Emacs. So your exlim--project-name
function fails, since it does text matching. I recommend that file-truename
should be applied to the paths.
from emacs-eclim.
Kept the new version running for some days, and it seems fine. I'll close the ticket for now.
from emacs-eclim.
Great! I never would have thought about symlinks... :)
from emacs-eclim.
Related Issues (20)
- Suggestion: Integration with Projectile? HOT 3
- Error in post-command-hook (global-eclim-mode-check-buffers): (void-function member-if) HOT 11
- Missing argument for option: n HOT 4
- eclim-run-java-doc fails for multiple projects HOT 1
- Eclim auto completion not working
- Why aren't the pull requests being reviewed? HOT 12
- toggle-maximize-buffer doesn't exist? HOT 2
- Mention new fork of emacs-eclim? HOT 1
- Problem with tramp when using .authinfo.gpg HOT 5
- company-emacs-eclim error: Project 'eclipse' does not have the required nature 'java' HOT 2
- url-insert-file-contents: http://melpa.org/packages/emacs-eclim-20160318.1747.tar: Not found HOT 1
- eclim freezes by auto-save-file HOT 10
- package name not compatible with use-package HOT 1
- Incorrect imports for nested classes when using company autocompletion HOT 1
- cannot open projects HOT 1
- emacs-eclim renamed to eclim in melpa HOT 7
- Directory does not exist: /home/user/eclipse/features HOT 6
- Emacs daemon startup hangs with (require 'eclim) HOT 3
- No "Create type" function? HOT 2
- Could not find or load main class org.test HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from emacs-eclim.