Fix performance issue with visible blocks (all blocks were considered as visible)