Optimization for PrimAV.js