cmusatyalab / gabriel

Wearable cognitive assistance using cloudlets
Apache License 2.0
65 stars 41 forks source link

Improve efficiency of _recv_n_bytes #19

Closed akindofyoga closed 5 years ago

akindofyoga commented 5 years ago

Strings are immutable in Python. Therefore, concatenating strings within a loop creates a new string each time.

Using an array and concatenating after the loop ends fixes this problem. This example reads chunks from a socket this way.

akindofyoga commented 5 years ago

Can someone approve this?