Skip to main content
Added example file
Source Link
Ray
  • 233
  • 1
  • 12

A test file for decompression can be found here (~42 MB). Python needs ~22 seconds to decompress it, while C# only requires ~2 seconds. When decompressed successfully, it results in a 4000x4000 bitmap looking like this:

enter image description here

A test file for decompression can be found here (~42 MB). Python needs ~22 seconds to decompress it, while C# only requires ~2 seconds. When decompressed successfully, it results in a 4000x4000 bitmap looking like this:

enter image description here

Tweeted twitter.com/StackCodeReview/status/734711588477894656
edited tags
Link
200_success
  • 144.2k
  • 22
  • 188
  • 473
some grammar
Source Link
Ray
  • 233
  • 1
  • 12

However, being a little unsure about the "optimal" usage of IO classes and functions in Python, I got a little speed problem. The code run in Python isruns 10 times slower thanin Python compared to the C# equivalent, and I don't find any more optimization potential, because of my limited Python knowledge.

I hope this question is not too broad and requiresdoesn't require too much work... some general optimization tips when using BytesIOBytesIO (or using a class suiting this case better?) would be great already!

However, being a little unsure about the "optimal" usage of IO classes and functions in Python, I got a little speed problem. The code run in Python is 10 times slower than the C# equivalent, and I don't find any more optimization potential, because of my limited Python knowledge.

I hope this question is not too broad and requires too much work... some general optimization tips when using BytesIO (or using a class suiting this case better?) would be great already!

However, being a little unsure about the "optimal" usage of IO classes and functions in Python, I got a little speed problem. The code runs 10 times slower in Python compared to the C# equivalent, and I don't find any more optimization potential, because of my limited Python knowledge.

I hope this question is not too broad and doesn't require too much work... some general optimization tips when using BytesIO (or using a class suiting this case better?) would be great already!

Source Link
Ray
  • 233
  • 1
  • 12
Loading