SLQB memory allocation and advanced O3 optimization