bkerler / edl

Inofficial Qualcomm Firehose / Sahara / Streaming / Diag Tools :)
GNU General Public License v3.0
1.47k stars 354 forks source link

Better performance for sparse image flashing #526

Closed bongbui321 closed 3 months ago

bongbui321 commented 3 months ago

@bkerler This is an improvement for sparse image flashing performance. Can optimize for less RAM usage later but currently hard to modify with current code structure.

This is before the change flashing sparse image after a while image

This is because we used to do self.tmpdata = self.tmpdata[length:] which allocates a new array every time we do that, and self.tmpdata can be very large allocating a large array everytime can be very expensive (demonstrated in the picture that it slows down alot)

After the change: the flashing speed is consistent around 55 MB/s for me. And flashing is now from 22 mins (from the above image) to 3min

Edit: it gets worse (this is before the PR): image

bkerler commented 3 months ago

Great !