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-prev] [day] [month] [year] [list]
Date:   Wed, 17 May 2017 16:25:01 -0700
From:   Joe Perches <joe@...ches.com>
To:     Alexey Dobriyan <adobriyan@...il.com>
Cc:     akpm@...ux-foundation.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] seq_file: delete small-value optimization

On Wed, 2017-05-17 at 13:33 +0300, Alexey Dobriyan wrote:
> > Joe Perches wrote:
> > 
> > On Tue, 2017-05-16 at 23:42 +0300, Alexey Dobriyan wrote:
> > > num_to_str() optimizes printing small integers [0..9], so the same
> > > check higher in callchain is unnecessary.
> > 
> > Doesn't the optimization exists for the frequent use of 0
> > in seq output?  
> > 
> > These seq_put_decimal calls are now slightly more expensive.
> 
> That additional CALL instruction is hardly measurable so you're adding
> branch to skip branch in the next function.

It's not the call instruction.

num_to_str pushes the value first to stack
and then sets up a loop to copy those chars
to buffer.

The current code immediately pushes to buffer.

It's a fair amount of overhead.

Have you measured it?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ