Optimize `avbtool add_hashtree_footer`
On one of our internal devices, creating the system.img was taking ~20s, of which 15s of that was in `avbtool add_hashtree_footer`. Since we create the system image during most builds, and are relatively serialized during this time, the time taken matters. Of the 15s in avbtool, about 5s was taken within _read_header (once when initially opening the image, then 4 calls to append_raw and a call to append_dont_care). Then 7 seconds to calculate the level 0 hashes, and 3 seconds for fec encode. It turns out that the vast majority of the time in _read_header was spent reading (then discarding) the data from the raw chunks. So turn that into a seek() call instead. Test: avbtool verify Change-Id: I03187c20b3721a26e128cdf82c5399249d36a286
Loading
Please sign in to comment