Giter Club home page Giter Club logo

Comments (13)

joefitzgerald avatar joefitzgerald commented on June 3, 2024 1

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.

arturparkhisenko avatar arturparkhisenko commented on June 3, 2024 1

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):
atom-lag 🔥 🚒

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.

saschagehlich avatar saschagehlich commented on June 3, 2024 1

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.

david-byng avatar david-byng commented on June 3, 2024

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.

dannyfritz avatar dannyfritz commented on June 3, 2024

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.
image

from autocomplete-paths.

park9140 avatar park9140 commented on June 3, 2024

@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.

dannyfritz avatar dannyfritz commented on June 3, 2024

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:

stat = fs.statSync(directory)

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.

park9140 avatar park9140 commented on June 3, 2024

@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.

capaj avatar capaj commented on June 3, 2024

@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.

rugk avatar rugk commented on June 3, 2024

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.

dannyfritz avatar dannyfritz commented on June 3, 2024

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.

crazy4groovy avatar crazy4groovy commented on June 3, 2024

(Relates to issue #71)

from autocomplete-paths.

brandontamm avatar brandontamm commented on June 3, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.