News for hackers. Stuff that matters.
Re:Performance comparison of Functional C++ 11, Java 8, Java... by xxs on Thursday June 05, 2014 @09:34PM (#7855748)
The main issue is that C version is hardly functional programming: stuff like array<int,3> for forest and then counting instead of massive branching like java's isStable(); Reserving the entire next_forests like that:

  next_forests.reserve(forests.size() * possible_meals.size());
helps quite a lot compared to the small header-full instances Java features.
Re:Performance comparison of Functional C++ 11, Java 8, Java... by hiker on Friday June 06, 2014 @03:57AM (#7856692)
I don't see how the use of std::array<int,3> and std::count makes the C++ version less functional. Also, the next_forests.reserve doesn't help as much as you state, it's barely measurable when commenting out from my experiments (try it out!).
Re:Performance comparison of Functional C++ 11, Java 8, Java... by pkolaczk on Friday June 06, 2014 @06:50AM (#7857107)
C++ version is not "less functional". It is not functional at all. To make it functional you'd have to use immutable state.