All Projects β†’ rofl0r β†’ jobflow

rofl0r / jobflow

Licence: MIT License
runs stuff in parallel (like GNU parallel, but much faster and memory-efficient)

Programming Languages

c
50402 projects - #5 most used programming language
shell
77523 projects
Makefile
30231 projects

Projects that are alternatives of or similar to jobflow

React Select Me
Fast πŸ†. Lightweight 🐜. Configurable πŸ™. Easy to use πŸ¦„. Give it a shot πŸ‘‰πŸΌ
Stars: ✭ 119 (+77.61%)
Mutual labels:  fast, lightweight
Pareto.js
An extremely small, intuitive and fast functional utility library for JavaScript
Stars: ✭ 254 (+279.1%)
Mutual labels:  fast, lightweight
Crepe
The thin API stack.
Stars: ✭ 120 (+79.1%)
Mutual labels:  fast, lightweight
Pget
The fastest file download client
Stars: ✭ 724 (+980.6%)
Mutual labels:  fast, parallel
brute-md5
Advanced, Light Weight & Extremely Fast MD5 Cracker/Decoder/Decryptor written in Python 3
Stars: ✭ 16 (-76.12%)
Mutual labels:  fast, lightweight
Maquette
Pure and simple virtual DOM library
Stars: ✭ 729 (+988.06%)
Mutual labels:  fast, lightweight
Wolff
🐺 Lightweight and easy to use framework for building web apps.
Stars: ✭ 203 (+202.99%)
Mutual labels:  fast, lightweight
Autocomplete.js
Simple autocomplete pure vanilla Javascript library.
Stars: ✭ 3,428 (+5016.42%)
Mutual labels:  fast, lightweight
netpoll
Package netpoll implements a network poller based on epoll/kqueue.
Stars: ✭ 38 (-43.28%)
Mutual labels:  fast, unix
tinyrpc
Much fast, lightweight, async, based boost.beast and protobuf.
Stars: ✭ 32 (-52.24%)
Mutual labels:  fast, lightweight
Domvm
DOM ViewModel - A thin, fast, dependency-free vdom view layer
Stars: ✭ 581 (+767.16%)
Mutual labels:  fast, lightweight
not-enough-standards
A modern header-only C++ library that provides platform-independent utilities.
Stars: ✭ 197 (+194.03%)
Mutual labels:  process, pipes
Nupdate
A comfortable update solution for .NET-applications.
Stars: ✭ 394 (+488.06%)
Mutual labels:  fast, process
Utox
Β΅Tox the lightest and fluffiest Tox client
Stars: ✭ 820 (+1123.88%)
Mutual labels:  fast, lightweight
Wondercms
WonderCMS - fast and small flat file CMS (5 files)
Stars: ✭ 330 (+392.54%)
Mutual labels:  fast, lightweight
Fero
light, fast, scalable, streaming microservices made easy
Stars: ✭ 175 (+161.19%)
Mutual labels:  fast, lightweight
Framework
Swoole, PSR-15, PSR-7, PSR-11 lightweight modular anti-framework for REST micro-services.
Stars: ✭ 259 (+286.57%)
Mutual labels:  fast, lightweight
Light 4j
A fast, lightweight and more productive microservices framework
Stars: ✭ 3,303 (+4829.85%)
Mutual labels:  fast, lightweight
clifm
The shell-like, command line terminal file manager: simple, fast, extensible, and lightweight as hell
Stars: ✭ 825 (+1131.34%)
Mutual labels:  fast, lightweight
ultra-sort
DSL for SIMD Sorting on AVX2 & AVX512
Stars: ✭ 29 (-56.72%)
Mutual labels:  fast, parallel

jobflow by rofl0r

this program is inspired by the functionality of GNU parallel, but tries to keep low overhead and follow the UNIX philosophy of doing one thing well.

how it works

basically, it works by processing stdin, launching one process per line. the actual line can be passed to the started program as an argv. this allows for easy parallelization of standard unix tasks.

it is possible to save the current processed line, so when the task is killed it can be continued later.

example usage

you have a list of things, and a tool that processes a single thing.

cat things.list | jobflow -threads=8 -exec ./mytask {}

seq 100 | jobflow -threads=100 -exec echo {}

cat urls.txt | jobflow -threads=32 -exec wget {}

find . -name '*.bmp' | jobflow -threads=8 -exec bmp2jpeg {.}.bmp {.}.jpg

run jobflow without arguments to see a list of possible command line options, and argument permutations.

starting from version 1.3.1, jobflow can also be used to extract a range of lines, e.g.:

seq 100 | jobflow -skip 10 -count 10  # print lines 11 to 20

Comparison with GNU parallel

GNU parallel is written in perl, which has the following disadvantages:

  • requires a perl installation even though most people already have perl installed anyway, installing it just for this purpose requires up to 50 MB storage (and potentially up to several hours of time to compile it from source on slow devices)
  • requires a lot of time on startup (parsing sources, etc)
  • requires a lot of memory (typically between 5-60 MB)

jobflow OTOH is written in C, which has numerous advantages.

  • once compiled to a tiny static binary, can be used without 3rd party stuff
  • very little and constant memory usage (typically a few KB)
  • no startup overhead
  • much higher execution speed

apart from the chosen language and related performance differences, the following other differences exist between GNU parallel and jobflow:

  • supports rlimits passed to started processes
  • doesn't support ssh (usage of remote cpus)
  • doesn't support all kinds of argument permutations: while GNU parallel has a rich set of options to permute the input, this doesn't adhere to the UNIX philosophy. jobflow can achieve the same result by passing the unmodified input to a user-created script that does the required permutations with other standard tools.

available command line options

-skip N -threads N -resume -statefile=/tmp/state -delayedflush
-delayedspinup N -buffered -joinoutput -limits mem=16M,cpu=10
-eof=XXX
-exec ./mycommand {}

-skip N

N=number of entries to skip

-count N

N=only process count lines (after skipping)

-threads N (alternative: -j N)

N=number of parallel processes to spawn

-resume

resume from last jobnumber stored in statefile

-eof XXX

use XXX as the EOF marker on stdin
if the marker is encountered, behave as if stdin was closed
not compatible with pipe/bulk mode

-statefile XXX

XXX=filename
saves last launched jobnumber into a file

-delayedflush

only write to statefile whenever all processes are busy,
and at program end

-delayedspinup N

N=maximum amount of milliseconds
...to wait when spinning up a fresh set of processes
a random value between 0 and the chosen amount is used to delay initial
spinup.
this can be handy to circumvent an I/O lockdown because of a burst of
activity on program startup

-buffered

store the stdout and stderr of launched processes into a temporary file
which will be printed after a process has finished.
this prevents mixing up of output of different processes.

-joinoutput

if -buffered, write both stdout and stderr into the same file.
this saves the chronological order of the output, and the combined output
will only be printed to stdout.

-bulk N

do bulk copies with a buffer of N bytes. only usable in pipe mode.
this passes (almost) the entire buffer to the next scheduled job.
the passed buffer will be truncated to the last line break boundary,
so jobs always get entire lines to work with.
this option is useful when you have huge input files and relatively short
task runtimes. by using it, syscall overhead can be reduced to a minimum.
N must be a multiple of 4KB. the suffixes G/M/K are detected.
actual memory allocation will be twice the amount passed.
note that pipe buffer size is limited to 64K on linux, so anything higher
than that probably doesn't make sense.

-limits [mem=N,cpu=N,stack=N,fsize=N,nofiles=N]

sets the rlimit of the new created processes.
see "man setrlimit" for an explanation. the suffixes G/M/K are detected.

-exec command with args

everything past -exec is treated as the command to execute on each line of
stdin received. the line can be passed as an argument using {}.
{.} passes everything before the last dot in a line as an argument.
it is possible to use multiple substitutions inside a single argument,
but currently only of one type.
if -exec is omitted, input will merely be dumped to stdout (like cat).

BUILD

just run make.

you may override variables used in the Makefile and set optimization CFLAGS and similar thing using a file called config.mak, e.g.:

echo "CFLAGS=-O2 -g" > config.mak
make -j2
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].