Community
Participate
Working Groups
Build Identifier: 20110218-0911 I have a workspace with round about 100 java-projects some of them have contain over 5000 files. If I invoke the refresh-command on one of these projects it more than a minute to complete. I started to profile my eclipse and found that the org.eclipse.core.internal.filesystem.local.LocalFileNatives#nativeAttributes consumes a lot time. I don't know if this is only related to Windows 7 (32bit). When I replace the dll by an unloadable dummy to force eclipse to not use the native call everything is fine. Linux doesn't seem to have a problem. Since the function is not invoked with any parameter would it be possible to cache the result? For me this make eclipse nearly unusable since every time a builder/external tool needs to refresh a project i have to wait. Having 100 project it tooks up to an hour to refresh the whole workspace. Reproducible: Always Steps to Reproduce: 1. Make sure the local_file_1_0_0.dll exists and your system is Windows 7 2. Create a project with over 5000 files (including svn-files) 3. Select the project and invoke refresh --- 4. replace the dll by a dummy implementation which returns false in dllmain or change LocalFileNatives#isUsingNatives to return "false" 5. refresh again and see that it is much faster
We should certainly be able to cache the result of calling nativeAttributes. I can't see any reason to call that more than once per Eclipse session.
Created attachment 204879 [details] Patch v1
Wow, that goes fast. Many thanks. Heiko
(In reply to comment #3) > Wow, that goes fast. Many thanks. > Heiko Heiko, have you already tested the fix?
John, can you review this patch for me?
This is close, but note the nativeAttributes method doc: * This is an optional method: if it has not been compiled * into the native library, the client must catch the * resulting UnsatisfiedLinkError In your patch it will log an error message which will be confusing. This particular UnsatisfiedLinkError should be handled silently (the case where the library is present, but is missing this one function).
Created attachment 205401 [details] Patch v2 Corrected patch to handle silently UnsatisfiedLinkError from #nativeAttributes().
Looks good Szymon. Feel free to release this.
Thanks John! Fixed in master.