Skip to content

Instantly share code, notes, and snippets.

@evrim
Created November 15, 2012 01:49
Show Gist options
  • Save evrim/4076142 to your computer and use it in GitHub Desktop.
Save evrim/4076142 to your computer and use it in GitHub Desktop.
parallel & tail recursive vectorSpace
vectorSpace_F2'' 0 acc = acc
vectorSpace_F2'' n acc = vectorSpace_F2'' (n-1) $ concatMap f acc
where f x = a `par` [a,(Bir:x)]
where a = (Sifir:x)
vvectorSpace_F2 n = vectorSpace_F2'' n [[Sifir],[Bir]]
main = do
print $ length $ vvectorSpace_F2 $ 2^5
evrim@evrim ~/haskell $ time ./crypto +RTS -K1G -M2G -N4 -RTS
8589934592
real 32m42.499s
user 55m11.760s
sys 6m40.270s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment