Skip to content

Commit

Permalink
Only hyperize large files if no max number of matches
Browse files Browse the repository at this point in the history
This is really a stopgap measure until we can actually terminate
something hypered immediately
  • Loading branch information
lizmat committed May 14, 2024
1 parent 0b767c1 commit c37146e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 3 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
Revision history for rak

{{$NEXT}}
- Only hyperize large files if we don't have a maximum number
of matches. This is really a stopgap measure until we can
actually terminate something hypered immediately

0.0.55 2024-05-14T12:46:38+02:00
- Fix issue with ":unicode" option
Expand Down
8 changes: 5 additions & 3 deletions lib/rak.rakumod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The modules that we need here, with their full identities
use Git::Files:ver<0.0.6>:auth<zef:lizmat>; # git-files
use hyperize:ver<0.0.2>:auth<zef:lizmat>; # hyperize raceize
use hyperize:ver<0.0.2>:auth<zef:lizmat>; # hyperize racify
use paths:ver<10.0.9>:auth<zef:lizmat> 'paths'; # paths
use path-utils:ver<0.0.18>:auth<zef:lizmat>; # path-*
use Trap:ver<0.0.1>:auth<zef:lizmat>; # Trap
Expand Down Expand Up @@ -1038,8 +1038,10 @@ multi sub rak(&pattern, %n) {
my $seq := $source.lines(:$chomp, :$enc);

# Hyperize files of more than 2 MB
$seq := $seq.hyper(:batch(4096))
if $is-IO && $source.s > 2097152;
$seq := $seq.&hyperize(4096, $degree)
if !$max-matches-per-source
&& $is-IO
&& $source.s > 2097152;

my int $line-number;
$item-number
Expand Down

0 comments on commit c37146e

Please sign in to comment.