Questions tagged [performance]
The performance tag has no usage guidance.
356
questions
0
votes
0
answers
28
views
Is there a way to flip the parent/child data in an instance of SObject without a new SOQL query?
I have the following SOQL:
public List<B25__Resource__c> getByIds(Set<Id> resourceIds) {
return [
SELECT Id, B25__Parent__c,
...
0
votes
0
answers
64
views
Embedding SQL in Mulesoft Process Layer? Architecture advice
I know Mulesoft advocates that internal systems should be wrapped into a "System" layer application, and that the executing logic should be put inside a "Process" layer. Usually I ...
0
votes
1
answer
26
views
Record Triggered Flows - Flow Performance of "Formula Evaluates to True" Start Criteria vs Decision Nodes in flow
We are transitioning some process builders to record-triggered flows as not only a much needed tech debt cleanup, but also to help reduce our CPU execution times for processes that are close to ...
0
votes
1
answer
40
views
How can we improve performance of Experience Cloud site?
We build Experience Cloud site following Salesforce best practices but client complains about its performance and loading time.
We tried to open the page /speedtest.jsp but this page didn't provide ...
-1
votes
1
answer
90
views
DML on Sobject List
I have a scenario where I need to reduce DML calls. I'm performing DML on two objects that have a lookup relationship. I'm currently collecting the records in a list of SObjects and then performing ...
0
votes
0
answers
174
views
Salesforce Event Log for ApexExecution: cpu_time vs exec_time vs run_time
I'm currently working on an initiative to implement a Log Analysis tool for our organization to ingest the Platform/Logfile Event logs from Salesforce and be able to sort/analyze them over a longer ...
0
votes
0
answers
48
views
Several updates on Case record withing short period of time causing "duplicate value found: <unknown>"
I have pretty complex process starting with scheduled Batch Apex, calling my Mulesoft endpoint to retrieve some data and save it on Case record:
Batch apex request from Salesforce to Mule is ...
0
votes
0
answers
41
views
Batch Class - Performance Optimization
I have a batch class which converts attachments to Files for old records in the system.
We are running with batch size of 20 to 25 for the attachments to convert to Files but the conversion process is ...
3
votes
1
answer
169
views
Salesforce Optimizer: Inactive Workflow Rules
In our system, we migrated all the WFs and PBs to Flows. In the Salesforce Optimizer tool, it recommends us to delete all the inactive workflow rules. I guess my question is, how can inactive workflow ...
1
vote
1
answer
107
views
lightning-combobox with dynamic values causing performance issue
In a managed package, I have lwc with combobox whose options are fields from an object.
It calls an apex method that returns the list of fields and then displays them.
I have noticed for specific ...
1
vote
1
answer
2k
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:...
1
vote
1
answer
373
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
59
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
1k
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
313
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
182
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
531
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 ...
11
votes
1
answer
1k
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
1k
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
403
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
418
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
191
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
615
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
268
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
962
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
169
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
644
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
956
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 ...
9
votes
3
answers
7k
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
9k
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
102
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
662
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
264
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
277
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
423
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
1k
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
1k
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
455
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
1k
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
57
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
865
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
3k
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 ...
13
votes
3
answers
2k
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
622
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 ...