1
0
mirror of https://github.com/Llewellynvdm/starship.git synced 2024-06-27 20:13:30 +00:00
starship/src
Thomas O'Donnell 2a650bfd14
perf(package): only try to read files that exist (#3904)
* perf(package): only try to read files that exist

Have refactored the package module to improve performance. Before this
change the module would try to open every single file that could contain
some package information until it found a valid version. This resulted
in a lot of unneeded disk IO. Have added a new fn, `read_file_from_pwd`
that uses the current context to check if that file already exists and
fast failing if it doesn't. From my local testing this speeds up the
package module from taking ~1ms to ~50µs in an empty directory.

* refactor: move read_file_from_pwd to context

* refactor(haskell): use read_files_from_pwd

* refactor(nodejs): use read_files_from_pwd
2022-04-25 16:18:01 +02:00
..
configs chore(aws): adds space to the duration variable (#3872) 2022-04-21 20:58:06 +02:00
formatter refactor: fix new clippy/compiler warnings (#3656) 2022-02-24 23:31:01 -05:00
init fix(nu): Use = instead of space to pass command line parameters (#3833) 2022-04-04 20:03:43 +02:00
modules perf(package): only try to read files that exist (#3904) 2022-04-25 16:18:01 +02:00
test test(git): enable fsync for git operations (#3889) 2022-04-20 18:39:24 +01:00
bug_report.rs fix(init): Change Nushell init for nu 0.60 (#3773) 2022-03-24 15:06:24 -04:00
config.rs feat: allow printing config file schema (#3737) 2022-04-01 17:14:05 +02:00
configure.rs refactor: replace module_config_derive with serde (#3786) 2022-03-26 10:42:19 +01:00
context.rs perf(package): only try to read files that exist (#3904) 2022-04-25 16:18:01 +02:00
lib.rs refactor: replace module_config_derive with serde (#3786) 2022-03-26 10:42:19 +01:00
logger.rs fix(clippy): fix new clippy lints (#2939) 2021-07-29 14:27:46 -04:00
main.rs feat: allow printing config file schema (#3737) 2022-04-01 17:14:05 +02:00
module.rs feat(spack): Add Spack module (#3639) 2022-04-03 15:33:14 +02:00
print.rs feat: allow printing config file schema (#3737) 2022-04-01 17:14:05 +02:00
segment.rs feat: Add a fill module to pad out the line (#3029) 2021-09-12 19:59:15 -04:00
serde_utils.rs refactor: replace module_config_derive with serde (#3786) 2022-03-26 10:42:19 +01:00
utils.rs feat: Add a module for C projects (#3631) 2022-03-25 00:10:19 -04:00