Posts

Showing posts from April, 2022

SPO600 Project Stage 3

Image
 We finally reached the final stage of the project!   In the last stage, I will perform a comparison of how jpeg-compressor’s performance differs in different architecture platforms. There are SSE (Intel) version, SVE2 (ARM) version, and the original source without any optimizations. The mutual system the three programs will run on is an X86_64 machine (portugal.cdot.systems)   Let’s start off with the original one. First, we need to disable SSE in jpgd.cpp by setting JPGD_USE_SSE2 to 0 because it is enabled by default. Then we config Cmake to build our program. After running the program with an image. Here is the result: Next, SSE is enabled: We can clearly see the decompress time is hugely different between 2 versions: 908 ms in non-optimized vs 830 ms in SSE optimized. Note that SSE optimization is only in decompress function, and there is no optimization in the encoder file (jpge.cpp). SSE has shown us a jump in performance compared to the original code without opti

SPO600 Project Stage 2

Image
  Let’s start implementing jpeg-compressor ( https://github.com/richgel999/jpeg-compressor ).   In Stage 1, I mentioned that I would choose to implement jpeg-compressor using intrinsics. When looking at the two main files (jpge.cpp and jpgd.cpp). It is possible that SVE intrinsics can be applied to many functions because many of those have a common pattern of using arrays as input arguments, for loop, and while loop, which is very similar to scale volume functions in Lab 6. For example: However, it is not time efficient to do converting functions from the regular loop to the SVE2 loop. It may take days or even years to finish implementation, debugging, and testing for beginners. Thus, auto-vectorization should be a better solution for big projects. Jpeg-compressor is already optimized with SSE, which is an Intel optimization equivalent to SVE2, which is ARM. So, I think SSE should be disabled to avoid any platform conflict. Looking at jpeg-compressor documentation on GitHub