The OpenNET Project / Index page

[ новости /+++ | форум | теги | ]



Индекс форумов
Составление сообщения

Исходное сообщение
"Выпуск языка программирования Rust 1.38"
Отправлено Аноним84701, 28-Сен-19 00:31 
> Как там насчёт сравнения с The Silver Searcher (ag), написанном на C?
>> Regex searching uses PCRE's JIT compiler (if Ag is built with PCRE >=8.21).

Угу, угу.


% ag --version                                                                          
ag version 2.2.0
Features:
  +jit +lzma +zlib

% rg --version
ripgrep 11.0.2
+SIMD -AVX (compiled) # это конечно круто, но AVX тута вот нема :)
+SIMD -AVX (runtime)

% time rg -uuui "sizeof\([a-z].*[0-9]\)" /somelargeproject |wc -l
   11691
rg -uuui "sizeof\([a-z].*[0-9]\)" /somelargeproject  3,46s user 3,29s system 376% cpu 1,795 total

% time rg -i "sizeof\([a-z].*[0-9]\)" /somelargeproject |wc -l
   11687
rg -i "sizeof\([a-z].*[0-9]\)" /somelargeproject  3,61s user 3,10s system 377% cpu 1,777 total

% time ag -iur "sizeof\([a-zA-Z].*[0-9]\)" /somelargeproject |wc -l
   11691
ag -iur "sizeof\([a-zA-Z].*[0-9]\)" /somelargeproject  3,39s user 3,88s system 350% cpu 2,073 total
wc -l  0,00s user 0,03s system 1% cpu 2,068 total

% 3,24s user 4,40s system 353% cpu 2,161 total

% 3,39s user 3,88s system 350% cpu 2,073 total


без опции -u (11687 результатов)

3,01s user 3,65s system 337% cpu 1,975 total
3,05s user 3,35s system 339% cpu 1,883 total


три прогона


% time rg -uuui uint16 /somelargeproject |wc -l                                                  
   40925
rg -uuui uint16 /somelargeproject  2,50s user 3,08s system 372% cpu 1,497 total
wc -l  0,01s user 0,03s system 2% cpu 1,492 total

% time ag -iur uint16 /somelargeproject|wc -l
   40925
ag -iur uint16 /somelargeproject  3,36s user 3,52s system 284% cpu 2,416 total
wc -l  0,00s user 0,03s system 1% cpu 2,411 total

% 3,23s user 3,48s system 282% cpu 2,372 total

% 3,16s user 3,70s system 286% cpu 2,398 total


немного синтетики:

% seq 100000000 > testit  # tmpfs
% echo foobar >> testit
% time ag -ic f testit
1        # посл. строчки с reзультатом я вырезал - итак слишком длинная простыня получилась
ag -ic f testit  6,72s user 0,14s system 99% cpu 6,871 total
%2 6,73s user 0,17s system 99% cpu 6,908 total
%3  6,63s user 0,14s system 99% cpu 6,785 total

% time grep -ic f testit
/usr/bin/grep --color=auto -ic f testit  2,06s user 0,31s system 99% cpu 2,375 total

% time rg -ic f testit
rg -ic f testit  0,31s user 0,22s system 99% cpu 0,533 total
=========
% time ag -ic foobar testit
ag -ic foobar testit  0,61s user 0,14s system 99% cpu 0,754 total
%2  0,78s user 0,22s system 99% cpu 1,004 total
%3  0,69s user 0,21s system 99% cpu 0,903 total

% time rg -ic foobar testit
rg -ic foobar testit  0,80s user 0,17s system 99% cpu 0,974 total
%2  0,78s user 0,13s system 99% cpu 0,908 total
%3  0,69s user 0,18s system 99% cpu 0,879 total

% time /usr//bin/grep -ic foobar testit
/usr/bin/grep -ic foobar testit  2,21s user 0,23s system 99% cpu 2,445 total
%2  2,27s user 0,23s system 99% cpu 2,496 total
%3 2,24s user 0,24s system 99% cpu 2,479 total
==========
% time rg -ic 1 testit  
56953280
rg -ic 1 testit  6,52s user 0,13s system 99% cpu 6,663 total

% time /usr/bin/grep -ic 1 testit
56953280
/usr/bin/grep -ic 1 testit  4,49s user 0,31s system 99% cpu 4,803 total

% time ag -ic 1 testit
80000001 # похоже, оно считает не строки, а кол. матчей
ag -ic 1 testit  8,14s user 1,04s system 99% cpu 9,188 total
=========
# далее по просты^W тексту просто взято лучшее время из 3 запусков
=========
% time ag -ic "12.[1-3]4" testit
119940
ag -ic "12.[1-3]4" testit  1,75s user 0,14s system 99% cpu 1,899 total

% time /usr/bin/grep -ic "12.[1-3]4" testit
/usr/bin/grep -ic "12.[1-3]4" testit  2,58s user 0,25s system 99% cpu 2,843 total

% time rg -ic "12.[1-3]4" testit
rg -ic "12.[1-3]4" testit  2,49s user 0,11s system 99% cpu 2,606 total
===========
% time /usr/bin/grep -ic "^1" testit
11111112
/usr/bin/grep -ic "^1" testit  2,68s user 0,27s system 99% cpu 2,971 total

% time ag -ic "^1" testit
ag -ic "^1" testit  2,27s user 0,27s system 99% cpu 2,546 total

% time rg -ic "^1" testit
rg -iuuc "^1" testit  9,93s user 0,13s system 99% cpu 10,057 total
===========
% time rg -ic "1001" testit
49979
rg -ic "1001" testit  1,15s user 0,16s system 99% cpu 1,313 total
% time ag -ic "1001" testit
49980
ag -ic "1001" testit  0,74s user 0,23s system 99% cpu 0,974 total
% time /usr/bin/grep -ic "1001" testit
49979
/usr/bin/grep -ic "1001" testit  2,56s user 0,31s system 99% cpu 2,870 total


 

Ваше сообщение
Имя*:
EMail:
Для отправки ответов на email укажите знак ! перед адресом, например, !user@host.ru (!! - не показывать email).
Более тонкая настройка отправки ответов производится в профиле зарегистрированного участника форума.
Заголовок*:
Сообщение*:
 
При общении не допускается: неуважительное отношение к собеседнику, хамство, унизительное обращение, ненормативная лексика, переход на личности, агрессивное поведение, обесценивание собеседника, провоцирование флейма голословными и заведомо ложными заявлениями. Не отвечайте на сообщения, явно нарушающие правила - удаляются не только сами нарушения, но и все ответы на них. Лог модерирования.



Партнёры:
PostgresPro
Inferno Solutions
Hosting by Hoster.ru
Хостинг:

Закладки на сайте
Проследить за страницей
Created 1996-2024 by Maxim Chirkov
Добавить, Поддержать, Вебмастеру