def count_records(self, file_path: str) -> int:
        """
        Count the total number of protein records in the UniProt database file.

        Uses grep to efficiently count lines starting with "//" which is much faster
        than reading the file line by line.

        Args:
            file_path (str): Path to the UniProt database file

        Returns:
            int: Total number of protein records in the file

        """
        count = 0

        with open(file_path, encoding="utf-8") as f:
            for line in f:
                if line.startswith("//"):
                    count += 1

        return count

        Count the total number of protein records in the UniProt database file.

        Uses grep to efficiently count lines starting with "//" which is much faster
        than reading the file line by line.

        Args:
            file_path (str): Path to the UniProt database file

        Returns:
            int: Total number of protein records in the file

        
llama-index-integrations/readers/llama-index-readers-uniprot/llama_index/readers/uniprot/base.py