lz_sarray: Performance and memory usage optimizations