I'm trying to check if my tool (which analyzed damaged images) works correctly with any damaged images. And therefore in an unit-test I just try to sequentially "damage" every byte of an image and check if everything works as expected. But preliminary estimation showed that this experiment would require 94 hours on my laptop. And cpuprofile shows, that 96% of time is utlized in github.com/ulikunitz/xz/lzma.(*decoder).decompress. So I was wondering: is there a way to disable the decompression (or may be cache the results)?
Hello!
I'm trying to check if my tool (which analyzed damaged images) works correctly with any damaged images. And therefore in an unit-test I just try to sequentially "damage" every byte of an image and check if everything works as expected. But preliminary estimation showed that this experiment would require 94 hours on my laptop. And
cpuprofile
shows, that96%
of time is utlized ingithub.com/ulikunitz/xz/lzma.(*decoder).decompress
. So I was wondering: is there a way to disable the decompression (or may be cache the results)?When I just change (in
./pkg/uefi/section.go
):to
I receive a speed-up in 9.5 times.
Related: https://github.com/linuxboot/fiano/issues/311 Related: https://github.com/linuxboot/fiano/issues/302