Last active
January 3, 2016 06:09
-
-
Save sgillies/8420859 to your computer and use it in GitHub Desktop.
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
| MapBox-FC:multi sean$ time parallel --progress go run test.go ::: {1..20} | |
| Computers / CPU cores / Max jobs to run | |
| 1:local / 4 / 4 | |
| Computer:jobs running/jobs completed/%of started jobs/Average seconds to complete | |
| local:0/20/100%/0.1s | |
| real 0m0.733s | |
| user 0m1.559s | |
| sys 0m0.577s | |
| MapBox-FC:multi sean$ time parallel --progress --use-cpus-instead-of-cores go run test.go ::: {1..20} | |
| Computers / CPU cores / Max jobs to run | |
| 1:local / 2 / 2 | |
| Computer:jobs running/jobs completed/%of started jobs/Average seconds to complete | |
| local:0/20/100%/0.1s | |
| real 0m0.968s | |
| user 0m1.145s | |
| sys 0m0.463s |
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
| MapBox-FC:multi sean$ time parallel --progress -j 1 go run test.go ::: {1..20} | |
| Computers / CPU cores / Max jobs to run | |
| 1:local / 4 / 1 | |
| Computer:jobs running/jobs completed/%of started jobs/Average seconds to complete | |
| local:0/20/100%/0.1s | |
| real 0m1.662s | |
| user 0m1.094s | |
| sys 0m0.447s | |
| MapBox-FC:multi sean$ time parallel --progress -j 4 go run test.go ::: {1..20} | |
| Computers / CPU cores / Max jobs to run | |
| 1:local / 4 / 4 | |
| Computer:jobs running/jobs completed/%of started jobs/Average seconds to complete | |
| local:0/20/100%/0.0s | |
| real 0m0.737s | |
| user 0m1.551s | |
| sys 0m0.591s |
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
| MapBox-FC:multi sean$ time parallel --progress -j 1 python test.py ::: {1..20} | |
| Computers / CPU cores / Max jobs to run | |
| 1:local / 4 / 1 | |
| Computer:jobs running/jobs completed/%of started jobs/Average seconds to complete | |
| local:0/20/100%/0.5s | |
| real 0m9.872s | |
| user 0m8.994s | |
| sys 0m0.232s | |
| MapBox-FC:multi sean$ time parallel --progress -j 4 python test.py ::: {1..20} | |
| Computers / CPU cores / Max jobs to run | |
| 1:local / 4 / 4 | |
| Computer:jobs running/jobs completed/%of started jobs/Average seconds to complete | |
| local:0/20/100%/0.2s | |
| real 0m4.495s | |
| user 0m16.083s | |
| sys 0m0.297s |
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
| from multiprocessing import Pool | |
| def countdown(n): | |
| while n > 0: | |
| n -= 1 | |
| COUNT = 10000000 # 10 million | |
| if __name__ == '__main__': | |
| pool = Pool() # multiprocessing.cpu_count() = 4 | |
| result = pool.map(countdown, 20*[COUNT]) |
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
| MapBox-FC:multi sean$ time python multi.py | |
| real 0m4.361s | |
| user 0m14.655s | |
| sys 0m0.047s |
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
| package main | |
| func countdown(n int) { | |
| for n > 0 { | |
| n -= 1 | |
| } | |
| } | |
| func main() { | |
| COUNT := 10000000 | |
| countdown(COUNT) | |
| } |
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
| def countdown(n): | |
| while n > 0: | |
| n -= 1 | |
| COUNT = 10000000 # 10 million | |
| countdown(COUNT) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment