home
/
code
/
cellular-automata.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
160a456
)
Comment explaining choice of map+to_list over fold.
author
Siraaj Khandkar
<siraaj@khandkar.net>
Thu, 9 Aug 2012 13:03:22 +0000
(09:03 -0400)
committer
Siraaj Khandkar
<siraaj@khandkar.net>
Thu, 9 Aug 2012 13:03:22 +0000
(09:03 -0400)
003/src/life.erl
patch
|
blob
|
blame
|
history
diff --git
a/003/src/life.erl
b/003/src/life.erl
index
5f91d26
..
ddb5115
100644
(file)
--- a/
003/src/life.erl
+++ b/
003/src/life.erl
@@
-94,6
+94,9
@@
do_print_status(Bar, X, Y, N, GenCount, TimeMic, PrintTimeMic) ->
do_print_board(Board) ->
+ % It seems that just doing a fold should be faster than map + to_list
+ % combo, but, after measuring several times, map + to_list has been
+ % consistently (nearly twice) faster than either foldl or foldr.
RowStrings = array:to_list(
array:map(
fun(_, Row) ->
This page took
0.028417 seconds
and
4
git commands to generate.