<commit_before>import java.io.File;
import java.io.IOException;
import java.net.InetAddress;
import java.util.Random;

import com.fasterxml.jackson.databind.JsonNode;
import com.google.common.net.InetAddresses;
import com.maxmind.maxminddb.InvalidDatabaseException;
import com.maxmind.maxminddb.MaxMindDbReader;
import com.maxmind.maxminddb.MaxMindDbReader.FileMode;

public class Benchmark {

    public static void main(String[] args) throws IOException,
            InvalidDatabaseException {
        File file = new File("GeoIP2-City.mmdb");

        MaxMindDbReader r = new MaxMindDbReader(file, FileMode.MEMORY_MAPPED);
        Random random = new Random();
        int count = 1000000;
        long startTime = System.nanoTime();
        for (int i = 0; i < count; i++) {
            InetAddress ip = InetAddresses.fromInteger(random.nextInt());
            if (i % 50000 == 0) {
                System.out.println(i + " " + ip);
            }
            JsonNode t = r.get(ip);
        }
        long endTime = System.nanoTime();<commit_msg>Use GeoLIte2 in benchmark example<commit_after>import java.io.File;
import java.io.IOException;
import java.net.InetAddress;
import java.util.Random;

import com.fasterxml.jackson.databind.JsonNode;
import com.google.common.net.InetAddresses;
import com.maxmind.maxminddb.InvalidDatabaseException;
import com.maxmind.maxminddb.MaxMindDbReader;
import com.maxmind.maxminddb.MaxMindDbReader.FileMode;

public class Benchmark {

    public static void main(String[] args) throws IOException,
            InvalidDatabaseException {
        File file = new File("GeoLite2-City.mmdb");

        MaxMindDbReader r = new MaxMindDbReader(file, FileMode.MEMORY_MAPPED);
        Random random = new Random();
        int count = 1000000;
        long startTime = System.nanoTime();
        for (int i = 0; i < count; i++) {
            InetAddress ip = InetAddresses.fromInteger(random.nextInt());
            if (i % 50000 == 0) {
                System.out.println(i + " " + ip);
            }
            JsonNode t = r.get(ip);
        }
        long endTime = System.nanoTime();
{'fraction_non_alphanumeric': 0.10744580584354382, 'fraction_numerical': 0.014608859566446749, 'mean_word_length': 2.8252252252252252, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '5178272', 'n_tokens_mistral': 686, 'n_tokens_neox': 627, 'n_words': 143}