Git Product home page Git Product logo

Comments (6)

tsufeki avatar tsufeki commented on May 27, 2024 1

@xiaohuilam swoole looks nice, but I don't want to require users to compile the extension themselves.

@trahibidadido I released 0.4.0, there are some performance-related improvements, your case should be fixed.

from tenkawa-php-language-server.

tsufeki avatar tsufeki commented on May 27, 2024

Do you mean the time to show the autocompletion dropdown? vscode seems to wait for responses from all servers before displaying anything, and tenkawa's semantic completion is pretty slow (especially in big projects with a lot of dependencies). I'm trying to come up with ideas to improve it, but this is somewhat difficult problem, sorry. One thing to make sure is if indexing has finished (the popup "Indexing files..." disappeared).

from tenkawa-php-language-server.

xiaohuilam avatar xiaohuilam commented on May 27, 2024

This issue, i think, is about the project's protocol structures.

PHP is a synchronized language, it means when a request (sort of, maybe not correctly at all) is under processing, in this thread, it can not accept next request same time.

I make this conjecture because i tried this extension, when i find a method references, it might takes little second, and the same time i try to go to definition, it will be frozen until previous work is done.

To solve this problem, seems need package owner to implement coroutine functions, or just fork a new thread when a request received (cpu might overweight?).

from tenkawa-php-language-server.

MarTango avatar MarTango commented on May 27, 2024

React\EventLoop is a dependency, which suggests that tenkawa does run asynchronously. (I'm not entirely sure though, as I haven't looked at the source code in depth).

from tenkawa-php-language-server.

tsufeki avatar tsufeki commented on May 27, 2024

Yes the server runs on coroutines (react & recoil) but most of the task are cpu-bound and often hard to split because they call synchronous code (like phpstan). Also this is the reason that implementing cancellations would not be very useful right now.

Starting several processes would be complicated as they'd need to share a lot of state (open documents, index, caches etc.)

from tenkawa-php-language-server.

xiaohuilam avatar xiaohuilam commented on May 27, 2024

@tsufeki
strongly advice to explore with https://github.com/swoole/swoole-src, it says provides a sync to async quick magic calls Swoole\Runtime::enableCoroutine(), i'm sure asynchronization works fine with pdo/curl because i have private project is powered by it, but i am not sure if it work with file r/w io...

--
but i have a bad sight for that because the disk i/o wait is not able to resolve by just simple cpu task switching according to my thought. my test shows it works (video demo) with code gist:

from tenkawa-php-language-server.

Related Issues (14)

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.