Skip to content

Make function clones a lot cheaper

AdminXVII requested to merge AdminXVII/ion:cheaper-function-clones into master

Use Rc to reduce the cost of function cloning.

In terms of performance, this is a 20% speed boost with this benchmark:

fn demo
    echo a > /dev/null
    echo a > /dev/null
    echo a > /dev/null
    echo a > /dev/null
    echo a > /dev/null
    echo a > /dev/null
    echo a > /dev/null
    echo a > /dev/null
end

for _ in 0..=1000000
    demo
end

Merge request reports