faster gemset detection