The performance has been improved for generating a large number of invoices using Format 17.
Pathway: Accounting > Billing; Setup > Accounting > Bill Group