Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/imwally/dfgrep
Dumb Fast Grep
https://github.com/imwally/dfgrep
Last synced: 11 days ago
JSON representation
Dumb Fast Grep
- Host: GitHub
- URL: https://github.com/imwally/dfgrep
- Owner: imwally
- Created: 2021-08-06T02:29:40.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-08-06T03:01:28.000Z (over 3 years ago)
- Last Synced: 2024-10-11T02:49:11.236Z (about 1 month ago)
- Language: Go
- Size: 4.88 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# dfgrep
Dumb, fast grep. Not dumb fast grep.## What?
I had a recent technical interview where I was asked to write a method that can search a large dataset for a substring. It should be fast and memory efficient. Well at first I wrote something terrible, and after staring at the mess of code I decided to clean it up a bit. This was the result. It's still terrible, but less so.## Dumb
It's dumb because it doesn't support the 're' in grep.## Fast
It's fast because goroutines go brrrr.## Benchmarks
```
% du -sh maildir
2.5G maildir
% time grep -r "Wally" maildir 1>/dev/null
grep -r "Wally" maildir > /dev/null 7.21s user 13.09s system 36% cpu 54.902 total
% time dfgrep "Wally" maildir 1>/dev/null
dfgrep "Wally" maildir > /dev/null 6.64s user 15.09s system 217% cpu 9.988 total
```