Comments (15)
Thank you, @Princesseuh! It's looking a lot better now.
from hydro.
Need for speed ey? I can't notice any difference using time fish -c exit
between Hydro and function fish_prompt; echo; end
. But I suppose Hyperfine can see things Fish's time
can't.
I suspect the problem is here:
Lines 101 to 105 in 0c7e1be
I was actually planning to remove all that because it always takes me a while to remember what I am doing there. The goal was to cache the color codes, in the hope that would make fish_prompt
faster.
Thanks for the detailed report!
from hydro.
I found it. The problem is here
Line 113 in 0c7e1be
from hydro.
I installed Hyperfine, followed your instructions, and this is what I got:
Tide
~/tank/hydro main
❯ hyperfine fish -i -c "exit" --warmup=10
Benchmark #1: fish
Time (mean ± σ): 5.7 ms ± 0.5 ms [User: 3.8 ms, System: 1.4 ms]
Range (min … max): 5.3 ms … 9.0 ms 303 runs
Hydro
~/t/hydro main ❱ hyperfine fish -i -c "exit" --warmup=10
Benchmark #1: fish
Time (mean ± σ): 5.6 ms ± 0.5 ms [User: 3.6 ms, System: 1.5 ms]
Range (min … max): 5.1 ms … 9.2 ms 395 runs
Specs
macOS Big Sur
MacBook Pro (15-inch, 2019)
Intel UHD Graphics 630 1536 MB
32 GB 2400 MHz DDR4
2.4 GHz 8コアIntel Core i9
from hydro.
I'm also running the latest Fish from HEAD (not 3.1.2).
from hydro.
Hmm, that's weird (computers yay). I'll try a few things
Okay, so turns out running without -i
makes the benchmarks much more closer so maybe it's something in my config?
Tide
Benchmark #1: fish
Time (mean ± σ): 11.5 ms ± 1.1 ms [User: 9.4 ms, System: 2.3 ms]
Range (min … max): 7.0 ms … 13.4 ms 179 runs
Hydro
Benchmark #1: fish
Time (mean ± σ): 11.1 ms ± 1.0 ms [User: 8.9 ms, System: 2.4 ms]
Range (min … max): 6.9 ms … 13.5 ms 198 runs
This is with hyperfine fish -c "exit"
, adding a warmup doesn't change the results
from hydro.
Try commenting out everything in your config.fish
just to be sure?
from hydro.
EDIT: Oh wait I'm dumb, it doesn't mesure the rest of the command when I don't put the ' that's why the results are different LMAO, I shouldn't be commenting before drinking coffee. Nevermind this comment
Ah, I figured it out, it's not the -i
, it depend on how I write the hyperfine command
Using hyperfine 'fish -i -c "exit"'
(note the ' around the command):
Hydro
~ ❱ hyperfine 'fish -i -c "exit"'
Benchmark #1: fish -i -c "exit"
Time (mean ± σ): 22.9 ms ± 1.4 ms [User: 18.0 ms, System: 5.9 ms]
Range (min … max): 19.4 ms … 26.9 ms 107 runs
Tide
❯ hyperfine 'fish -i -c "exit"'
Benchmark #1: fish -i -c "exit"
Time (mean ± σ): 15.5 ms ± 1.3 ms [User: 12.7 ms, System: 3.3 ms]
Range (min … max): 10.7 ms … 18.4 ms 143 runs
Without the ' around the command:
Hydro
~ ❱ hyperfine fish -i -c "exit"
Benchmark #1: fish
Time (mean ± σ): 10.9 ms ± 1.3 ms [User: 8.6 ms, System: 2.5 ms]
Range (min … max): 6.9 ms … 13.4 ms 201 runs
Tide
❯ hyperfine fish -i -c "exit"
Benchmark #1: fish
Time (mean ± σ): 11.5 ms ± 1.2 ms [User: 9.2 ms, System: 2.4 ms]
Range (min … max): 7.3 ms … 14.6 ms 165 runs
Might just be computers being computers or a bug in Hyperfine? Though I fail to see why it would affect Hydro more than Tide
from hydro.
Can't reproduce the issue. I didn't even comment out my config.fish
where I customize Hydro colors (which will trigger --on-variable
handlers and do nothing in the case of Tide). I have absolutely nothing else in my config.fish
.
from hydro.
It's effectively the -i
flag that cause the 10ms difference in my case, removing my config (apart from the part where I load fisher plugins) doesn't change this, neither does removing any functions that run on fish_prompt
event.
I'm gonna try on a completely empty config with all my plugins removed, sorry for the inconvenience 😅
from hydro.
No problem. By the way, are you using a custom $fisher_path
? You don't need to do this unless you have a custom $fisher_path
, but I see no indication of that in your config.fish
, hence the question.
from hydro.
Removed my entire Fish folder so all the screenshots are with the base config of Fish (I'm using fish, version 3.1.2
however, not HEAD), Fisher and the installed prompt in their base form (no customization on Tide)
Base prompt:
Hydro:
Tide:
Trying out with HEAD of Fish, I get the more or less the same results (albeit everything seems a bit faster, cool stuff), still an unusual spike with Hydro with -i
. I'm not sure what more I can provide than that, sorry! Here's a few random infos if anything can tip you off maybe:
Config:
WM: Sway 1.5.1 (so Wayland)
Terminal: alacritty 0.6.0
CPU: i7-3930k
GPU: GTX 1080ti (using Nouveau)
No problem. By the way, are you using a custom
$fisher_path
? You don't need to do this unless you have a custom$fisher_path
, but I see no indication of that in yourconfig.fish
, hence the question.
Yes, the variable is defined here. I was originally hoping to have all the fisher stuff outside of config.fish
but it turns out I needed plugins to be loaded at the end of config.fish
for a reason I don't remember
from hydro.
Actually, just hyperfine "fish -i -c exit"
is still correct (and easier to read). Did you comment out everything in your config.fish
? It'd be nice if you could do that and try again.
from hydro.
Actually, just
hyperfine "fish -i -c exit"
is still correct (and easier to read)
True, I just mindlessly copy-pasted it (doesn't affect the results just in case you wonder)
Did you comment out everything in your config.fish? It'd be nice if you could do that and try again.
These screenshots are using a completely vanilla Fish config (removed the entire fish config folder), so there's nothing to comment.
Unless you mean on my normal configuration, in which case commenting everything did not change the results, neither did removing any functions that ran on prompt
from hydro.
That part appears to be a code relic from an earlier shape of this prompt, but we no longer need it. We were running it twice!
As for _hydro_pwd
, we can delay it until the fish_prompt
event handler fires. 💯
from hydro.
Related Issues (20)
- Symbol issues HOT 3
- Feature request: support for fish_prompt_pwd_dir_length HOT 1
- "error: process ID out of range" when in git directories HOT 2
- Exiting a shell while hydro is still fetching throws error instead of exiting HOT 7
- Issues with job control HOT 7
- Hide full path of last command with exit code != 0 HOT 9
- Feature Request: Enable Prompt on the next line ala Spaceship HOT 2
- Abbreviations can't be used until async paint is done HOT 1
- Prompt doesn't handle ' in path HOT 11
- Pre/Post prompt customization HOT 13
- Git branch lingers after `prevd-or-backward-word` HOT 4
- Background on the keys representing the vi mode HOT 6
- Coloring of pwd HOT 3
- Add dirty count for repo HOT 7
- hydro sources entire fish config on every prompt
- Handle replication of git base path within full path
- Show rust versions, etc. HOT 1
- Support Nixos Specific prompts HOT 4
- Show hostname if in a remote ssh session HOT 1
- additional variables to customize prompt HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hydro.