<commit_before>unit class Mandel;
use v6;
use SDL2::Raw;

my Int $width = 240;
my Int $height = 192;

my $hwidth = ($width /2).Int;
my $hheight = ($height/2).Int;

my Int $wid = 4;
my (Int $xcenter, Int $ycenter) = (-1,0);

my @screen[$height*4;$width*4];

constant SDL_WINDOW_SHOWN = 0x00000004;

method run(:$max_threads, :$plot) {
    my $t0 = DateTime.now.Instant;

    $PROCESS::SCHEDULER=ThreadPoolScheduler.new(initial_threads => 0, max_threads => $max_threads, uncaught_handler => Callable);

    await do for ( 0..$width) -> Int $xcoord {
        start {
            say ($xcoord/$width *100).Int ~'%' if $xcoord %% 10 and $plot;
            for ( 0..$height-1) -> Int $ycoord {

                my $ca = ($xcoord - $hwidth) / $width * $wid + $xcenter;
                my $cb = ($ycoord - $hheight) / $width * 1 * $wid + $ycenter;

                my ($res, $i) = mandelbrot($ca + $cb * i);

                my $hcolor=128;
                $hcolor=10*$i if $i;

                my $color;
                if !$res.defined {
                    $color = (0,0,0);
                }  <commit_msg>less freq % log<commit_after>unit class Mandel;
use v6;
use SDL2::Raw;

my Int $width = 240;
my Int $height = 192;

my $hwidth = ($width /2).Int;
my $hheight = ($height/2).Int;

my Int $wid = 4;
my (Int $xcenter, Int $ycenter) = (-1,0);

my @screen[$height*4;$width*4];

constant SDL_WINDOW_SHOWN = 0x00000004;

method run(:$max_threads, :$plot) {
    my $t0 = DateTime.now.Instant;

    $PROCESS::SCHEDULER=ThreadPoolScheduler.new(initial_threads => 0, max_threads => $max_threads, uncaught_handler => Callable);

    await do for ( 0..$width) -> Int $xcoord {
        start {
            say ($xcoord/$width *100).Int ~'%' if $xcoord %% 20 and $plot;
            for ( 0..$height-1) -> Int $ycoord {

                my $ca = ($xcoord - $hwidth) / $width * $wid + $xcenter;
                my $cb = ($ycoord - $hheight) / $width * 1 * $wid + $ycenter;

                my ($res, $i) = mandelbrot($ca + $cb * i);

                my $hcolor=128;
                $hcolor=10*$i if $i;

                my $color;
                if !$res.defined {
                    $color = (0,0,0);
                }  
{'fraction_non_alphanumeric': 0.16908431550317315, 'fraction_numerical': 0.038984587488667274, 'mean_word_length': 2.0068119891008176, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, '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': '1108098', 'n_tokens_mistral': 873, 'n_tokens_neox': 786, 'n_words': 202}