Reader small image

You're reading from  Mastering Apex Programming

Product typeBook
Published inNov 2020
Reading LevelIntermediate
PublisherPackt
ISBN-139781800200920
Edition1st Edition
Languages
Right arrow
Author (1)
Paul Battisson
Paul Battisson
author image
Paul Battisson

Paul Battisson is the CEO of Groundwork Apps, a Salesforce ISV Partner, a 9- time Salesforce MVP, and a current MVP Hall of Fame member. He has spoken at numerous Salesforce events including Dreamforce, London's Calling, the Salesforce London World Tour, India Dreamin, and DreamOle. He runs the Leeds Developer Group in the UK and the CloudBites TV website and YouTube channel where he helps Salesforce developers, consultants, admins and architects. He is the author of multiple books and training courses on Salesforce programming.
Read more about Paul Battisson

Right arrow

Summary

In this chapter, we have covered a number of ways in which we can improve the performance of our code related to specific governor-constrained resources. We started by looking into improving our CPU time through improved for loops, using maps, and reducing the number of expensive operations we are undertaking. This led us to see how we could improve the performance for one resource, but increase the usage of another inadvertently, which we built on in the next section, on heap size.

In the section discussing heap size, we referred back to the looping code and how we can improve heap size utilization in our loops, but again to the detriment of our CPU time. This also led to a discussion around their difference, with some of these limits being perceived by users (time to run) and others just being internal limits (heap size and memory usage). We also discussed the use of scoping to help keep the heap size down, as well as manually clearing memory by setting variables containing...

lock icon
The rest of the page is locked
Previous PageNext Chapter
You have been reading a chapter from
Mastering Apex Programming
Published in: Nov 2020Publisher: PacktISBN-13: 9781800200920

Author (1)

author image
Paul Battisson

Paul Battisson is the CEO of Groundwork Apps, a Salesforce ISV Partner, a 9- time Salesforce MVP, and a current MVP Hall of Fame member. He has spoken at numerous Salesforce events including Dreamforce, London's Calling, the Salesforce London World Tour, India Dreamin, and DreamOle. He runs the Leeds Developer Group in the UK and the CloudBites TV website and YouTube channel where he helps Salesforce developers, consultants, admins and architects. He is the author of multiple books and training courses on Salesforce programming.
Read more about Paul Battisson