alguidelines/bcbestpractices/performance/index.xml
2022-02-15 21:05:36 +00:00

6 lines
No EOL
2.2 KiB
XML

<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Performance on AL Guidelines</title><link>https://alguidelines.dev/bcbestpractices/performance/</link><description>Recent content in Performance on AL Guidelines</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><atom:link href="https://alguidelines.dev/bcbestpractices/performance/index.xml" rel="self" type="application/rss+xml"/><item><title>DeleteAll</title><link>https://alguidelines.dev/bcbestpractices/performance/deleteall/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://alguidelines.dev/bcbestpractices/performance/deleteall/</guid><description>&amp;lt;Created by waldo, Described by waldo&amp;gt;
Description When you perform a &amp;ldquo;DeleteAll&amp;rdquo; 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&amp;rsquo;s good practice to always check if the table is empty when performing a DeleteAll.
Bad code EmptyTableWLD.SetRange(Code, &amp;#39;AJ&amp;#39;); EmptyTableWLD.DeleteAll(true); Good code EmptyTableWLD.SetRange(Code, &amp;#39;AJ&amp;#39;); if not EmptyTableWLD.IsEmpty() then EmptyTableWLD.</description></item><item><title>Subscriber Codeunits</title><link>https://alguidelines.dev/bcbestpractices/performance/subscribercodeunits/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://alguidelines.dev/bcbestpractices/performance/subscribercodeunits/</guid><description>&amp;lt;Created by waldo, Described by waldo&amp;gt;
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&amp;rsquo;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.</description></item></channel></rss>