lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 16 Jun 2015 14:41:31 +0300
From:	Alexey Dobriyan <adobriyan@...il.com>
To:	richard.weinberger@...il.com
Cc:	lukes357@...il.com, Linux Kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] small update for strlen, strnlen, use less cpu instructions

> Now strlen() increments a variable for each character it faces,
> hence it will consume more cycles.

It doesn't matter if there is a dependency in a loop:

Before:
 520:   48 83 c0 01             add    $0x1,%rax
 524:   80 38 00                cmpb   $0x0,(%rax)
 527:   75 f7                   jne    520

After:
 500:   48 83 c0 01             add    $0x1,%rax
 504:   80 3c 07 00             cmpb   $0x0,(%rdi,%rax,1)
 508:   75 f6                   jne    500
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ