Skip to content

safinsingh/fso

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fso - fast [link] shortener
===========================

`fso` is a fast (see `testing`) implementation of a link shortener
written in pure C11. fso is multithreaded and is backed by a bounded
spmc (mpmc-capable) lock-free atomic ring buffer.

note 1: at the moment, `fso` will not exit correctly since i haven't yet
found a way to break the spinlock incurred from dequeuing jobs.

note 2: the atomic ring buffer implementation is fairly new to the codebase
and optimization will happen over time (`pause` instructions, etc).

# getting started

you can configure your links like so in a `config.fso` file like so:

```
/       -  https://safin.dev
test    -  https://google.com
my/url  -  https://stackoverflow.com
```

then, build with:

```
make prod
```

and run with:
```
./fso
```

# testing

running `make test` will generate a `config.fso` file with some junk
and prepare for a benchmark. note: ApacheBench must be installed to
benchmark `fso`.