mirror of
https://github.com/NixOS/nix.git
synced 2025-11-11 04:56:01 +01:00
use more string_view in utils
there's a couple places that can be easily converted from using strings to using
string_views instead. gives a slight (~1%) boost to system eval.
# before
nix eval --raw --impure --expr 'with import <nixpkgs/nixos> {}; system'
Time (mean ± σ): 2.946 s ± 0.026 s [User: 2.655 s, System: 0.209 s]
Range (min … max): 2.905 s … 2.995 s 20 runs
# after
Time (mean ± σ): 2.928 s ± 0.024 s [User: 2.638 s, System: 0.211 s]
Range (min … max): 2.893 s … 2.970 s 20 runs
This commit is contained in:
parent
e61c4bc25a
commit
44c92a1667
3 changed files with 39 additions and 23 deletions
|
|
@ -22,6 +22,7 @@ typedef std::map<string, string> StringMap;
|
|||
/* Paths are just strings. */
|
||||
|
||||
typedef string Path;
|
||||
typedef std::string_view PathView;
|
||||
typedef list<Path> Paths;
|
||||
typedef set<Path> PathSet;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue