Performance on AL Guidelineshttps://alguidelines.dev/bcbestpractices/performance/Recent content in Performance on AL GuidelinesHugo -- gohugo.ioen-usDeleteAllhttps://alguidelines.dev/bcbestpractices/performance/deleteall/Mon, 01 Jan 0001 00:00:00 +0000https://alguidelines.dev/bcbestpractices/performance/deleteall/<Created by waldo, Described by waldo> Description When you perform a “DeleteAll” when there is nothing to delete, it will still perform a lock. When you for example perform a DeleteAll on an empty table, it will result in a table lock. Therefore it’s good practice to always check if the table is empty when performing a DeleteAll. Bad code EmptyTableWLD.SetRange(Code, 'AJ'); EmptyTableWLD.DeleteAll(true); Good code EmptyTableWLD.SetRange(Code, 'AJ'); if not EmptyTableWLD.IsEmpty() then EmptyTableWLD.Subscriber Codeunitshttps://alguidelines.dev/bcbestpractices/performance/subscribercodeunits/Mon, 01 Jan 0001 00:00:00 +0000https://alguidelines.dev/bcbestpractices/performance/subscribercodeunits/<Created by waldo, Described by waldo> Description In general, subscribers have to be put in codeunits. There are a few performance considerations that you should keep in the back of your minds, when designing such a codeunit. Keep the codeunit as small as possible Work with a single instance codeunit only subscribe when necessary Avoid generic OnInsert/OnModify/OnDelete Let’s discuss all points Keep the codeunit as small as possible Every time a subscriber gets called, a new instance of the codeunit is being loaded in memory, which takes memory and processing power.