Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

increased the extension's speed #113

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

Ahmed-ata112
Copy link

I replaced the old glob with fast-glob as the former caused a very long loading time with large Projects

@Ahmed-ata112 Ahmed-ata112 changed the title boasted the extension speed boosted the extension speed Sep 6, 2022
@Ahmed-ata112 Ahmed-ata112 changed the title boosted the extension speed boosted the extension's speed Sep 6, 2022
@Ahmed-ata112 Ahmed-ata112 changed the title boosted the extension's speed increased the extension's speed Sep 6, 2022
@Ahmed-ata112
Copy link
Author

  • before

before

  • after

after

@patbenatar
Copy link
Owner

@Ahmed-ata112 thanks for this! I'm traveling for a few weeks so I'll get to this when I return. Cheers 🍻

@alextegelid
Copy link

alextegelid commented Feb 20, 2024

I haven't used this extension lately because it takes about 20 seconds to update the folder list in my current project. I've now built the extension from this PR and that brought the loading time down to about 1 second. Thank you @Ahmed-ata112! 🙏🏻

@patbenatar Thank you for the initial development of this extension. You should really take another look at this PR.

@patbenatar
Copy link
Owner

@alextegelid I'd love to get this merged and released, but I haven't worked on this extension in years and don't have my environment setup to build it nor do I have the time to get it setup these days. Would you be able to package it for release so I can just upload it to the VS Code marketplace? Thanks!

@alextegelid
Copy link

Unfortunately I'm not sure how to do that.

I get a couple of warnings during packaging that I'm not sure how to fix. From what I can understand the warnings might well be a clue as to why the extension is slow to begin with. It says something about Cache and gitignoreToGlog will crash at run-time.

If it is the case that gitignoreToGlob crashes, that would explain why it takes forever to build the directory list in my project since the node_modules wouldn't be ignored.

That being said, I'm still able to get a vsix-file that I can install manually.

▲ [WARNING] Calling "gitignoreToGlob" will crash at run-time because it's an import namespace object, not a function [call-import-namespace]

    src/extension.ts:63:33:
      63 │   return gitignoreFiles.map(g => gitignoreToGlob(g)).reduce(flatten, []);
         ╵                                  ~~~~~~~~~~~~~~~

  Consider changing "gitignoreToGlob" to a default import instead:

    src/extension.ts:7:7:
      7 │ import * as gitignoreToGlob from 'gitignore-to-glob';
        │        ~~~~~~~~~~~~~~~~~~~~
        ╵        gitignoreToGlob

  Make sure to enable TypeScript's "esModuleInterop" setting so that TypeScript's type checker
  generates an error when you try to do this. You can read more about this setting here:
  https://www.typescriptlang.org/tsconfig#esModuleInterop

▲ [WARNING] Constructing "Cache" will crash at run-time because it's an import namespace object, not a constructor [call-import-namespace]

    src/extension.ts:368:22:
      368 │     const cache = new Cache(context, `workspace:${cacheName}`);
          ╵                       ~~~~~

  Consider changing "Cache" to a default import instead:

    src/extension.ts:8:7:
      8 │ import * as Cache from 'vscode-cache';
        │        ~~~~~~~~~~
        ╵        Cache

  Make sure to enable TypeScript's "esModuleInterop" setting so that TypeScript's type checker
  generates an error when you try to do this. You can read more about this setting here:
  `https://www.typescriptlang.org/tsconfig#esModuleInterop`

@pgdaniel
Copy link
Collaborator

@patbenatar @alextegelid I have some time I can try to package it up

@patbenatar
Copy link
Owner

Sweet, thanks guys!

@Ahmed-ata112
Copy link
Author

Thank you all for your interest. I nearly forgot this PR, despite using this extension almost daily. I’m also open to contributing if @pgdaniel seeks any assistance.

Additionally, I've implemented the feature mentioned in issue #84 on a separate branch. However, it's occasionally buggy, and I lacked the energy to fix it, assuming the extension's repository was inactive. I believe @pgdaniel might find this contribution interesting as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants