An experimental optimization to compile material rule(s) to a single static function, and other optimizations to material rules