Tiny Commands Toolchain

Related tags

Miscellaneous tct
Overview

Tiny Commands Toolchain: TCT

A 1.62MB (release profile) monolithic commands kit for casual terminal usage without any run-time dependency. MMade in 171 LOC (lines of code).

Usage

For execute a command, just run the tct with the first argument being the same all commands require at least 1 argument.

Examples:

command launch string
cat tct cat some_file
grep tct cat a_string some_file
mkdir tct mkdir new_dir

Benchmarks

Comparision of some tools. Everything with gnu prefix means that's from gnu-coreutils's Arch package (version 9.0-2).

Notes: Some tools as rg and bat has a LOT of features and it's beautiful for user mode. For this reason, some benchmarks will show them as slower than other commands.

All benchmarks were performed on a 1.89GB RAM 2.6GHz Celeron Dual Core CPU machine~~/potato~~.

cat

In a 10KB file:

Command Mean [ms] Min [ms] Max [ms] Relative
cat lorem.txt 1.7 ± 1.4 0.0 5.2 1.00
./target/release/tct cat lorem.txt 2.3 ± 1.7 0.0 5.9 1.33 ± 1.45
bat lorem.txt 97.8 ± 5.9 92.6 119.5 56.09 ± 45.92

In a 10MB file:

Command Mean [ms] Min [ms] Max [ms] Relative
cat biglorem.txt 5.9 ± 2.7 1.7 12.8 2.65 ± 2.36
./target/release/tct cat biglorem.txt 2.2 ± 1.7 0.0 6.4 1.00
bat biglorem.txt 121.7 ± 6.4 116.4 139.6 54.39 ± 41.59

grep

Searching for all occurrences of Ipsum in a 10KB file

Command Mean [ms] Min [ms] Max [ms] Relative
grep Ipsum lorem.txt 5.9 ± 2.8 1.5 10.9 2.56 ± 2.32
./target/release/tct grep Ipsum lorem.txt 2.3 ± 1.8 0.0 5.9 1.00
rg Ipsum lorem.txt 8.5 ± 2.9 3.5 14.2 3.71 ± 3.13

Searching for all occurrences of Ipsum in a 10MB file

Command Mean [ms] Min [ms] Max [ms] Relative
grep Ipsum biglorem.txt 5.7 ± 2.9 1.7 11.6 1.00
./target/release/tct grep Ipsum biglorem.txt 36.3 ± 5.7 32.3 60.4 6.33 ± 3.30
rg Ipsum biglorem.txt 24.8 ± 5.1 13.8 33.1 4.33 ± 2.33

Compile Tips

Be sure to compile with release profile (cargo build --release). If you're compiling for local usage, sill can set RUSTFLAGS with -C target-cpu=native before compile (RUSTFLAGS='-C target-cpu=native' cargo build --release on *NIX, set RUSTFLAGS='-C target-cpu=native' ; cargo build --release on Windows) to use your CPU specific instructions for local optimization.

TODO

  • (Add more benchmarks)
  • (Optimize grep for large files)
  • (Improve README)
  • (Update manpages)
You might also like...
Tools - The Rome Toolchain. A linter, compiler, bundler, and more for JavaScript, TypeScript, HTML, Markdown, and CSS.
Tools - The Rome Toolchain. A linter, compiler, bundler, and more for JavaScript, TypeScript, HTML, Markdown, and CSS.

Rome is currently being rewritten in Rust. Read more about it in our latest blog post. The documentation below is out of date and available for poster

Work out how to read Parquet files in a browser using web assembly (via the Rust toolchain)

wasm-pack-template A template for kick starting a Rust and WebAssembly project using wasm-pack. Tutorial | Chat Built with 🦀 🕸 by The Rust and WebAs

Compiler infrastructure and toolchain library for WebAssembly

Binaryen Binaryen is a compiler and toolchain infrastructure library for WebAssembly, written in C++. It aims to make compiling to WebAssembly easy, f

Parametric surfaces drawn using the Rust + WASM toolchain with WebGL, React, and TypeScript.

Parametric Surfaces in the Browser My.Movie.3.mp4 Wanted to experiment with WebGL using the Rust + WASM toolchain, with React and TypeScript to glue e

Source code of Ferrocene, safety-critical Rust toolchain

Ferrocene is a toolchain to enable the use of the Rust programming language in safety-critical environments. It is a proper downstream of the main Rus

:stars: Manage your shell commands.
:stars: Manage your shell commands.

Pueue Pueue is a command-line task management tool for sequential and parallel execution of long-running tasks. Simply put, it's a tool that processes

Executes commands in response to file modifications

watchexec Software development often involves running the same commands over and over. Boring! watchexec is a simple, standalone tool that watches a p

Remember me my commands
Remember me my commands

mme is a search tool that helps you to print commands and their description using a custom file. Installation The binary name for rememberme is mme. A

New commands for Dockerfile

Dockerfile+ This project provides Dockerfile syntax extensions that have been rejected by the moby project or haven't been addressed in a long time. C

Turn static CLI commands into TUIs with ease
Turn static CLI commands into TUIs with ease

lazycli Turn static CLI commands into TUIs with ease Demo: Usage Pick a command that spits out either a list or table of content, like ls, docker ps,

🐢 Atuin replaces your existing shell history with a SQLite database, and records additional context for your commands
🐢 Atuin replaces your existing shell history with a SQLite database, and records additional context for your commands

Atuin replaces your existing shell history with a SQLite database, and records additional context for your commands. Additionally, it provides optional and fully encrypted synchronisation of your history between machines, via an Atuin server.

🤖 just is a handy way to save and run project-specific commands.

just just is a handy way to save and run project-specific commands. (非官方中文文档,这里,快看过来!) Commands, called recipes, are stored in a file called justfile

1 library and 2 binary crates to run SSH/SCP commands on a
1 library and 2 binary crates to run SSH/SCP commands on a "mass" of hosts in parallel

massh 1 library and 2 binary crates to run SSH/SCP commands on a "mass" of hosts in parallel. The binary crates are CLI and GUI "frontends" for the li

🌌⭐cosmo is a wrapper for Git essentially, allowing you to compress multiple commands into one
🌌⭐cosmo is a wrapper for Git essentially, allowing you to compress multiple commands into one

❯ Cosmo Git tooling of the future New feature: Cosmo hooks! Click here for more info! ❯ 👀 Features Config files (with defaults!) Fast Easy to use Fri

Save cli commands and fuzzy find them later
Save cli commands and fuzzy find them later

crow - cli command memorizer What is crow? | Installation | Usage | FAQ What is crow? crow (command row) is a CLI tool to help you memorize CLI comman

koyo is a cli tool that lets you run commands as another user. It is similar to doas or sudo.

koyo is a cli tool that lets you run commands as another user. It is similar to doas or sudo.

allows you to run multiple cargo commands in a row

Cargo Do Allows you to put multiple cargo commands on one line, e.g. $ cargo do clean, update, build Installation cargo install cargo-do From Source

Lazygit - simple terminal UI for git commands
Lazygit - simple terminal UI for git commands

A simple terminal UI for git commands, written in Go with the gocui library. Rant time: You've heard it before, git is powerful, but what good is that

Tldr - 📚 Collaborative cheatsheets for console commands
Tldr - 📚 Collaborative cheatsheets for console commands

What is tldr-pages? The tldr-pages project is a collection of community-maintained help pages for command-line tools, that aims to be a simpler, more

Comments
  • chore(deps): update actions/checkout action to v3

    chore(deps): update actions/checkout action to v3

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | actions/checkout | action | major | v2 -> v3 |


    Release Notes

    actions/checkout

    v3

    Compare Source


    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • fix(deps): update rust crate memmap2 to 0.5.8

    fix(deps): update rust crate memmap2 to 0.5.8

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | memmap2 | dependencies | patch | 0.5.0 -> 0.5.8 |


    Release Notes

    RazrFalcon/memmap2-rs

    v0.5.8

    Compare Source

    Added
    • MmapRaw::advise, MmapRaw::lock and MmapRaw::unlock. @​diwic
    • Improve MmapMut::make_exec documentation.

    v0.5.7

    Compare Source

    Changed

    v0.5.6

    Compare Source

    Added
    • Memory locking and unlocking. See Mmap::lock, Mmap::unlock, MmapMut::lock and MmapMut::unlock. @​vmx

    v0.5.5

    Compare Source

    Fixed
    • Limit mapping length to isize::MAX to prevent undefined behavior on calling std::slice::from_raw_parts. Technically affects only 32-bit systems. @​adamreichold

    v0.5.4

    Compare Source

    Added
    Changed

    v0.5.3

    Compare Source

    Added

    v0.5.2

    Compare Source

    Added
    • flush, flush_async, flush_range and flush_async_range to MmapRaw matching the corresponding methods on MmapMut. @​cberner

    v0.5.1

    Compare Source

    Fixed
    • Explicitly call fstat64 on Linux, emscripten and l4re targets. @​adamreichold

    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Configure Renovate

    Configure Renovate

    Mend Renovate

    Welcome to Renovate! This is an onboarding PR to help you understand and configure settings before regular Pull Requests begin.

    🚦 To activate Renovate, merge this Pull Request. To disable Renovate, simply close this Pull Request unmerged.


    Detected Package Files

    • Cargo.toml (cargo)
    • .github/workflows/rust.yml (github-actions)

    Configuration Summary

    Based on the default config's presets, Renovate will:

    • Start dependency updates only once this onboarding PR is merged
    • Enable Renovate Dependency Dashboard creation.
    • If Renovate detects semantic commits, it will use semantic commit type fix for dependencies and chore for all others.
    • Ignore node_modules, bower_components, vendor and various test/tests directories.
    • Autodetect whether to pin dependencies or maintain ranges.
    • Rate limit PR creation to a maximum of two per hour.
    • Limit to maximum 10 open PRs at any time.
    • Group known monorepo packages together.
    • Use curated list of recommended non-monorepo package groupings.
    • A collection of workarounds for known problems with packages.

    🔡 Would you like to change the way Renovate is upgrading your dependencies? Simply edit the renovate.json in this branch with your custom config and the list of Pull Requests in the "What to Expect" section below will be updated the next time Renovate runs.


    What to Expect

    With your current configuration, Renovate will create 2 Pull Requests:

    fix(deps): update rust crate memmap2 to 0.5.8
    • Schedule: ["at any time"]
    • Branch name: renovate/memmap2-0.x
    • Merge into: nightly
    • Upgrade memmap2 to 0.5.8
    chore(deps): update actions/checkout action to v3
    • Schedule: ["at any time"]
    • Branch name: renovate/actions-checkout-3.x
    • Merge into: nightly
    • Upgrade actions/checkout to v3

    ❓ Got questions? Check out Renovate's Docs, particularly the Getting Started section. If you need any further assistance then you can also request help here.


    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Dependency Dashboard

    Dependency Dashboard

    This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

    This repository currently has no open or pending branches.

    Detected dependencies

    cargo
    Cargo.toml
    • lazy_static 1.4.0
    • memmap2 0.5.8
    • rustc-hash 1.1.0
    github-actions
    .github/workflows/rust.yml
    • actions/checkout v3

    • [ ] Check this box to trigger a request for Renovate to run again on this repository
    opened by renovate[bot] 0
Owner
Defmc
Maybe a programmer
Defmc
Jonathan Kelley 33 Dec 6, 2022
RusTiny -- A Rust implementation of Tiny+ language

RusTiny -- A Rust implementation of Tiny+ language 编译器实践 基本要求: 参考《编译原理及实践》的TINY语言编译器(已上传到群中)完成TINY+ 语言(见附录 A)的解释器:即给定满足 TINY+语言的源代码输入,你的解 释器可以给出对其的解释执

M4tsuri 2 May 22, 2022
Click-once - A small tiny little binary to fix undesired mouse double clicks in Windows, written in Rust.

click-once A small tiny little binary to fix malfunctioning mouse double clicks in Windows, written in Rust. Minimal executable with little to no over

null 23 Dec 29, 2022
Tiny crate that allows to wait for a stop signal across multiple threads

Tiny crate that allows to wait for a stop signal across multiple threads. Helpful mostly in server applications that run indefinitely and need a signal for graceful shutdowns.

Dominik Nakamura 5 Dec 16, 2022
Tiny Discord ticket support bot that utilizes the OpenAI GPT-3.5-turbo model.

BDFD AI Mod Our tiny Discord ticket support bot that utilizes the OpenAI GPT-3.5-turbo model. This project aims to help users by providing a very fast

NilPointer Software 5 Apr 20, 2023
Memory.lol - a tiny web service that provides historical information about social media accounts

memory.lol Overview This project is a tiny web service that provides historical information about social media accounts. It can currently be used to l

Travis Brown 317 Jul 12, 2023
Workflows make it easy to browse, search, execute and share commands (or a series of commands)--without needing to leave your terminal.

Workflows The repo for all public Workflows that appear within Warp and within commands.dev. To learn how to create local or repository workflows, see

Warp 369 Jan 2, 2023
Workflows make it easy to browse, search, execute and share commands (or a series of commands)--without needing to leave your terminal.

Workflows The repo for all public Workflows that appear within Warp and within commands.dev. To learn how to create local or repository workflows, see

Warp 227 Jun 1, 2022
The Rust toolchain installer

rustup: the Rust toolchain installer Master CI Build Status Windows macOS Linux Etc rustup installs The Rust Programming Language from the official re

The Rust Programming Language 5.1k Jan 8, 2023
gors is an experimental go toolchain written in rust (parser, compiler).

gors gors is an experimental go toolchain written in rust (parser, compiler). Install Using git This method requires the Rust toolchain to be installe

Aymeric Beaumet 12 Dec 14, 2022