Comments (13)
autocomplete-plus calls autocomplete-paths every 100ms or every keystroke, whichever has a longer interval.
You are correct that autocomplete-paths could be much more intelligent about caching the information about the filesystem related to the current editor, and in doing so become more performant. It should also be updated to build suggestions asynchronously and use async fs
functions instead of the sync equivalents it currently uses.
The combination of these changes would provide a significant performance improvement, and need to be done. Im happy to accept PRs, until @park9140 or I have the time to make these changes.
from autocomplete-paths.
Duplicated issues (author can easy close them): #83 , #95 , #91 , #84 , #71
And track all progress in this single issue.
Maybe someone can help us fix the lags? i'll try soon, but i'm not sure that i'm capable to fix that.
My screenshot/record 22s! (i7 4790K + SSD):
🔥 🚒
Also it's easy to reproduce, save file with that content, and try to edit something after href attribute:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<a href="https://github.com/atom/autocomplete-plus/" ENTER SOMETHING HERE></a>
</body>
</html>
from autocomplete-paths.
2.0.0 provides a much better experience, as it indexes the project on startup and does incremental index updates when something inside the project changes.
from autocomplete-paths.
Having looked into how autocomplete-paths works, it looks like total the number of files should have no impact, but number of files within the current folder should.
However there are only 12 files in the current directory. I am not using a SSD though, and autocomplete-paths looks to make x+2 fs
calls (where x is the number of files in the current directory) on each call to findSuggestionsForPrefix
. I'm not sure how often autocomplete-plus calls autocomplete-paths; could these fs
calls be related?
from autocomplete-paths.
I experience huge performance hits when I have this package enabled too. I have an SSD and my project is only about 10 files. The problem seems to lie in fs.statSync
and not in this package. Maybe moving to an async fs.stat
would help, even if data could be out of date.
from autocomplete-paths.
@joefitzgerald, @dannyfritz is right about the performance problem. fs.statSync
locks the worker thread until the file access is done. Now that we have async you can probably solve 100% of performance issues with this by calling fs.stat
.
Threw together a quick example of what would need to happen in order to make this async in #53 if anyone wants to finish it.
from autocomplete-paths.
I went ahead and poked around with it. (Thanks for the starting point @park9140 👍) I was getting really frustrated with debugging coffeescript so I converted it to JS and proceeded from there. And because of that, I can't really show a clean diff between the 2. And it probably can't get merged in directly without someone first interpreting it as CoffeeScript.
My JS Async Version: dannyfritz@d0e7962
But, the main problem was that it was attempting to do fs.statSync
on URL's and other invalid directories that would timeout after ~20 seconds. So the editor would be frozen on that for a while waiting for the timeout. Just making this 1 call async appears to solve it for me:
With this async version, the timeouts eventually just reject the Promise and nobody is the wiser. And you can continue typing as it times out.
from autocomplete-paths.
@dannyfritz, I'm totally with you on the coffeescript thing. I was really bad at it at first. http://js2.coffee/ This tool made things alot easier. Allows you to see kind of what it should look like in coffeescript then you can clean up with the coffee linter after that.
from autocomplete-paths.
@park9140 thanks for the link. The next time someone asks me why I dislike coffescript, all I have to do is point them there. The example that they have is clearly demonstrating it. Great stuff
from autocomplete-paths.
Also experienced performance issues. As this is really annoying it should really be fixed in the next time.
I've uploaded a JSON file of the timeline created with the Chromium dev tools, here: https://gist.github.com/rugk/d672a1c1f364a175caa2
from autocomplete-paths.
I don't mean this as a jest or anything negative, but I have moved to this other package to autocomplete paths: https://atom.io/packages/autocomplete-modules
from autocomplete-paths.
(Relates to issue #71)
from autocomplete-paths.
@saschagehlich - How can we download 2.0? I work on Magento projects using docker. All projects are around 60k files so I'm literally not even able to work with 1.19.6 and have to switch if I can't get ahold of a fix
from autocomplete-paths.
Related Issues (20)
- backslash prefix space in file name
- Is there an analogue of this plugin in VSCode? HOT 4
- How to use autocomplete paths with scss mixins ?
- When editing a .js file, a paths to .vue files are not autocompleted (missing from default-scopes.js)
- Rebuilding cache when modify or create a file HOT 1
- Uncaught TypeError: Cannot read property 'fileCount' of null
- Not working within a .vue file :( HOT 1
- Running the cache collection in a WebWorker/WorkerThread HOT 4
- Improve default scopes HOT 4
- failed to enable package in atom on Ubuntu 20.04 HOT 12
- Tabnine disables autocomplete-paths
- This repo will transfer to atom-ide-community HOT 1
- `exec("find", ["--version"])` not working with Atom from the Electron 9 PR HOT 4
- it doesn't read css directory payh just js directory path HOT 2
- Newly added files are not offered in autocomplete HOT 1
- Can't install or upgrade HOT 10
- Find the best path watcher
- Duplicate autocomplete suggestions with atom-typescript HOT 1
- autocomplete-paths HTML src not working
- This package breaks the autocompletion HOT 1
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 autocomplete-paths.