Questions : grep package : Ubuntu
File is http://
$ docker run –rm -it -v `pwd`:/host ubuntu:latest bash
root@c45afb5dff
PRETTY_NAME=”Ubuntu 22.04.3 LTS”
NAME=”Ubuntu”
VERSION_ID=”22.04″
VERSION=”22.04.3 LTS (Jammy Jellyfish)”
VERSION_
ID=ubuntu
ID_LIKE=debian
HOME_URL=”https:/
SUPPORT_URL=”https:/
BUG_REPORT_URL=”https:/
PRIVACY_
UBUNTU_
root@c45afb5dff
real 0m14.835s
user 0m12.692s
sys 0m3.912s
root@c45afb5dff
real 0m12.363s
user 0m11.466s
sys 0m2.815s
root@c45afb5dff
real 0m12.453s
user 0m11.326s
sys 0m3.061s
root@c45afb5dff
exit
$ docker run –rm -it -v `pwd`:/host centos:latest bash
[root@00e709d9037f /]# cat /etc/os-release
NAME=”CentOS Linux”
VERSION=”8″
ID=”centos”
ID_LIKE=”rhel fedora”
VERSION_ID=”8″
PLATFORM_
PRETTY_NAME=”CentOS Linux 8″
ANSI_COLOR=”0;31″
CPE_NAME=
HOME_URL=”https:/
BUG_REPORT_URL=”https:/
CENTOS_
CENTOS_
[root@00e709d9037f /]# time (for i in {1..10000}; do grep -q -m 1 -F “Revamped debian” /host/grep_
real 0m11.617s
user 0m9.789s
sys 0m2.781s
[root@00e709d9037f /]# time (for i in {1..10000}; do grep -q -m 1 -F “Revamped debian” /host/grep_
real 0m11.567s
user 0m9.838s
sys 0m2.704s
[root@00e709d9037f /]# time (for i in {1..10000}; do grep -q -m 1 -F “Revamped debian” /host/grep_
real 0m12.013s
user 0m9.798s
sys 0m2.983s
[root@00e709d9037f /]#
Any ideas how to speed up Ubuntu’s version ?
Read more here: Source link
