App calculates the number of unique IPv4 addresses in a given file and print the result.
- Processing large files
- Ready-to-work with simple CLI
- Supports goroutines for faster processing
Build project into binary:
make build-macSupports two modes of operation:
- Without goroutines
./bin/counter -path="path_to_file"- With goroutines
./bin/counter -path="path_to_file" -allowParallel=trueNote: by default, the app will use the first mode. To use the second mode, you need to specify the -allowParallel flag.
Tested on large file.
Without goroutines:
Unique ips: 1000000000
Total time: 8m39.046350542s
Alloc = 577 MiB TotalAlloc = 122578 MiB Sys = 1075 MiB NumGC = 241With goroutines (5 workers):
Unique ips: 1000000000
Total time: 4m34.130946167s
Alloc = 556 MiB TotalAlloc = 122582 MiB Sys = 1079 MiB NumGC = 241