Giter VIP home page Giter VIP logo

scoop-search's Introduction

scoop-search

Fast scoop search drop-in replacement 🚀

Installation

scoop install scoop-search

PowerShell hook

Instead of using scoop-search.exe <term> you can setup a hook that will run scoop-search.exe whenever you use native scoop search

Add this to your Powershell profile (usually located at $PROFILE)

Invoke-Expression (&scoop-search --hook)

CMD.exe wrapper

If you use cmd.exe you can use a wrapper script to do the same. Name this scoop.cmd and add it to a directory in your %PATH%

@echo off

if "%1" == "search" (
    call :search_subroutine %*
) else (
    powershell scoop.ps1 %*
)
goto :eof

:search_subroutine
set "args=%*"
set "newargs=%args:* =%"
scoop-search.exe %newargs%
goto :eof

Features

Behaves just like scoop search and returns identical output. If any differences are found please open an issue.

Non-goal: any additional features unavailable in scoop search

Building

This project uses Zig. Building and running works on all platforms, not only Windows.

Build with (output is stored in ./zig-out/bin):

zig build -Doptimize=ReleaseFast

Run debug with:

zig build run -- searchterm

Benchmarks

Done with hyperfine. scoop-search is on average 350 times faster.

❯ hyperfine --warmup 1 'scoop-search google' 'scoop search google'
Benchmark 1: scoop-search google
  Time (mean ± σ):      60.3 ms ±   3.5 ms    [User: 91.2 ms, System: 394.2 ms]
  Range (min … max):    55.1 ms …  73.8 ms    49 runs

Benchmark 2: scoop search google
  Time (mean ± σ):     21.275 s ±  2.657 s    [User: 9.604 s, System: 11.789 s]
  Range (min … max):   19.143 s … 27.035 s    10 runs

Summary
  scoop-search google ran
  352.74 ± 48.49 times faster than scoop search google

ran on AMD Ryzen 5 3600 @ 3.6GHz

scoop-search's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.