Speed up inside test with Grid data structure