Introduce faster file refresh on Linux (x86_64 only for now)#2793
Merged
iloveeclipse merged 2 commits intoJul 3, 2026
Conversation
This was referenced Jul 2, 2026
0c9eb36 to
f148fa8
Compare
There was a problem hiding this comment.
Pull request overview
This PR introduces a Linux x86_64–specific “fast” native path for directory listing + bulk IFileInfo retrieval to significantly speed up refresh/file access on NFS, with a system property to disable the fast natives and fall back to the existing behavior.
Changes:
- Add a new Linux-specific native implementation (
fastlinuxfile_1_0_0) and corresponding Java JNI layer to fetch directory entries + file infos in one call. - Update native handler selection to prefer the fast Linux path on Linux x86_64 (configurable via
eclipse.filesystem.useFastLinuxNatives). - Extend performance benchmarks and bump test/fragment versions to reflect the new functionality.
Reviewed changes
Copilot reviewed 15 out of 16 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/perf/BenchFileStore.java | Adds Linux-fast-native benchmark variants (needs platform guarding). |
| resources/tests/org.eclipse.core.tests.resources/pom.xml | Version bump for test bundle. |
| resources/tests/org.eclipse.core.tests.resources/META-INF/MANIFEST.MF | Version bump for test bundle. |
| resources/bundles/org.eclipse.core.filesystem/src/org/eclipse/core/internal/filesystem/local/unix/UnixFileNatives.java | Refactors constant usage to static imports; no functional change intended. |
| resources/bundles/org.eclipse.core.filesystem/src/org/eclipse/core/internal/filesystem/local/unix/StructStat.java | Simplifies StructStat fields and toFileInfo() for the Unix native path. |
| resources/bundles/org.eclipse.core.filesystem/src/org/eclipse/core/internal/filesystem/local/LocalFileNativesManager.java | Adds fast-Linux-native selection + new disable property; routes to Linux handler on Linux x86_64. |
| resources/bundles/org.eclipse.core.filesystem/src/org/eclipse/core/internal/filesystem/local/linux/LinuxStructStat.java | New Linux-only stat struct mirror used for bulk directory listing JNI. |
| resources/bundles/org.eclipse.core.filesystem/src/org/eclipse/core/internal/filesystem/local/linux/LinuxFileNatives.java | New JNI wrapper that loads fastlinuxfile_1_0_0 and exposes bulk listing + stat operations. |
| resources/bundles/org.eclipse.core.filesystem/src/org/eclipse/core/internal/filesystem/local/linux/LinuxFileHandler.java | New NativeHandler implementation delegating to LinuxFileNatives. |
| resources/bundles/org.eclipse.core.filesystem/src/org/eclipse/core/internal/filesystem/local/linux/LinuxFileFlags.java | New Linux flag resolver populated via JNI getFlag. |
| resources/bundles/org.eclipse.core.filesystem/natives/unix/fastlinux/Makefile | Build script for the fast Linux native library (install target path is currently incorrect). |
| resources/bundles/org.eclipse.core.filesystem/natives/unix/fastlinux/fastlinuxfile.h | JNI header and helper prototypes for the fast Linux native library. |
| resources/bundles/org.eclipse.core.filesystem/natives/unix/fastlinux/fastlinuxfile.c | Native implementation for fast directory enumeration + bulk stat collection. |
| resources/bundles/org.eclipse.core.filesystem.linux.x86_64/pom.xml | Builds and packages the new fast Linux native library into the x86_64 fragment. |
| resources/bundles/org.eclipse.core.filesystem.linux.x86_64/META-INF/MANIFEST.MF | Version bump and updated host-version range for the fragment. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
The code is supposed to speed up NFS file access on Linux by an order of magnitude by fetching directory children data (IFileInfo) in one shot from JNI (via array of StructStat). LocalFile.childInfos(int, IProgressMonitor) overrides now the FileStore.childInfos(int, IProgressMonitor) and calls (on Linux) LinuxFileHandler.listDirectoryAndGetFileInfos() which forwards to faster native implementation in LinuxFileNatives.listDirectoryAndGetFileInfos(). - Introduced new libfastlinuxfile_1_0_0 library for x86_64 Linux architecture (which can be also built on other Linux architectures). - Created dedicated Linux specific package org.eclipse.core.internal.filesystem.local.linux - removed Mac code paths from new code to simplify Linux port - Added system property to disable new binary if needed via "-Declipse.filesystem.useFastLinuxNatives=false"
f148fa8 to
8f4ede3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The code is supposed to speed up NFS file access on Linux by an order of magnitude by fetching directory children data (IFileInfo) in one shot from JNI (via array of StructStat).
LocalFile.childInfos(int, IProgressMonitor) overrides now the FileStore.childInfos(int, IProgressMonitor) and calls (on Linux) LinuxFileHandler.listDirectoryAndGetFileInfos() which forwards to faster native implementation in
LinuxFileNatives.listDirectoryAndGetFileInfos().
-Declipse.filesystem.useFastLinuxNatives=false.I've measured data with the extra patch to trace the refresh data from Eclipse : #2792 on RHEL 9.6.
To drop local FS caches, I've used
sync && echo 3 | sudo tee /proc/sys/vm/drop_caches.Unfortunately this doesn't drop NFS server file caches, but interestingly, I couldn't see any caching effect on the NFS results for the old code anyway. Only new code is affected by the NFS server cache and produces sometimes NFS times comparable to the local FS performance.
Script below was used to create test directory structure with 50 folders a 5000 files each (250.000 files) used for performance tests above. Just create shell script and run it inside a project.