Hi Derek,

I took a look at this issue, and add back the –hash functionality in this branch: https://github.com/shijunjing/edk2/tree/hashcache_v1. The attachment is the patch based on latest edk2.

The current –hash fix performance is not as good as the edk2-stable201905,  because the edk2-stable201905 –hash doesn’t parse source code header files and not include the header files as the module’s hash dependency which is not sound. After add the header files dependency, the –hash become slow.

Let me know whether the attached fix works for you. I might continue to tune its performance.

 

 

Thanks

 

Steven Shi

Intel\SSG\FID\Firmware Infrastructure

 

From: Shi, Steven
Sent: Monday, September 23, 2019 3:52 PM
To: 'Lin, Derek (HPS SW)' <derek.lin2@hpe.com>; devel@edk2.groups.io
Cc: Feng, Bob C <bob.c.feng@intel.com>; Gao, Liming (liming.gao@intel.com) <liming.gao@intel.com>
Subject: RE: BaseTools --hash malfunction after migrate from stable201905 to stable201908

 

Hi Derek,

Thank you to raise this issue. We will fix it and add back the --hash original functionality.

 

 

Thanks

Steven

 

From: Lin, Derek (HPS SW) [mailto:derek.lin2@hpe.com]
Sent: Friday, September 20, 2019 2:54 PM
To: devel@edk2.groups.io
Cc: Feng, Bob C <bob.c.feng@intel.com>; Shi, Steven <steven.shi@intel.com>
Subject: BaseTools --hash malfunction after migrate from stable201905 to stable201908

 

Hi BaseTools experts,

 

We saw the clean build performance improvement after updating from edk2-stable201905 to edk2-stable201908, which is promising.

But we found the incremental build time increase 25%~35%, which is not good.

 

We’re building server platform. And we use --hash to speed up incremental build as described in https://github.com/BobCF/edk2/wiki/Incremental-Build

After upgrading to edk2-stable201908, none of AutoGen is skipped when I did an incremental build without any code change.

 

Dig into the issue, it is caused by commit https://github.com/tianocore/edk2/commit/0e7e7a264cd80ab71ea0f9e9da2d0617d4b539c4

From the code change logic, it seems like it require both --hash and --binary-source to perform cache based incremental build. However, when we only have --hash in build flag, it is not functional.

 

 

Here’s a build time log retrieved from -y report.log.

 

                                        201905 incremental |  201908 incremental |      201905 clean |     201908 clean 

Build Duration:                00:03:44                        00:04:40                            00:07:12                 00:06:19

AutoGen Duration:          00:02:40                        00:03:15                            00:04:28                 00:03:09

Make Duration:                00:00:36                        00:00:39                            00:01:21                 00:01:34

GenFds Duration:             00:00:27                        00:00:28                            00:01:22                 00:01:18  

 

We could see the AutoGen Duration has almost no change between clean and incremental build in 201908.

 

Could we fix this?

 

Thanks,

Derek