Last active
February 8, 2016 21:48
-
-
Save seansawyer/afd5d8a9620fe3e8c915 to your computer and use it in GitHub Desktop.
Find numbers in two files full of 10 million random positive integers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ time shuf -i 1-4294967296 -n 10000000 | sort | uniq - sorted1.txt | |
real 0m21.387s | |
user 0m22.700s | |
sys 0m0.820s | |
$ time shuf -i 1-4294967296 -n 10000000 | sort | uniq - sorted2.txt | |
real 0m21.230s | |
user 0m22.417s | |
sys 0m0.703s | |
$ time comm -1 -2 sorted1.txt sorted2.txt > results.txt | |
real 0m2.697s | |
user 0m2.643s | |
sys 0m0.053s | |
$ wc -l results.txt | |
23129 results.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment