Bad performance: using OOP with for loops to identify substring

Yeah - LongAminoAcidSeq for proteins. It looks like you want to estimate coverage of the short reads on the long sequences. For this purpose, in order to get good speed, you will need to use a dedicated short-read mapper like bwa or kma or bowtie2 or minimap2 - I don’t recommend rolling your own. These tools will able to handle imperfect matches.