Comments (6)
-
PowerShell's (7+) crossplatform, so it's not much more than just launching it as the shell and running the benchmarks through it, just make sure to use
-NoProfile
and-NonInteractive
as startuppwsh
flags to not import or enable anything by accident. And as mentioned before, launching with something like-Command
is heavy and shouldn't be used within the benchmark, the shell kinda JIT compiles itself at startup (I think). Basically don't do:pwsh -c 'sls regex'
-
Select-String
uses case insensitive .net regex, so whatever that supports, you can use inSelect-String
. Could be cool to also test-SimpleMatch
&-CaseSensitive
too I guess. It's pretty straight forward, works similarly to egrep/ripgrep. -
From stdin:
cat -Raw whatever | sls regex
Get-Content -Raw whatever | Select-String regex
-
From all recursive files within the working dir:
sls regex
Select-String regex
Top's using default aliases, bottom's using full commands just for clarity's sake. If you want to run a bin with the same name as the alias on unix OS' (on Windows you'd just append .exe
, coreutils' cat
would be a good relevant example here), you'd want to use the full path, or delete the alias. You can make sure what you're sending is an alias, function, or bin, with the gcm
/Get-Command
function, and you can remove the alias with Remove-Alias
(-Force), use absolute paths, or use the -CommandType Application
flag Get-Command
.
from ripgrep.
Could you rephrase your request for a target audience that doesn't know PowerShell? (For example, me.)
Maybe you could provide real examples of what to do and what not to do.
from ripgrep.
Thanks! I'll take a look when I get chance to use my Windows laptop. I'll at least do some ad hoc benchmarking, and depending on the result of that, I may or may not add it to the benchsuite
script.
from ripgrep.
Sure, just know that PowerShell shipped with Windows' version 5, so there could be some pretty large differences.
from ripgrep.
Differences between what? Are you suggesting using PowerShell on Unix instead?
(I'd appreciate if you could spell out more of what you mean here.)
from ripgrep.
The OS doesn't matter, It's just a matter of PowerShell's version, PowerShell 7+ can be used anywhere. PowerShell shipped on Windows' version 5, years out of date. You can benchmark on anything you like.
https://github.com/PowerShell/PowerShell
❯ powershell -NoProfile -NonInteractive -Command '$PSVersionTable'
Name Value
---- -----
PSVersion 5.1.19041.4291
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.19041.4291
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
❯ pwsh -NoProfile -NonInteractive -Command '$PSVersionTable'
Name Value
---- -----
PSVersion 7.5.0-preview.2
PSEdition Core
GitCommitId 7.5.0-preview.2
OS Microsoft Windows 10.0.19044
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
from ripgrep.
Related Issues (20)
- Feature Request: Early Bail Out for Time-Consuming Regex Matches in pcre2 HOT 4
- [perf] rg does not use globs to prune recursion when it can HOT 4
- cursor disappearing HOT 1
- failing test: f2361_sort_nested_files
- The same `LineTerminator` is being used for searching and printing
- `--pre` doesn't work on Windows (CMD, MSYS2 bash, Powershell) HOT 16
- ARMv8 release binary for RPI 5 HOT 2
- ripgrep 14.1.0 exit silently when stdin is not connected (GNU parallel without --tty) HOT 8
- Feature Request: search for binary data by supplying a hex string HOT 9
- Is it possible to add a search for just a set of directories as a type? HOT 1
- Allow following symlinks to files HOT 2
- WalkDir ignores files that are in .gitignore outside of current git repository HOT 2
- Multiple quirks in ignore behavior HOT 1
- BUG: exit code on windows not stable (wrong on first run, then stable), seems to leak HOT 9
- pcre2 reset match \K drops submatches HOT 1
- ripgrep is slower than LTREP matching `[A-Z][A-Z]+` HOT 3
- --files is listing files that won't be searched into HOT 4
- ripgrep ignore files inside `.github` folder HOT 5
- Potentially incorrect or undocumented .gitignore files handling
- `--text` flag only works if it's late in the command HOT 1
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 ripgrep.