Questions tagged [performance]
The performance tag has no usage guidance.
334
questions
0
votes
1
answer
28
views
What are cons of running a batch a few times a day?
Running a batch is needed because people want to see results from the batch in the same day. Now our batch runs every night
Are there any issues (for example performance issues) of running a batch ...
0
votes
1
answer
28
views
Clearing SOQL query cache for query performance testing
I'd like to do performance tests of the same SOQL query to check which order of WHERE and indexes configuration would be the fastest, but database caching makes it hard - after the first SOQL, the ...
0
votes
3
answers
136
views
Best pratice for using static variables
I have seen classes having 100s of static variables defined. They are their for different purposes and I don't think, mostly are used in single transaction. They are used in different transactions.
...
1
vote
1
answer
117
views
Best way to get accurate time of execution for apex code?
I'm trying to do performance tuning on some code I'm working on.
I'm currently checking the total execution time with this process:
Datetime startTime = Datetime.now();
/* run some code here */
...
3
votes
0
answers
71
views
As a developer, is there a way to improve the carbon footprint of my code and how to calculate the carbon emission [closed]
With global warming, I think we all have a role to play and it starts with performance of our code.
Is there a way to calculate the carbon footprint of a piece of code? (ex. like converting CPU Time ...
0
votes
0
answers
21
views
How Schema.getGlobaldescribes().get(sObjectAPIName) works, what is the path system takes? [duplicate]
In dynamic APEX, as mentioned by SF that describe calls are heavy. So when we do the following
Schema.getGlobaldescribes() - it picks org's all objects.
Schema.getGlobaldescribes().get(SObjectAPIName)...
3
votes
1
answer
193
views
Aura component - How to improve load time faster
I have around 15-20 child aura components sitting inside the aura parent component.
Just you know this is a legacy system and I can not do much other than improving the page performance, my question ...
0
votes
1
answer
63
views
Apex: Avoid DML when records are unchanged
I have noticed that many of the Apex triggers in my org update records even when there are no substantive changes to those records. For instance, consider a trigger that sets field values on an object ...
0
votes
0
answers
62
views
What should be used to search a string across multiple fields of a single object? SOQL or SOSL
I want to search records for a particular object based on filter string that can match multiple fields on that object. This can be achieved via both SOQL and SOSL:
SOQL : using like operator, applying ...
1
vote
2
answers
77
views
Optimize Extraction of Reports Metadata Code to decrease CPU Time
I'm struggling to optimize my current code that, at the moment, retrieves report metadata of 25 reports. While it works well, I'm getting awfully close to the maximum cpu time as shown below. I ...
-1
votes
1
answer
46
views
Salesforce lightning performance component [closed]
I'm trying to configure the new homepage since my org just recently switched to lightning. I added the performance component to the layout, however it doesn't show any data. It just says "to see ...
0
votes
1
answer
97
views
Soql taking too long - log says 15 seconds
We are getting UNABLE_TO_LOCK_ROW error couple time a week. This time I was able to get the logs of it by setting user trace flag on production. When I check the logs, I see that a single SOQL query ...
0
votes
0
answers
20
views
LWC/Aura Component Initial Load Takes Long Time [duplicate]
We are able to reproduce the behavior by creating a new sandbox and opening the page, which contains a lot of Aura or LWC components. Second and further page loads are much faster, even after clear ...
6
votes
2
answers
287
views
SOQL query performance with many or few fields
I have a doubt. Sometimes the developer repeats many queries in different places, but what changes is the number of fields. I sometimes think about centralizing queries, but queries can have fields ...
0
votes
0
answers
13
views
App build on top of Salesforce : scaling and performance
Those in dev and QA working on SF app built on top of SF, How you do check and make sure that code is able to handle the scaling and performance and apex limits and callouts limits and all.
do you ...
14
votes
4
answers
2k
views
Is it more efficient to use a map and call .get(), or use a set and call .contains()?
Prelude
I did a couple of interwebs searches, and I used the following search terms here on SFSE...
apex map get set contains
apex map vs set
apex map set efficien*
...then looked through a number of ...
0
votes
0
answers
232
views
Long delay between platform event publish and platform event subscriber processing
Kindly help me with following scenario.
In short - need help to minimize the delay between platform event publish and platform event subscriber processing.
Platform Event Details -
Event Type - ...
6
votes
1
answer
430
views
Iterating api variable on nested lwc is very slow
I am experiencing a weird behaviour when iterating a relatively big list in an lwc api variable when this is going through nested components. When I have two nested components the time taken to ...
2
votes
1
answer
108
views
Performance comparison between LWC Reactive property and javascript Property
There two ways we can define property in lwc javascript.
We can define reactive property which we can use in HTML page. This reactive property stays throughout the lifecycle of the LWC component.
...
4
votes
1
answer
189
views
Do additional Permission Sets reduce Salesforce Performance?
I have hundreds of different functionalities setup in Salesforce each with its own Permissions Set for various privleges (FLS, Class access etc), given to various roles across the business.
I wish to ...
0
votes
0
answers
31
views
Optimizing the Org
I have been working on an org which have a lot of automation on the objects especially leads. There are more than 10 process builders and triggers each. They all work for different processes and ...
0
votes
0
answers
30
views
Improve initial load performance of actionOverride containing lightning web components
I created an actionOverride which is used as an optional replacement of the "New"-action for Leads, Contacts, and Accounts. This is done by using an Aura Component as a wrapper containing my ...
0
votes
0
answers
34
views
PK Chunking : message" : "The requested resource does not exist"
I enabled PK chunking in Full Copy Sanbox by following below steps:
Can anyone tell me what mistake I am doing?
Create Job XML
<?xml version="1.0" encoding="UTF-8"?>
<...
5
votes
2
answers
200
views
Why salesforce lightning experience is ironically sluggish?
Why lightning experience is ironically sluggish?
The classic experience comparatively feels faster when it comes to page load time and navigation.
Have seen may developers and admins prefer classic ...
6
votes
2
answers
990
views
Infinite queueable chaining, what is the drawback?
As mentioned here
Because no limit is enforced on the depth of chained jobs, you can
chain one job to another. You can repeat this process with each new
child job to link it to a new child job.
What ...
8
votes
2
answers
433
views
Is a big startup delay for the first use of a custom Lightning App using 140 custom LWCs normal?
We have a 3rd party developed Lightning App where most of the components don't render until after a 50 second delay on the first use of the day. But you can e.g. open the Salesforce Sales app first ...
4
votes
2
answers
114
views
Javascript loop very inefficient......Why? [duplicate]
I am not a javascript expert but thought this was a slam dunk to code until I saw the results. I am looking for help to make this MUCH more efficient.
I have a simple for-loop going over a list of ...
1
vote
1
answer
149
views
Understanding Batch Apex / Callout performance
I am looking for some advice regarding the optimization of an Apex Batch which is behaving quite differently in UAT and PROD environments.
In our ORGs we have a Batchable process that is responsible ...
0
votes
1
answer
467
views
Slow overall performance in Community
I have struggled with slow performance in my Community for years now. It is getting worse. We use a Community for our publicly facing website & for our portal. The slow performance is on all ...
0
votes
0
answers
27
views
How to consume the export output of the Experience Builder Site Performance tool?
This Analyze and Improve Experience Builder Site Performance tool, a Chrome extension, includes an Export feature that outputs content that starts like this:
{
"buckets":{
"1"...
0
votes
1
answer
78
views
How can I automate page load time testing?
I'm trying to get metrics for page load times. I'd like to load the page many times, say 100 times, and get the average time it took to load the page, from a virtual Cmd-R to the page remaining stable ...
1
vote
1
answer
78
views
Is there a way to group cases which refer to the same issue together?
Currently the salesforce set-up is creating a case every time a client enters live chat, emails in to a support email and then a sales email. If a user communicates via all 3 channels regarding the ...
2
votes
1
answer
558
views
What is the Salesforce Speedtest
The Lightning Experience Performance Optimization says, "Measure latency, as well as download and upload speeds, using the Salesforce Speedtest." But no link to this is given and I don't see ...
0
votes
1
answer
1k
views
Where can I find the Lightning Usage App?
I'm looking to use the Lightning Usage App to get metrics on my app, but I cannot find it. The Lightning Experience Performance Optimization says, "To open the Lightning Usage App, click the App ...
2
votes
1
answer
517
views
Performance : Removing null from Set
From a performance view point which is better:
Set<String> uniqueStrings = new Set<String>();
// Keep checking for null and then add to Set
for (Integer i = 0; i < 100; i++) {
if(...
1
vote
1
answer
285
views
SOQL Performance with multiple lookups
I have a search query in my component that shortly will need to support more than one lookup field where only one would be filled on the certain object.
For now the query looks as follows:
SELECT ...
1
vote
0
answers
36
views
Moving process automation into Trigger - are the performance benefits real?
A while ago, I asked about this:
Performance gains of moving automation into a trigger?
And I got some great feedback from everyone.
I'm working in a real world scenario now and proposing an org move ...
0
votes
1
answer
32
views
Difference between a straight query and a relationship query
I'm trying to understand the performance difference or query execution time between direct SOQL query and relationship query. For example, I need data from Account and User object. sap_id__c is the ...
0
votes
2
answers
243
views
Is `event.getParams()` expensive?
If I have to use a param from the event in a loop, is it better to extract the params to a variable before (e.g. const params = event.getParams()), and use that variable instead of calling event....
0
votes
1
answer
115
views
Case Assignment Rules running Multiple Times - Negative Impact
I have a bit of an odd question. Is there a negative impact running assignment rules on a Case object on every insert/update? We have a use case where we need to run when the user uses inline edit, ...
1
vote
1
answer
110
views
Improve performance and speed in Lightning Experience [closed]
Recently switching from Classic to Lightining and users started feeling very slow to load the page, does anybody has any pointers what might the case and what to look for in order to make it faster ...
1
vote
0
answers
174
views
Is that possible to use query plan for dynamic SOQL queries?
I know we can verify straightforward SOQL in query plan. Now, I am trying to find a way to use query planner for a dynamic SOQL queries. My SOQL query depends on several Ids (list of Ids) and binding ...
0
votes
1
answer
131
views
How the framework knows that the cached data is stale?
I am wondering on how the framework understand that the data is stale when we use the annotation cacheable=true. Will the framework looks for a change in the timestamp of each record?
0
votes
1
answer
101
views
Are there API available to measure the flexipage loading time?
There is "Lightning Usage App" and there is "pages" tab, we can view the flexipage performance on that app. But is there any API available for developer to access those performance ...
0
votes
1
answer
172
views
Is there a performance difference between Custom Settings vs Custom Objects? [closed]
Specifically, is it faster to query for a single record from a Custom Setting vs a Custom Object? Or is it about equal performance?
1
vote
1
answer
424
views
Any way to tell in Salesforce how much CPU a specific Process Builder/Flow is using?
We are running into CPU time limit exceeded errors in Salesforce. The org does have multiple Process Builders/Flows on the Case object. For a particular Case insert operation, I pulled an analysis ...
2
votes
1
answer
730
views
How to avoid nested for loop condition for code Optimization?
public void execute(Database.BatchableContext BC, List<FinServ__FinancialAccount__c> scope) {
Set<String> Acc_Numbers = new Set<String>();
Map<String,List<Id>...
2
votes
0
answers
56
views
Is this an acceptable Task query performance
I have been investigating a performance issue in a Visualforce page, with the help from Salesforce support. After a couple of months info exchange, the issue is narrowed down to the DB query time on ...
0
votes
0
answers
34
views
Method to display the page execution time
Is there a method to display the page execution time? I have a usecase that needs to display page execution time on a lightning component on a partner community portal.
1
vote
1
answer
69
views
Static variable + static block initialisation VS static initialisation
In the doc from salesforce, there is the following example.
public class MyClass {
class RGB {
Integer red;
Integer green;
Integer blue;
RGB(Integer red, ...