use sparse array for method cache instead of global cache