]> code.ossystems Code Review - openembedded-core.git/commit
sstate.bbclass: set SSTATE_EXTRAPATHWILDCARD explicitly
authorRobert Yang <liezhi.yang@windriver.com>
Thu, 22 Nov 2018 11:51:59 +0000 (19:51 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 22 Nov 2018 12:19:26 +0000 (12:19 +0000)
commit8b31c919814b8bdf25b3381053656523c001ae0d
tree6b37b6be29ae5f6c3c46d4c3f03c20df42fa5c44
parent07b59afd52244410d8d833e6dfe262d952e5e344
sstate.bbclass: set SSTATE_EXTRAPATHWILDCARD explicitly

The glob.glob("/sstate/*/*/") is very time consuming, set
SSTATE_EXTRAPATHWILDCARD explicity to avoid that. This can save a lot of time
when there are many sstate files.

For example, I have more than 600,000 sstate files:
* Before
  - Without disk caches
  $ time python3 -c 'import glob; glob.glob("/sstate-cache/*/*/sstate:quilt-native:x86_64-linux:0.65:r0:x86_64:3:*_populate_sysroot.tgz*")'
    real    4m32.583s
    user    0m5.768s
    sys     0m12.892s

  - With disk caches
  $ time python3 -c 'import glob; glob.glob("/sstate-cache/*/*/sstate:quilt-native:x86_64-linux:0.65:r0:x86_64:3:*_populate_sysroot.tgz*")'
  real    0m4.111s
  user    0m2.348s
  sys     0m1.756s

* After
  $ time python3 -c 'import glob; glob.glob("/sstate-cache.bak/universal/*/sstate:quilt-native:x86_64-linux:0.65:r0:x86_64:3:*_populate_sysroot.tgz*")'
  - Without disk caches:
  real    0m7.928s
  user    0m0.172s
  sys     0m0.124s

  - With disk caches:
  real    0m0.131s
  user    0m0.088s
  sys     0m0.044s

We can see that it saves about 3.8s with disk caches, and saves about 264s
without disk caches.

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/sstate.bbclass