bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 0/4] Use AF_ALG in checksum utilities


From: Bruno Haible
Subject: Re: [PATCH 0/4] Use AF_ALG in checksum utilities
Date: Tue, 24 Apr 2018 15:19:33 +0200
User-agent: KMail/5.1.3 (Linux/4.4.0-119-generic; KDE/5.18.0; x86_64; ; )

Hi Matteo,

> If not using an HW crypto engine, the code doesn't have locks, but I
> tried it anyway on a quad core machine:
> 
> $ time ./sha1sum 2g.bin
> 752ef2367f479e79e4f0cded9c270c2890506ab0  2g.bin
> 
> real    0m2.198s
> user    0m0.000s
> sys     0m2.198s
> $ for i in {1..4}; do time ./sha1sum 2g.bin & done
> [1] 27893
> [2] 27894
> [3] 27896
> [4] 27897
> 752ef2367f479e79e4f0cded9c270c2890506ab0  2g.bin
> 
> real    0m2.367s
> user    0m0.001s
> sys     0m2.367s
> 752ef2367f479e79e4f0cded9c270c2890506ab0  2g.bin
> 
> real    0m2.374s
> user    0m0.000s
> sys     0m2.365s
> 752ef2367f479e79e4f0cded9c270c2890506ab0  2g.bin
> 
> real    0m2.383s
> user    0m0.001s
> sys     0m2.383s
> 752ef2367f479e79e4f0cded9c270c2890506ab0  2g.bin
> 
> real    0m2.383s
> user    0m0.001s
> sys     0m2.382s
> 
> [1]   Done                    time ./sha1sum 2g.bin
> [2]   Done                    time ./sha1sum 2g.bin
> [3]-  Done                    time ./sha1sum 2g.bin
> [4]+  Done                    time ./sha1sum 2g.bin

So there is no bottleneck here. Perfect.

> If you're using an HW crypto engine, locking can happen depending on
> how the hardware works, but such chips can be 100x faster than CPUs so
> it's not an issue.

This is understandable. Should be a win anyway, even with a small number
of processes or threads operating in parallel.

Thanks for the clarifications!

Bruno




reply via email to

[Prev in Thread] Current Thread [Next in Thread]