libnxz / power-gzip

POWER NX zlib compliant library
23 stars 18 forks source link

Switch to software if NX is spending too much time in a job #159

Closed rzinsly closed 2 years ago

rzinsly commented 2 years ago

Measure the average time spent on NX jobs and fallback to software if it is greater than our threshold. I'm keeping it as draft for now because I'm not sure which value should be used as threshold yet. This seems to solve #152 as well.

rzinsly commented 2 years ago

I rebased on top of develop and added code to decrease avg_delay when we choose software, otherwise after the switch we stop measuring time and never go back to NX.

rzinsly commented 2 years ago

I split the threshold values between compression and decompression as decompression with software is faster. Also added a multiplier for baremetal as the latency is higher there. I choose higher thresholds trying to be on the safe side and just avoid starvation instead of trying to get the best performance. The PR is open for review but I'll wait for the resolution of #169 before merging it.

mscastanho commented 2 years ago

The code looks good, but I agree the second commit is not necessary with the changes from #169.

rzinsly commented 2 years ago

I rebased the code and removed commit 621bac4.