Questions tagged [performance]
The performance tag has no usage guidance.
349
questions
0
votes
1
answer
66
views
VS Code CLI Retrieve taking too long to respond/complete
For several years I have been using the SF CLI retrieve commands in VS Code to retrieve data from my Partial Copy Sandboxes to my local git repo.
About a month ago I moved from using the force:source:...
0
votes
0
answers
39
views
How to get field references in Reports/ReportTypes?
I am trying to solve a problem of many unused field in my org.
This will be addressed by running a periodic job that will figure out the field usage via number of references and letting the audience ...
0
votes
1
answer
46
views
Any suggestions on better or optimized approach that returns single row from multiple rows based on ROW_NUMBER in SFMC
I have a customer data extension where customer records are saved with order numbers like this:
CustomerOrderDE:
CustomerID
OrderID
OrderTotal
1
101
$100
1
102
$200
2
103
$50
3
104
$75
3
105
$60
...
0
votes
1
answer
94
views
System.debug() in production code (Apex)
What, if anything, is the overhead of leaving System.debug() statements in Apex code that's deployed to production?
Obviously, if Debug Logging is started for a User who is executing the code there ...
-2
votes
1
answer
165
views
Getting return value of find must be used while Optimizing JS in LWC
Im running the following code to optimize iteration in different datasets. BAsically Im avoiding multiple if statements here. But it says the return value of find must be used. Here is the code
...
1
vote
0
answers
107
views
Lightning console method workspaceAPI.closeTab() is not working after keeping the console tab open for sometime(approx. 2 hrs)
The following method for closing the console tab is working if user launches the page and trying to Cancel immediately. But if the page is idle for sometime like 2 hours and if user try to Cancel , ...
0
votes
1
answer
257
views
Marketing Cloud Query and SSJS Performance
I have to implement a Marketing Cloud Solution that will have millions of records in a single Data Extension (DE). Most DEs will have 20-30 million records with some DEs going over 100 M. I know how ...
0
votes
0
answers
150
views
Best practices around fixed data extensions versus constantly adding fields using in the data / contact model
In terms of performance (data optimization and segmenting data using queries) - what kind of data extension schema is recommended in SFMC (or considered as best practice)?
Tall tables with more ...
0
votes
1
answer
845
views
Salesforce CPQ: Are Calculations Faster in the Quote Line Editor (QLE) Using Price Rules or the Quote Calculator Plugin (QCP)?
In Salesforce CPQ, when using the Quote Line Editor (QLE), are calculations generally faster using Price Rules or the Quote Calculator Plugin (QCP)?
For instance, consider the following Price Rule ...
10
votes
1
answer
828
views
Do deployments affect end users? (performance)
We have a continuous delivery approach, each feature is pushed to production when it is ready. There can be 1 to 5 deployments per day.
Does it affect Salesforce performance?
I know that yes, but I ...
0
votes
0
answers
830
views
Why is Salesforce inspector faster than data loader or workbench?
I have a use case where I need to delete a few million duplicates from my org. I have explored the following 3 tools to achieve this. Salesforce Inspector, Data Loader and Workbench. The performance ...
2
votes
2
answers
285
views
APEX - Loop and SOQL - Performance Question (Time and Space Complexity)
Hello Salesforce Devs!
I'm just curious to know which one of the below has better performance when looking up child records.
For example, finding number of cases on an account:
#1: List<Account> ...
5
votes
1
answer
289
views
Performance issue due to table scan vs index scan
A simple SOQL query on contact object is performing full table scan instead of index scan in our Salesforce development org and same query works fine in production org. There are around 6 million ...
0
votes
0
answers
171
views
Using one data extension for journeys and contact updates via API
Would it be a good practice (looking at performance) to setup one Data Extension that stores all contacts/Subscribers (including 20 attributes) and to let this Data Extension be updated via REST API ...
1
vote
1
answer
391
views
Enterprise territory management vs Sharing rule
We have a requirement to share the accounts based on the region, cluster and territory they are in to the users. Right now, we have roles based on the region. Region, Cluster and Territory are custom ...
2
votes
0
answers
221
views
Where is Database.query() spending (so much) CPU time?
My assumption was that only Apex Code is using CPU time. But the what I measure for code that is run by Salesforce's own Backend code speak a different language.
List<SObject> result = Database....
0
votes
1
answer
40
views
How can I optimize the code below?
Problem statement:
I need to prevent the user from creating more than 10 Opportunities per month.
public static void createOpportunity(List<Opportunity> newOpportunityList){
for(...
6
votes
2
answers
811
views
How to improve email delivery speed for highly dynamic email (fetching product info)
We're looking to improve the send time of a recurrent email campaign.
The campaign has for objective to push a given number of products in an e-mail (max 20 products).
The email contains quite some ...
0
votes
1
answer
140
views
Is it possible to get "average record save" time for a specific SObject type?
We are optimizing our existing code base using a set of frameworks. We want to measure, how these improved the performance of a transaction.
Is there a way to check average record save time in ...
0
votes
1
answer
437
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 ...
1
vote
1
answer
602
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 ...
7
votes
3
answers
4k
views
Best practice for using static variables
I have seen classes having 100s of static variables defined. They are there for different purposes and I don't think, mostly are used in single transaction. They are used in different transactions.
...
2
votes
1
answer
5k
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
85
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
22
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
2k
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
338
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
213
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
206
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
301
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
768
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 ...
6
votes
2
answers
838
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 ...
14
votes
4
answers
4k
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
1k
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 - ...
8
votes
1
answer
1k
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 ...
3
votes
1
answer
379
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
817
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
1
answer
47
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 ...
6
votes
2
answers
668
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
2k
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 ...
12
votes
2
answers
1k
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
443
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 ...
2
votes
1
answer
631
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
1k
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
46
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
428
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
935
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 ...
5
votes
1
answer
4k
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 ...
1
vote
1
answer
3k
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
2k
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(...