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

[Question] Is wrong command in your benchmark? #227

Open
NamPNQ opened this issue Apr 22, 2024 · 5 comments
Open

[Question] Is wrong command in your benchmark? #227

NamPNQ opened this issue Apr 22, 2024 · 5 comments
Labels
question Further information is requested

Comments

@NamPNQ
Copy link

NamPNQ commented Apr 22, 2024

Follow your command to benchmark, you run node -v for vfox, and just node for asdf
image

The result is very difference when run the same node -v, in my machine, the asdf is faster

image

Version
0.4.1

OS
macOS

@NamPNQ NamPNQ added the question Further information is requested label Apr 22, 2024
@ZuBB
Copy link

ZuBB commented Apr 22, 2024

I wanted to fill a new issue, but I found this one and decided to continue on performance complaints here.

So I waited until #188 became available and tried it this morning. The first thing that I noticed is that when I press the 'enter' key, my command prompt is redrawn with some noticeable delay. It's very small but still noticeable.
I used fnm before and did not notice any "big" delays with it.

is it something that can be looked into?

ps: latest macOS in 13th version, latest fish and latest kitty

@aooohan
Copy link
Member

aooohan commented Apr 23, 2024

I did a quick benchmark and here are the results.

image

Performance has decreased, I need to find out what case this issue.

@aooohan
Copy link
Member

aooohan commented Apr 23, 2024

So I waited until #188 became available and tried it this morning. The first thing that I noticed is that when I press the 'enter' key, my command prompt is redrawn with some noticeable delay. It's very small but still noticeable. I used fnm before and did not notice any "big" delays with it.

https://vfox.lhan.me/guides/configuration.html#legacy-version-file

As mentioned in docs, if this feature is turned on, it may cause refresh environment variables slightly slower

@ZuBB
Copy link

ZuBB commented Apr 24, 2024

So I waited until #188 became available and tried it this morning. The first thing that I noticed is that when I press the 'enter' key, my command prompt is redrawn with some noticeable delay. It's very small but still noticeable. I used fnm before and did not notice any "big" delays with it.

https://vfox.lhan.me/guides/configuration.html#legacy-version-file

As mentioned in docs, if this feature is turned on, it may cause refresh environment variables slightly slower

I understand that additional checks are not free. But I don't understand why handling a .tool-versions file takes a really small amount of time and handling a .node-version takes a way bigger amount of time. The difference is huge. If we compare those two files, 2nd one should be processed faster as it contains data on only one particular runtime.

Do you have any idea why we have such a big difference?

Also, I noticed that the config file gets really weird ACL. Why did it suddenly become executable?

vv@my-precious ~/.version-fox $ ls -l config.yaml 
-rwxrwxrwx  1 vv  staff  98 Apr 23 23:13 config.yaml
vv@my-precious ~/.version-fox $ 

EDIT: the whore redraw issue happens only in dirs with .node-version(/.tool-versions) files.

@aooohan
Copy link
Member

aooohan commented Apr 24, 2024

I understand that additional checks are not free. But I don't understand why handling a .tool-versions file takes a really small amount of time and handling a .node-version takes a way bigger amount of time. The difference is huge. If we compare those two files, 2nd one should be processed faster as it contains data on only one particular runtime.

Do you have any idea why we have such a big difference?

There are two factors:

  1. You can view $HOME/.version-fox/.legacy_filenames file to view all filenames that need to be match.
  2. We need to focus on how vfox-nodejs plugin implements to parse .node-version file.

There is a strategy here. First, match the locally installed version. If it does not match, then match the remote version, that will call Available hook, this involves network IO and will seriously affect the speed.

I think it may be caused by this.

https://github.com/version-fox/vfox-nodejs/blob/aa6dc5faeba6cd354e83966f66a88cd6feef2204/hooks/parse_legacy_file.lua#L34-L41

Also, I noticed that the config file gets really weird ACL. Why did it suddenly become executable?

vv@my-precious ~/.version-fox $ ls -l config.yaml 
-rwxrwxrwx  1 vv  staff  98 Apr 23 23:13 config.yaml
vv@my-precious ~/.version-fox $ 

Because I was going to do some advance preparation for solving #51, but I did it wrong. This file should be readable and writable. : (

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

No branches or pull requests

3 participants