Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- substrcmp() {
- local x y z
- x=${#1}; y=${1#*$2}; z=${#y}
- [ $x -ne $z ]
- }
- date --rfc-3339=ns
- for i in $(seq 1 20000); do
- echo "abc${i}def%Fzyx" | grep -Fqe '%F'
- done
- date --rfc-3339=ns
- # 2018-04-19 00:39:20.956273584
- # 2018-04-19 00:39:36.707469684
- date --rfc-3339=ns
- for i in $(seq 1 20000); do
- substrcmp "abc${i}def%Fzyx" '%F'
- done
- date --rfc-3339=ns
- # 2018-04-19 00:39:20.863260849
- # 2018-04-19 00:39:20.955660959
- date --rfc-3339=ns
- for i in $(seq 1 2000); do
- echo "abc${i}def%Fzyx" | grep -Fqe '%F'
- done
- date --rfc-3339=ns
- # 2018-04-19 00:40:49.657582863
- # 2018-04-19 00:40:51.202037260
- date --rfc-3339=ns
- for i in $(seq 1 2000); do
- substrcmp "abc${i}def%Fzyx" '%F'
- done
- date --rfc-3339=ns
- # 2018-04-19 00:40:49.647043516
- # 2018-04-19 00:40:49.656980633
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement