<commit_before>

// -*- rust -*-
fn fib(n: int) -> int {


    // Several of the posted 'benchmark' versions of this compute the
    // wrong Fibonacci numbers, of course.
    if n == 0 {
        ret 0;
    } else { if n <= 2 { ret 1; } else { ret fib(n - 1) + fib(n - 2); } }
}

fn main() {
    assert (fib(8) == 21);
    assert (fib(15) == 610);
    log(debug, fib(8));
    log(debug, fib(15));
}<commit_msg>bench: Update shootout-fibo for performance<commit_after>use std;

fn fib(n: int) -> int {
    if n < 2 {
        ret 1;
    } else {
        ret fib(n - 1) + fib(n - 2);
    }
}

fn main(args: [str]) {
    // FIXME: #1527
    sys::set_min_stack(1000000u);
    let n = if vec::len(args) == 2u {
        int::from_str(args[1])
    } else {
        40
    };
    std::io::println(#fmt("%d\n", fib(n)));
}
{'fraction_non_alphanumeric': 0.1921182266009852, 'fraction_numerical': 0.04433497536945813, 'mean_word_length': 2.056390977443609, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3844833', 'n_tokens_mistral': 345, 'n_tokens_neox': 311, 'n_words': 87}