max_element perf added