While you can develop and publish your .NET applications using the Microsoft Azure cloud platform - the thing is, these applications would still be being…
"Optimization" by XKCDWhat all of this means, is that when you are starting your development for Salesforce, you should learn about the Governor Limits, and the different ways to bypass or trade them off. And also keep in mind all the best practices of performance from your .NET experience - many of them will help you as well. While this might sound like an issue - it's a great, fun challenge, and experience to be had! Stop right there, we're developers, right? Where's the code??? Ok, let's take some time, and look at some very simple examples that you might have already been faced with. Are you always thinking about the heap size? In the example below everything looks good - getting some collection from the database and iterating over it. There are no crazy incorrect things like querying data from the database inside for the loop (if we don't talk about the query itself), but anyway it's not exactly good. In cases where there are more than 200 records in satisfying your query, it would be a waste of a heap to load all of them at once (and this is exactly what would be done in the case above). However, a very small change, which is illustrated below, (you can see the change highlighted in line #3) would force Salesforce to load into the heap small batches of 200 records at a time, which can prevent you from getting runtime exceptions on organizations that have a lot of data. Complex simple database queries For sure, simple and small queries are very easy to read and write, but usually they're not optimal at all, in terms of performance. The example below is a bit more complex, but more obvious as well: In this small method we have two mistakes:
There was a problem reporting this post.
Please confirm you want to block this member.
You will no longer be able to:
Please note: This action will also remove this member from your connections and send a report to the site admin. Please allow a few minutes for this process to complete.