Questions tagged [performance]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
4
votes
2answers
518 views

Formula field in SOQL - Performance Impact

Scenario Let's say I have two custom obejcts - Student and Class. The Class object is connected with object Student through lookup relationship. The Class object also has a formula field (...
1
vote
1answer
203 views

Is that possible to enqueue more than one action? Please suggest

I just read the best practices article for the Lightning and I am wondering is that possible to have more than one enqueueaction in client controller js? Please suggest. There is some hint given in ...
8
votes
1answer
851 views

How to implement a professional infinite/virtual scrolling in Lightning

I have a custom Lightning grid component (like and editable lightning:datatable) for which I need infinite scrolling to display thousands of rows without bringing the customers browser to a halt. I ...
1
vote
1answer
329 views

Reduce servertime loading dynamic piclist on community page

How do I reduce servercall load/time from a community. I build a dynamic picklist component which loads on the page as checkboxes. I use this component 5 times on the page. It takes about (3000ms) ...
11
votes
1answer
232 views

Why is my Lightning App inside a Managed Package extremly slow during its bootstrap phase (but not in the DEV org)?

I do have a managed package that contains a Lightning app (myApp.app) which contains various custom Lightning components. When I install the package in any org and open the app, it takes a very long ...
11
votes
1answer
322 views

What is the performance penalty for Deterministic Platform Encryption?

Spring 18 included a beta release of deterministic encryption for the SFDC Shield Platform Encryption product. Deterministic encryption imposes fewer issues with your existing code base / metadata ...
4
votes
2answers
144 views

Bulk deletion of Case Team Member records, data skew, and performance issues

We're proposing to delete no-longer-relevant Case Team Member records, numbering about 4.3 million (2.8 million total Cases). I'm concerned about the performance implications that might be caused by ...
17
votes
2answers
1k views

Effectively profile & speed up slow Lightning components (using Chrome Lightning Inspector)

Note: 5 years ago I asked the same about Visualforce here and it helped to collect a lot of knowledge. So let me try this again for Lightning. I am currently working on a quite complex Lightning page ...
0
votes
1answer
30 views

Advice for optimizing my search for available times for user(s) given list of their events. (Currently using for loop inside while loop) [closed]

I am finding the next 5 available time slots for a user or group of users based on events they have on their calendar. Currently, I have a while loop that will start at the selected time, then loop ...
3
votes
0answers
65 views

First event/event relation insert taking a while

I have an application that inserts events and event relations in an org's database and has a loading icon to prevent the user from doing anything until the event and relations are properly created and ...
7
votes
1answer
713 views

How exactly SOQL query time out works?

I have two Apex classes implementing Schedulable and Batchable as follows: Class implementing Schedulable interface: public class ScheduleClass implements Schedulable { public void execute(...
0
votes
1answer
128 views

Empty Your Recycle Bin Performance

Empty Your Recycle Bin or Empty Your Organization's Recycle Bin works very slow. Is there some faster way to empty the salesforce recycle bin.
8
votes
0answers
268 views

Make custom, in-memory “Lightning Data Service” work

Lightning Data Service is great. Multiple components are magically linked to database records. When records change in the db component show that change. Imagine this to work without saving change to ...
4
votes
1answer
64 views

In a Salesforce Number field, how much performance impact does its length have?

Does a 2,2 field perform noticeably better than a 16,2 if the same value (e.g. 24.45) is stored in the context of Apex DML Formulas whatever I forgot, please add To clarify: This question ...
0
votes
1answer
139 views

Query for non openers from several emails timing out

I can write some SQL, but I'm not good at knowing how to make things perform better. My query below works with one JobID, but I need to pull openers from 5 jobs. When I do this it times out. I'm ...
6
votes
2answers
573 views

Lightning Component Memory Leak Issue

Not sure if this is a Lightning bug. One of my Lightning pages consume lots of memory (around 4GB) when processing 4000+ records. I found out that the root cause is : when using component.set to ...
2
votes
2answers
166 views

Best Practice for bulk removeEnd() edits

I have 35+ words that I need to search for within a string. If the string ENDS with any of the 35+ words then I need to remove them. I am using .removeEnd() and it works great. My issue is my method ...
3
votes
1answer
129 views

Apex Trigger: Is it better to update the current collection or create a new collection with only the records that meet the conditions?

Wanted to see what the 'better' practice is or which would provide better performance. Let's say I have a trigger like this: trigger ProjectTrigger on Project__c (after update) { ...
0
votes
1answer
56 views

Getting CPU time error

I tried to make use of maps but still getting CPU time error. Code: //@AuraEnabled public static Map<String, Integer> getDateRangeMap() { Map<String, Integer> mapToReturn = new Map&...
0
votes
2answers
55 views

Iterating with Map with Keys vs Values . Which is more efficient?

Iterating with Map with Keys vs Values : As in Apex we need to write code efficiently for avoiding memory issues and CPU time limit everywhere, I need to understand how to iterate over a map ...
4
votes
2answers
112 views

Prevent process builders from evaluating

In a current implementation, I am running into performance issues, the issues happen because there are a lot of process builders on several objects. I am creating multiple records at the same time, ...
0
votes
1answer
678 views

Response time benchmarks for Salesforce APIs

For all the various APIs exposed by Salesforce like Bulk, Composite etc. each have their own developer guides which include like how to use them, and various limits applicable to them. But I didn't ...
14
votes
1answer
588 views

Lightning Components: Why is the rendering of 3-level nested <aura:iteration>'s so slow?

I have been working with a nested iteration and it is causing a delay of >3 seconds AFTER loading things from the APEX controller. The APEX response itself is fast, so I'm not looking for any APEX ...
6
votes
1answer
422 views

Soql for loop heap size. How to decide between speed and memory mangament

I am wondering how to decide between heap size and processing time. This probably rather trivial but I have been researching for about an hour. The two images I used system.debug(Limits.getHeapSize());...
1
vote
2answers
686 views

Load all necessary images on init in Lightning component

I have a lightning component that displays an image of the US map. The map is divided into 13 different regions based on a criteria. I am using image map to identify different regions on the map. Now ...
12
votes
1answer
3k views

Lightning Components: why are subsequent invocations of $A.enqueueAction() so super SLOW?

I have an Lightning Component with an controller containing a sever side APEX-action like this @AuraEnabled public static Object myServerSideAction_1() { return null; } @AuraEnabled public static ...
1
vote
2answers
344 views

How to optimize soql query?

I have this user case where a community user needs to see the appointments of all the contacts in his parent account.Appointment has a lookup relationship to contact. Right now, in the first soql ...
5
votes
1answer
66 views

component.get and javascript object references

In a lightning component, the recommended way to store data is in an <aura:attribute>. If I store a rich structure in an attribute and want to modify just some specific values, what is the ...
5
votes
2answers
248 views

How to query for records that have specific values on multiple fields

Let's say that I have to query Contact records with: FirstName as A, LastName as B, Company as C, or FirstName as K, LastName as L, Company as M, or FirstName as X, LastName as Y, Company ...
2
votes
2answers
602 views

What is more effecient , using SOQL AVG() or to query all records and calculate their average

Is it efficient to calculate AVG using aggregate function, using a group by clause. Like: (Select Designation__c,AVG(Salary) from Employee__c GROUP BY Designation__c) Or is it efficient to fetch all ...
4
votes
1answer
274 views

Lightning performance with over 300 Data categories in knowledge

I was surprised to read from the lightning knowledge guide that for orgs with over 300 Data Categories, if switching to lightning knowledge : "you may experience slower performance." I was under ...
9
votes
1answer
3k views

Why do we need to destroy lightning components?

I was looking at this blog post about Dynamically Instantiate and destroy Lightning Components – Modal dialog component and author is instantiating, destroying child component from the code. But I ...
1
vote
3answers
205 views

Two debug logs when loading one visualforce page

I have written a lengthy visualforce page for an account plan. After working almost all of the kinks out, I am now concerned with performance. Simply put, the page takes longer to load than I think it ...
4
votes
3answers
642 views

Set performance - is using addAll and removeAll more performant than for loops?

I am wondering what is more performant in getting the difference between two sets: Something like this: method(Set<Id> a, Set<Id> b) { Set<Id> result = a; result.addAll(b); ...
9
votes
2answers
3k views

What are the best ways to achieve lazy load in Lightning components?

I have come across many discussions to improve the performance of Lightning components and everybody has their own approach and solution. What do you reckon is the best way to implement the concept of ...
1
vote
1answer
139 views

Trigger hitting CPU Limit

I've just written my second trigger and it seems that I'm needing to learn more about how to optimize my code. My trigger runs through the campaign members of a campaign and changes the member status ...
2
votes
1answer
43 views

Is there a Salesforce equivalent of Unica Optimize?

I am somewhat familiar with Unica's Optimize engine. This compares different campaigns customers are eligible for to determine which one they should be placed into in order to get the optimal business ...
4
votes
1answer
551 views

Pros and cons of generic SObject list vs multiple lists of objects

For one of the requirements I have to write code to update multiple records of different objects. Originally I was planning to do the obvious: get needed records, change some value, update these lists,...
2
votes
0answers
131 views

Limited speed of downloading from Attachment endpoint

For an Attachment sobject, there is a 'Body' field, whose value looks like: /services/data/v39.0/sobjects/Attachment/00Q5700000v3mCFREE/Body. When I make a GET request to this endpoint using Python ...
2
votes
1answer
120 views

Questions related to LockerService SecureObject functionality and behaviour in Aura/Lightning

Lately I've found myself pretty deep in the weeds with a lightning application and have a series of questions I'm hoping someone here with some inside knowledge might be able to assist with. Or at ...
0
votes
1answer
58 views

Efficiently transforming values inside a delimited string

I have a String extDB_Table__c.inputString__c that looks like this: MTHS|||ECON|||SPN||| The ||| is meant to be a delimiter between whatever values are in the string (comes after every value, ...
12
votes
1answer
91 views

Apex performance drops between Anonymous Apex and Trigger. Then further when using LMA login

Short version using approximate Apex CPU timings. Anonymous Apex can run a loop over 200 opportunities in ~10ms. The same loop in a trigger takes ~80ms. If you use an LMA login the trigger loop ...
17
votes
1answer
1k views

Dramatic increase in AsyncApexJob latency

Problem Salesforce is a multi-tenant platform and as a consequence the time for an asynchronous request to be dequeued may vary. This is not a problem for us, as long as the delays stay within ...
6
votes
2answers
462 views

Which is faster between static and dynamic getSObjects?

What is the difference in execution between . (dot) notation and getSObjects method? Omitting of course that I can parametrize with string getSObjects method. for example: Account....
6
votes
1answer
220 views

Bad practice to have unused trigger events in Apex trigger

I am curious if it's bad practice to have unused trigger events in your trigger signature if they're never run. For example trigger SampleTrigger on Account (before insert, after delete) { if(...
0
votes
2answers
53 views

Can any one please tell me which one is the optimized code for preventing duplicate accounts to be inserted or updated

Which one of the following triggers are optimized for preventing duplicate accounts? trigger AccountDuplicateTrigger on Account (before insert,before update) { List<Account> ...
0
votes
1answer
32 views

Does the size of helper in lightning bundle in terms of lines of code affect speed of rendering?

This is very basic question so pardon me if it bored you. I have 2 options: a)Reduce the number of lines of code in helper and instead add more code in apex controller b)Increase lines of code in ...
19
votes
2answers
2k views

Dealing with auto-batching of triggers

I've recently been trying to come to terms with the oddities of the auto-"batching" of triggers. What I'm referring to is how when dealing with more than 200 records in a trigger execution, ...
11
votes
1answer
1k views

What's In A Hash Collision?

When I have used Custom Types in Map Keys and Sets, I generally follow a similar pattern listed in the Apex Developer Guide: public Integer hashCode() { return (31 * x) ^ y; } Someone asked ...
3
votes
2answers
1k views

Code Optimization

is there a way to optimized this code? I am having problem with bulk upload and these needs to be optimized, can you instruct me on what should be the proper way? I'm getting System.LimitException: ...