Performance optimization when searching for file content