Questions tagged [performance]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2
votes
1answer
45 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
649 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
138 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
125 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
92 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 ...
20
votes
1answer
2k 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
477 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
223 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
54 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 ...
20
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
2k 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: ...
2
votes
2answers
330 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
457 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
89 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
263 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
7k 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
2answers
979 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
91 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
216 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
77 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
690 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 ...
11
votes
1answer
692 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
496 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
30 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
7k 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
999 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
940 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 ...
6
votes
1answer
888 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
68 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
101 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
620 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
480 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
91 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
511 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
686 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
492 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
62 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
345 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
89 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. ...