lkml.org 
[lkml]   [2018]   [Nov]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] mm/filemap.c: minor optimization in write_iter file operation
On Sun, Nov 18, 2018 at 08:02:18PM +0800, Yafang Shao wrote:
> This little adjustment on bitwise operation could make the code a little
> faster.
> As write_iter is used in lots of critical path, so this code change is
> useful for performance.

Did you check the before/after code generation with this patch applied?

$ diff -u before.S after.S
--- before.S 2018-11-18 07:11:48.031096768 -0500
+++ after.S 2018-11-18 07:11:36.883069103 -0500
@@ -1,5 +1,5 @@

-before.o: file format elf32-i386
+after.o: file format elf32-i386


Disassembly of section .text:
with gcc 8.2.0, I see no difference, indicating that the compiler already
makes this optimisation.

\
 
 \ /
  Last update: 2018-11-18 13:14    [W:0.044 / U:0.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site