Giter VIP home page Giter VIP logo

geopjr / blahaj Goto Github PK

View Code? Open in Web Editor NEW
144.0 3.0 5.0 59 KB

๐Ÿฆˆ๐Ÿณ๏ธโ€โšง๏ธ๐Ÿณ๏ธโ€๐ŸŒˆ Gay sharks at your local terminal - lolcat-like CLI tool

Home Page: https://blahaj.geopjr.dev/

License: BSD 2-Clause "Simplified" License

Makefile 4.00% Crystal 94.20% Dockerfile 1.80%
blahaj cli lolcat queer shark trans ascii-art colors command-line terminal

blahaj's Introduction

blahaj's People

Contributors

antiz96 avatar bitfl0wer avatar chromadale avatar geopjr avatar kosude avatar miampf avatar modernews avatar willfantom avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

blahaj's Issues

Consider using Rust for improved performance

I threw together a quick single-threaded rust implementation of this, and found a ~5.21x performance improvement compared to the multi-threaded implementation of BLAHAJ.
Benchmark Results

This performance improvement still carries over to larger inputs:
Another benchmark

For abnormally large files that you usually wouldn't pass through this (32768 lines in the 1st below example, 12MB of #\n repeating in the 2nd), the gap does get significantly smaller, however there is still a significant performance improvement:
3rd benchmark
4th benchmark
Also, my testing does not include a multithreaded rust implementation, which could be even faster. I'm guessing the lower gap in the last 2 is primarily due to my implementation being singlethreaded.

As a result of this discovery, I thought it might be worth mentioning that rewriting this in rust may provide a significant performance advantage overall :)

Note that my implementation is very barebones, and a more complete implementation may see less of a performance improvement - however it should still see some of the 1.3x to 5x improvement.

Display the blahaj directly if stdin is not a pipe

If the stdin is not a pipe, we are not coloring the output of any commands, instead we are coloring our inputs in the terminal. This looks boring and is not expected.

We have several ways to detect if stdin is a pipe or a terminal. isatty(STDIN_FILENO) can detect terminal and S_ISFIFO(st.st_mode) can detect pipe. I don't know any clue about crystal though.

Make release build

It would be cool if a new release could be published, since a new flag has been added!

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.