<commit_before>import com.github.phf.jb.Bench;
import com.github.phf.jb.Bee;

/**
 * Comparing basic operations on integers. The one thing that still seems to be
 * true these days is that division/modulo is a LOT slower than anything else.
 */
public final class BasicOps {
    private static final int COUNT = 1 << 18;
    public static int x = 10, y = 20, z = 30;
    public static int[] a = new int[COUNT];
    public static boolean c = false;

    @Bench
    public void add(Bee b) {
        for (int n = 0; n < b.reps(); n++) {
            for (int i = 0; i < COUNT; i++) {
                x = y + i;
            }
        }
    }

    @Bench
    public void subtract(Bee b) {
        for (int n = 0; n < b.reps(); n++) {
            for (int i = 0; i < COUNT; i++) {
                x = y - i;
            }
        }
    }

    @Bench
    public void multiply(Bee b) {
        for (int n = 0; n < b.reps(); n++) {
            for (int i = 0; i < COUNT; i++) {
                x = y * i;
            }
        }
    }

    @Bench
    public void divide(Bee b) {
        for (int n = 0; n < b.reps(); n++) {
            for (int i = 1; i < COUNT+1; i++) {
                x = y / i;
            }
        }
    }

    @Bench
    public void modulo(Bee b) {
        for (int n = 0; n < b.reps(); n++) {
            for (int i = 1; i < COUNT+1; i++) {
                x = y % i;
            }
        }
    }

    @Bench
    public void equals(Bee b) {
        for (int n = 0; n < b.reps(); n++) {
            for (int i = 0; i < COUNT; i++) {
                c = x == i;
            }
        }
    }

    @Bench
    public void less(Bee b) {
        for (int n = 0; n < b.reps(); n++) {
            for (int i = 0; i < COUNT; i++) {
                c = x < i;
            }
        }
    }

    @Bench
    public void and(Bee b) {
        for (int n = 0; n < b.reps(); n++) {
            for (int i = 0; i < COUNT; i++) {
                x = y & i;
            }
        }
    }

    @Bench
    public void index(Bee b) {
        for (int n = 0; n < b.reps(); n++) {
            for (int i = 0; i < COUNT; i++) {
                x = a[i];
            }
        }
    }
}
<commit_msg>Larger to show indexing more clearly.<commit_after>import com.github.phf.jb.Bench;
import com.github.phf.jb.Bee;

/**
 * Comparing basic operations on integers. The one thing that still seems to be
 * true these days is that division/modulo is a LOT slower than anything else.
 */
public final class BasicOps {
    private static final int COUNT = 1 << 21;
    public static int x = 10, y = 20, z = 30;
    public static int[] a = new int[COUNT];
    public static boolean c = false;

    @Bench
    public void add(Bee b) {
        for (int n = 0; n < b.reps(); n++) {
            for (int i = 0; i < COUNT; i++) {
                x = y + i;
            }
        }
    }

    @Bench
    public void subtract(Bee b) {
        for (int n = 0; n < b.reps(); n++) {
            for (int i = 0; i < COUNT; i++) {
                x = y - i;
            }
        }
    }

    @Bench
    public void multiply(Bee b) {
        for (int n = 0; n < b.reps(); n++) {
            for (int i = 0; i < COUNT; i++) {
                x = y * i;
            }
        }
    }

    @Bench
    public void divide(Bee b) {
        for (int n = 0; n < b.reps(); n++) {
            for (int i = 1; i < COUNT+1; i++) {
                x = y / i;
            }
        }
    }

    @Bench
    public void modulo(Bee b) {
        for (int n = 0; n < b.reps(); n++) {
            for (int i = 1; i < COUNT+1; i++) {
                x = y % i;
            }
        }
    }

    @Bench
    public void equals(Bee b) {
        for (int n = 0; n < b.reps(); n++) {
            for (int i = 0; i < COUNT; i++) {
                c = x == i;
            }
        }
    }

    @Bench
    public void less(Bee b) {
        for (int n = 0; n < b.reps(); n++) {
            for (int i = 0; i < COUNT; i++) {
                c = x < i;
            }
        }
    }

    @Bench
    public void and(Bee b) {
        for (int n = 0; n < b.reps(); n++) {
            for (int i = 0; i < COUNT; i++) {
                x = y & i;
            }
        }
    }

    @Bench
    public void index(Bee b) {
        for (int n = 0; n < b.reps(); n++) {
            for (int i = 0; i < COUNT; i++) {
                x = a[i];
            }
        }
    }
}

{'fraction_non_alphanumeric': 0.14834166288050887, 'fraction_numerical': 0.013175829168559746, 'mean_word_length': 1.1036789297658862, 'pattern_counts': {'":': 0, '<': 45, '<?xml version=': 0, '>': 3, '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': '1818313', 'n_tokens_mistral': 1639, 'n_tokens_neox': 1510, 'n_words': 521}