js/cpp traversal benchmark (stack vs recursive)