Skip to content

Use worker threads for launching conda and windows registry when discovering #22146

Closed

Description

@karrtikr

#21755

Spike results

Based on CPU profiles in #21755 (comment) discovery is mainly blocked by:

  • Launching conda binary
  • Launching REG binary for windows registry
  • Windows Path discovery

Note spawning python binaries is fine, it blocks very little of the time.

Activity

  1. changed the title [-]Use webworker for launching conda and windows registry when discovering[/-] [+]Use worker threads for launching conda and windows registry when discovering[/+] on Nov 15, 2023
  2. Tyriar commented on Nov 15, 2023

    @Tyriar

    Robo (@deepak1556) do you know why spawn would be blocking the thread for so long here?

    image

    Profiles at #21755 (comment)

  3. karrtikr commented on Nov 16, 2023

    @karrtikr
    Author

    Note this is when spawning the conda binary, similarly spawning REG binaries can seldomly be like this. But python binaries are much cheaper for some reason.

  4. karrtikr commented on Nov 16, 2023

    @karrtikr
    Author

    It's not just us, the git extension while spawning also runs into this:

    image

  5. DonJayamanne commented on Nov 16, 2023

    @DonJayamanne

    do you know why spawn would be blocking the thread for so long here?

    This was my observation a few years ago as well ( #15813 (comment))
    Back then I reached out to jrieken , and he indicated that in node, spawning processes can block the main thread for a few ms.
    However we didn't try to dig further into why spawning conda was blocking for a few seconds, primarily because the suggestion was not being actively worked on back then

  6. karrtikr commented on Nov 16, 2023

    @karrtikr
    Author

    Performance issue filled for other cases here: microsoft/vscode#198384

  7. Tyriar commented on Nov 16, 2023

    @Tyriar

    Yeah a few ms is expected, but it's very different from over 2 seconds which is what the first spawn takes in my screenshot.

  8. 62 remaining items

  9. karrtikr commented on Mar 25, 2024

    @karrtikr
    Author

    but there's an exception launching conda (which I don't think is installed) and there's no "worker id"

    Sorry, this is actually expected, missed to update the verification steps from before. The important thing to verify here is that the number of environments discovered are still the same, once discovery finishes in both cases.

  10. locked as resolved and limited conversation to collaborators on Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area-environmentsFeatures relating to handling interpreter environmentsfeature-requestRequest for new features or functionalityneeds PRReady to be worked onverification-neededVerification of issue is requestedverifiedVerification succeeded

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions