virtual function space optimization