Questions tagged [performance]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2
votes
2answers
279 views

SOQL performance of joins

Considering the following scenario: Objects: Child__c, Parent1__c, Parent2__c Relationships: Child__c - Parent1__c (Lookup) Child__c - Parent2__c (Master-detail) I want to query for Parent1 and ...
17
votes
2answers
434 views

Visualforce PageReference - Name Constructor vs. Factory

For a developer who wants to use a PageReference to redirect to a Visualforce Page, are there any notable differences between constructing it by name versus using the Page.PageName factory method? By ...
7
votes
1answer
88 views

Ramifications Of Cross-Object Reference Just For Id?

The Problem I see this pattern often and it drives me crazy: Id accountId = someOpportunity.Account.Id; // just reference AccountId! OR List<MyObject__c> records = [SELECT ... FROM ...
2
votes
1answer
257 views

skinny tables with person accounts

We are currently experiencing performance issues when performing SOQL queries on the account table(8.5M records) and especially our person accounts(95% of our accounts are person accounts) have ...
6
votes
1answer
3k views

SOQL Performance With LIMIT 1 [duplicate]

I became accustomed to add a LIMIT 1 clause at the end of my SOQL request when I want to request only one record. Even when I don't declare an array as result. For example: Account account = [SELECT ...
6
votes
1answer
6k views

How to implement on scroll action in lightning to show next few list of records

I want to render many(about 1000) components and I am displaying them through aura:iteration in another aura:iteration. This is causing me performance issues. I want to display only 10 records at an ...
12
votes
1answer
857 views

Performance Impact of DescribeSObjects vs. Individual Describe Calls?

I've been wondering this for a while, so it's time to put this question out there. How does Schema.describeSObjects perform when compared to individual calls to SObjectType.getDescribe? For example, ...
0
votes
1answer
66 views

Performance issue for searchable 500+ fields

I haven't work on something like this before but what are the performance implication whether using SOQL or SOSL 500 fields+ (fields will be added dynamically as the application grows) and having 800K ...
0
votes
1answer
196 views

Serving gzipped static resources (.gz files)

I'm new to Salesforce and working on a Angular2 + SF web application. I'm serving my JS files via StaticResources. main.js is quite big though (ng2 + app). I was planning to increase performance by ...
2
votes
1answer
74 views

CPU time limit error

I have one child object on account having lookup relationship, I want to update the average of some fields of child to parent, for this I wrote one after insert trigger on child. on doing bulk load I'...
7
votes
2answers
602 views

How to efficiently determine the `name` field of an sobject for dynamic query?

Is there a more efficient way to determine the name field of an sobject other than iterating through all the fields obtained via DescribeSOBjectResult? Often, the name field is simply Name but in ...
0
votes
0answers
21 views

Does proliferation of Metadata affect my Orgs performance?

I've recently installed a fairly large managed package in our Developer org (i.e. in terms of # of apex classes, vf pages etc.). I have since noticed a degradation in performance for Metadata actions. ...
1
vote
2answers
3k views

SObject Numeric field - Integer.valueOf() vs casting

When working in Apex it is not uncommon for us to work with a numeric field that has a 0 scale. To use that with some built in functions we need to use an Integer. To provide an example, let's say we ...
10
votes
1answer
626 views

Strategies to deal with slow metadata api performance

I'm slightly concerned that this question is might not fit here but, as you will read, I have a lot of time on my hands... Around release-time, Salesforce performance tends to plummet and right (in ...
0
votes
1answer
459 views

Process Builder update records limit

We use Process Builder to update records. I'm getting this error for the mass update: UPDATE --- UPDATE FAILED --- ERRORI: (CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY) ITA_IFM_Case_Trigger: System....
1
vote
0answers
29 views

How do you improve the performance of the Health Cloud? [closed]

Currently the load time of the Health Cloud is subpar, I have ran it with a computer with the latest release of Chrome, 16 GB of Ram and a 200 Mb connection to the internet, despite that the health ...
2
votes
1answer
24 views

Salesforce server speeds - deterministic or not?

I am testing an email utility which I have written to automatically send some attachments to recipients based on some logic. I am noticing that the speed with which the recipient receives the email ...
15
votes
4answers
6k views

How to avoid instantiating object inside a loop?

There are many scenarios where I have to create records of polymorphic objects using apex. For e.g. creating a Task record or a CustomObject__c record for each Case created. In general I do something ...
5
votes
1answer
933 views

RemoteAction Vs REST? Which is faster?

I need to get the results really fast on my page. I have to decide between 2 approach. Build a HTTP get service, by using a VisualForce page as Service. Using contentType as 'application/JSON'. Use ...
1
vote
0answers
31 views

Optimize user experience in Salesforce Service Console [closed]

today I have a bit odd question (since it will not be code related) ;) did any of you happend to know good tool to optimize user experience in Salesforce Service Console? I mean something like ...
6
votes
1answer
850 views

Uploading 100,000 binary files as attachments to Case record - best approach

I want to upload files (.doc, .pdf) from external system to the attachments of Case record. There are two approaches I have found from Salesforce Help. 1) Uploading Attachments by data loader ...
11
votes
2answers
2k views

CPU issues caused by process builder and workflows has really gotten bad in last 3 releases

Not getting much activity on the Salesforce Community site with this one so I'll try it here. I've noticed a massive spike in CPU exceeded limits since Summer 15' and Winter 16'. I've personally ...
5
votes
1answer
813 views

Anyone else having issues with deployment to sandbox stuck in pending for 5-60 minutes

Developing in two sandboxes and both of them when I attempt to deploy anything via metadata or tooling API the deployment is stuck in a pending status from 5-60+ minutes. I have a case open for one ...
3
votes
1answer
67 views

Org Benchmarking?

I found out recently that our org is using ~85% of its data allocation. The number one offender for usage (13%) has no one looking at it. The number two offender for usage (7%) has no one looking at ...
3
votes
1answer
89 views

Compiled length of validation rule functions

I have a validation rule that is around 3000 characters in length. It uses a the following functions (most of them quite a number of times): IF, NOT, OR, AND, LEN, BEGINS, SUBSTITUTE, VALUE and MOD. ...
2
votes
1answer
481 views

Schema.describeSObject throws exception, want to know how to skip

What I'm trying to do is list out all objects and then go through each field per object to see if that field contains a certain value fieldName.contains('aov'). (AKA trying to see where my field ...
0
votes
1answer
436 views

Batch Apex - Optimise Nested Loops

I have the following code: global class ProcessLinkBetweenWorlds implements Database.Batchable<sObject>, Database.Stateful { global Integer recordsProcessed = 0; global List<...
1
vote
2answers
40 views

Best solution to process changes to a collection based on multiple criteria in triggers?

In a BeforeUpdate trigger of a custom object, I am checking to see what custom fields have been updated and based on the updates, want to call specific methods that use the updated fields to run some ...
2
votes
0answers
89 views

Main.JS taking more than sufficient load time

I have created a site which is taking more than sufficient load time. After checking the loading in various tool found that a JS file that is main.js is the main culprit and it is an internal file ...
3
votes
1answer
497 views

SOQL Performance : LastModifiedDate vs SystemModStamp

From Force.com SOQL Performance Tips: LastModifiedDate vs SystemModStamp: However, the query optimizer cannot use the index if the SOQL query filter uses LastModifiedDate to determine the upper ...
14
votes
2answers
3k views

What is the difference between (Id)str and Id.valueOf(str)?

Say I have one string String strId = 001xa000003DIlo and I want to typecast it to an Id. So I have two options to do so: Id idVal = (Id)strId; Id idVal = Id.valueOf(strId); Which is the best way to ...
8
votes
1answer
642 views

Most optimal way to Enforce CRUD/FLS in Apex

This article shows a common way to check access in Apex with a syntax like: if (!Schema.sObjectType.Contact.fields.Name.isAccessible()){ return ''; } However, it is very time/space-consuming to ...
11
votes
1answer
463 views

Obtaining Single Record - SOQL vs. Instantiating New Object

Background I have a custom object which has a master/detail relationship to Opportunities. Whenever a record on this custom object is created or edited, I need to update the parent opportunity (and ...
1
vote
1answer
61 views

Apex Trigger Skipping Its Duties Under Load - Without Limits Errors

I've got a code problem that is only surfacing under load but isn't producing limits errors, making it a little tough to figure out what I might need to do to fix it. == I've written an insert/...
-1
votes
1answer
324 views

Page loading problem in production environment [closed]

we have implemented a visualforce page that displays 500 records along with images and map it is loading properly in sandbox but in production it is loading very slow.please see my page screenshot ...
0
votes
0answers
75 views

Performance degradation in salesforce sandbox - batches and asynchronous are taking too long time

We are running start of day and end of day jobs before and after the business hours, but from around 4 days we are observing even without any data sets the batches are taking too long to run. ...
4
votes
2answers
4k views

Best place to declare variables in salesforce

We have had quite intensive discussions regarding the same topic in the programmer's communities. The two main view points are As close to the first use - To limit scope and improve performance ...
0
votes
0answers
24 views

How to optimize joined query to find obsolete data

We have a query to find and remove the obsolete data which looks like this: select Id,Name from Matter__c where Id NOT IN (select Matter_Number_Lookup__c from Matter_Sitting__c) So if a matter ...
2
votes
1answer
59 views

Performance under large data - standard features

When the number of records in the database increase, logically there must be decrease in performance. This degradation can be explicitly observed in SOQL/list view/reports on such orgs especially ...
1
vote
1answer
792 views

Bulkify the code?

I want to clone the Opportunity record if some conditions satisfied in Opportunity car set which is in related list. Opportunity (Master)--->Opportunity car set(Child) My below code is working fine....
17
votes
4answers
699 views

Anyone else seeing unexpected “System.LimitException: Apex CPU time limit exceeded” in previously working code?

In the last 24 hours several of our Jenkins (Continuous Integration server) builds have started failing with: System.LimitException: Apex CPU time limit exceeded exceptions in unit tests that have ...
3
votes
1answer
220 views

Trigger Best Practices

How would you rewrite the following trigger to follow best practices re: bulkification, etc? trigger Order_PopulateGallery on RH_Order__c (before insert, before update){ List<Account> accs = ...
36
votes
2answers
2k views

Why Would I Not Enable Chaining?

The Apex Design Patterns is an awesome resource, and I learned many tricks from it. One of my favorites is method chaining, and I quickly developed an axiom: Any time you would return void, return ...
2
votes
1answer
74 views

Apex Performance Query

I have the following scenario occuring in my code: Custom Object A has 100 records. Custom Object B also has 100 records (every record of B will have a corresponding record with A). for (...
10
votes
1answer
420 views

Most Efficient Method to Convert Set Type?

I have a twist on this question. What is the relative performance of each of the following methods? Via Peter Knolle: public static Set<String> deserializeToStrings(Set<Id> input) { ...
1
vote
1answer
291 views

Apex Loop Optimize

Here is my code // dynamic fields, the same with queried fields of Database.query(sqlStr) String fieldList = 'Id, Name, Number, Text__c..........'.split(','); for(SObject sob : Database.query(...
14
votes
2answers
7k views

Performance: List.get(index) vs List[index]

I want to know which approach is better in Salesforce when getting element from list. Is this faster? myList.get(0); Or is this faster? myList[0]; Using large list which above statement is more ...
2
votes
1answer
984 views

Apex Page Attributes - Performance Impact

I would like to better understand how each of the following attributes on an apex:page tag (or any notable omissions) affect load times. applyBodyTag applyHtmlTag docType showHeader sidebar ...
34
votes
2answers
5k views

When To Use Set vs. List In SOQL

I have always assumed that it is better to use a Set in my query filters instead of a List. For example: Set<Id> parentIds = generateParentIds(); List<Child__c> children = [SELECT Id FROM ...
4
votes
0answers
73 views

how to see view state size for non system administrator profiles?

I am working on a product in which multiple profiles are applicable for same features (Data is coming according to profile and there are also some layout changes). I like to see the view state of page ...