in reply to Re^3: Why is "any" slow in this case?
in thread Why is "any" slow in this case?
hash => sub { while ( $data =~ /^(\d+) (\d+)/mg ) { next if exists $hash{$1} or exists $hash{$2}; } return 1; }, ahead => sub { while ( $data =~ /^(?!(?:0|15|16|31)\D)(\d+)\N{SPACE} (?!(?:0|15|16|31)\D)(\d+)/mgx ) { } return 1; }, Rate hash ahead hash 1742/s -- -31% ahead 2541/s 46% --
Wow, thanks. I'll refactor with this, then. As to (1), simply generating a list of few hundred captures is slower, even without working it in pairs later. Sorry about (3), I didn't mean to reproach anyone.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^5: Why is "any" slow in this case?
by LanX (Saint) on Jul 28, 2025 at 14:14 UTC | |
by ysth (Canon) on Jul 28, 2025 at 16:17 UTC | |
by Anonymous Monk on Jul 28, 2025 at 20:20 UTC | |
by LanX (Saint) on Jul 30, 2025 at 21:41 UTC | |
by LanX (Saint) on Jul 30, 2025 at 22:18 UTC |