Here are few tips for good performance.
1. Before using for all entries, check the reference table for NOT INITIAL check. ( it_tab[] NOT INITIAL )
2. Sort the reference table. SORT it_tab by key
3. Avoid INTO CORRESPONDING, instead declare your <internal_table> which required fields only
4. Avoid SELECT *, use only required fields in the select query
5. If your Where condition is not the combination of PRIMARY KEY, then go for creating secondary index on custom table
6. Delete adjacent duplicates from reference table
Regards,
Fasi