edubart / otclient

An alternative tibia client for otserv written in C++11 and Lua, made with a modular system that uses lua scripts for ingame interface and functionality, making otclient flexible and easy to customize
Other
646 stars 399 forks source link

Optimize XTEA encryption #1143

Closed ranisalt closed 3 years ago

ranisalt commented 3 years ago

Pushing the same code present in TFS. Tired of seeing this being sold in plain sight :stuck_out_tongue_closed_eyes:

"This patch enables auto-vectorization for XTEA encryption and decryption, exploring vector (SSE, AVX) instructions to be auto-enabled by the compiler. Should render up to 16x faster encryption/decryption throughput on AVX2, 8x on AVX and 4x on SSE/Neon."

"Out with all that optimal block size width, let the compiler figure it out. Reduces the amount of code by half and increases performance by ~20%."

Reasoning and detailed study