Based on profiling the C++, this seems to be more a benchmark of function call cost in various languages than anything else - this code makes 42975348 calls to
int getLongestPath<16>(std::vector<node, std::allocator<node> > const&, int, std::bitset<16>)
Which is fine, but seems a slightly limited platform / language comparison!