<commit_before>package com.charlesmadere.hummingbird.misc;

import android.os.Handler;
import android.os.Looper;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public final class Threading {

    private static final ExecutorService EXECUTOR_SERVICE;
    private static final Handler MAIN_HANDLER;


    static {
        EXECUTOR_SERVICE = Executors.newFixedThreadPool(2);
        MAIN_HANDLER = new Handler(Looper.getMainLooper());
    }

    public static void runOnBackground(final Runnable task) {
        EXECUTOR_SERVICE.submit(task);
    }

    public static void runOnUi(final Runnable task) {
        MAIN_HANDLER.post(task);
    }

}
<commit_msg>slightly more threads if the device is more powerful<commit_after>package com.charlesmadere.hummingbird.misc;

import android.os.Handler;
import android.os.Looper;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public final class Threading {

    private static final ExecutorService EXECUTOR_SERVICE;
    private static final Handler MAIN_HANDLER;


    static {
        if (MiscUtils.isLowRamDevice()) {
            EXECUTOR_SERVICE = Executors.newFixedThreadPool(2);
        } else {
            EXECUTOR_SERVICE = Executors.newFixedThreadPool(3);
        }

        MAIN_HANDLER = new Handler(Looper.getMainLooper());
    }

    public static void runOnBackground(final Runnable task) {
        EXECUTOR_SERVICE.submit(task);
    }

    public static void runOnUi(final Runnable task) {
        MAIN_HANDLER.post(task);
    }

}

{'fraction_non_alphanumeric': 0.07913209955328654, 'fraction_numerical': 0.0019144862795149968, 'mean_word_length': 3.48, 'pattern_counts': {'":': 0, '<': 3, '<?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': '4629507', 'n_tokens_mistral': 496, 'n_tokens_neox': 470, 'n_words': 101}