<commit_before>#include <chrono>

#include "ParallelAndNaive.h"
#include "SequentialAnd.h"

using Clock = std::chrono::high_resolution_clock;
using std::chrono::duration_cast;
using std::chrono::microseconds;

void test(const char* info, MultipleAndInterface& ma, const std::vector<bitvector*> input) {

    assert(input.size() >= 2);

    printf("%-20s (%lu bitmaps): ", info, input.size());
    fflush(stdout);

    const auto t1 = Clock::now();
    auto res = ma.calculate();
    const auto t2 = Clock::now();

    const auto t_us = duration_cast<microseconds>(t2 - t1).count();
    printf("%luus [cardinality=%lu]\n", t_us, res->cardinality());
}

int main() {
    
    const size_t bitmap_size = 10000000;
    const size_t count = 20;

    std::vector<bitvector*> input;
    srand(0);
    for (size_t i=0; i < count; i++) {
        bitvector* bv = new bitvector(bitmap_size);
        bv->fill_random(50);

        input.push_back(bv);
    }

    SequentialAnd seq(input);
    test("SequentialAnd", seq, input);

    ParallelAndNaive par1(input, 8);
    test("ParallelAndNaive", par1, input);
}<commit_msg>Change parameters<commit_after>#include <chrono>

#include "ParallelAndNaive.h"
#include "SequentialAnd.h"

using Clock = std::chrono::high_resolution_clock;
using std::chrono::duration_cast;
using std::chrono::microseconds;

void test(const char* info, MultipleAndInterface& ma, const std::vector<bitvector*> input) {

    assert(input.size() >= 2);

    printf("%-20s (%lu bitmaps): ", info, input.size());
    fflush(stdout);

    const auto t1 = Clock::now();
    auto res = ma.calculate();
    const auto t2 = Clock::now();

    const auto t_us = duration_cast<microseconds>(t2 - t1).count();
    printf("%luus [cardinality=%lu]\n", t_us, res->cardinality());
}

int main() {
    
    const size_t bitmap_size = 2000000;
    const size_t count = 100;

    std::vector<bitvector*> input;
    srand(0);
    for (size_t i=0; i < count; i++) {
        bitvector* bv = new bitvector(bitmap_size);
        bv->fill_random(50);

        input.push_back(bv);
    }

    SequentialAnd seq(input);
    test("SequentialAnd", seq, input);

    ParallelAndNaive par1(input, 4);
    test("ParallelAndNaive", par1, input);
}
{'fraction_non_alphanumeric': 0.15827338129496402, 'fraction_numerical': 0.02158273381294964, 'mean_word_length': 3.8580786026200875, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 1, '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': '1757252', 'n_tokens_mistral': 814, 'n_tokens_neox': 760, 'n_words': 173}