Please sign in to comment.
SI-2818 Make List.foldRight always do a reverse/foldLeft flip
Benchmarks show that lists smaller than 110 elements or so doing reverse/foldLeft is faster than recursively walking to the end of the list and then folding as the stack unwinds. Above that 110 element threshold the recursive procedure is faster. Unfortunately, at some magic unknown large size the recursive procedure blows the stack. This commit changes List#foldRight to always do reverse/foldLeft.
- Loading branch information...
Showing with 13 additions and 0 deletions.