<commit_before>/***************************************************************************
 *            stack_benchmark.cpp
 *
 *  Wed Jul 12 18:28:43 2006
 *  Copyright  2006  User <NAME>
 *  Email
 ****************************************************************************/

#include "stxxl.h"

#define MEM_2_RESERVE    (768 * 1024 * 1024)

#ifndef BLOCK_SIZE
 #define    BLOCK_SIZE (2 * 1024 * 1024)
#endif

#ifndef DISKS
 #define DISKS 4
#endif

template <unsigned RECORD_SIZE>
struct my_record_
{
    char data[RECORD_SIZE];
    my_record_() { }
};

template <unsigned RECORD_SIZE>
inline std::ostream & operator << (std::ostream & o, const my_record_<RECORD_SIZE> &)
{
    o << ".";
    return o;
}

template <class my_record>
void run_stxxl_growshrink2_stack(stxxl::int64 volume)
{
    typedef typename stxxl::STACK_GENERATOR<my_record, stxxl::external,
                                            stxxl::grow_shrink2, DISKS, BLOCK_SIZE>::result stack_type;
    typedef typename stack_type::block_type block_type;

    STXXL_MSG("Record size: " << sizeof(my_record) << " bytes");

    stxxl::prefetch_pool<block_type> p_pool(DISKS * 4);
    stxxl::write_pool<block_type>    w_pool(DISKS * 4);

    stack_type Stack(p_pool, w_pool);

    stxxl::int64 ops = volume / sizeof(my_record);

    stxxl::int64 i;

    my_record cur;

    stxxl::stats * Stats = stxxl::stats::get_instance();<commit_msg>initialize unused data to avoid warning when copying<commit_after>/***************************************************************************
 *            stack_benchmark.cpp
 *
 *  Wed Jul 12 18:28:43 2006
 *  Copyright  2006  <NAME> Dementiev
 *  Email
 ****************************************************************************/

#include "stxxl.h"

#define MEM_2_RESERVE    (768 * 1024 * 1024)

#ifndef BLOCK_SIZE
 #define    BLOCK_SIZE (2 * 1024 * 1024)
#endif

#ifndef DISKS
 #define DISKS 4
#endif

template <unsigned RECORD_SIZE>
struct my_record_
{
    char data[RECORD_SIZE];
    my_record_()
    {
        bzero(data, sizeof(data));
    }
};

template <unsigned RECORD_SIZE>
inline std::ostream & operator << (std::ostream & o, const my_record_<RECORD_SIZE> &)
{
    o << ".";
    return o;
}

template <class my_record>
void run_stxxl_growshrink2_stack(stxxl::int64 volume)
{
    typedef typename stxxl::STACK_GENERATOR<my_record, stxxl::external,
                                            stxxl::grow_shrink2, DISKS, BLOCK_SIZE>::result stack_type;
    typedef typename stack_type::block_type block_type;

    STXXL_MSG("Record size: " << sizeof(my_record) << " bytes");

    stxxl::prefetch_pool<block_type> p_pool(DISKS * 4);
    stxxl::write_pool<block_type>    w_pool(DISKS * 4);

    stack_type Stack(p_pool, w_pool);

    stxxl::int64 ops = volume / sizeof(my_record);

    stxxl::int64 i;

    my_record cur;

    stxxl::stats * Stats = stxxl::stats::get_instance();
{'fraction_non_alphanumeric': 0.21125302036589574, 'fraction_numerical': 0.03313772868484639, 'mean_word_length': 3.9285714285714284, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3372105', 'n_tokens_mistral': 1052, 'n_tokens_neox': 924, 'n_words': 200}