kevinohara80 / sfdc-trigger-framework

A minimal trigger framework for your Salesforce Apex Triggers
MIT License
936 stars 512 forks source link

Fails in bulk handling ..Batch Apex, Bulk API and DML @3500 rows #25

Open jayantsande25 opened 4 years ago

jayantsande25 commented 4 years ago

@kevinohara80 Framework is very expensive and consumes heavily Apex CPU time. Inserted @3500 Accounts and updated using batch apex ,

Account has NO workflows, processbuilder, flows or validation rules, matching or merge duplicate rules.

The Account handler has empty override methods public void beforeUpdate(){} public void afterUpdate(){} Log statistics below : 11:23:05.375 (14375373751)|CUMULATIVE_PROFILING|method invocations| External entry point: public static void execute(): executed 1 time in 13741 ms Trigger.AccountTrigger: line 4, column 1: public AccountTriggerHandler(): executed 64 times in 3584 ms Class.TriggerHandler.getHandlerName: line 165, column 1: public static String valueOf(Object): executed 256 times in 3564 ms Class.TriggerHandler.run: line 35, column 1: private void addToLoopCount(): executed 32 times in 1813 ms Class.TriggerHandler.addToLoopCount: line 141, column 1: private String getHandlerName(): executed 32 times in 1811 ms Class.TriggerHandler.run: line 33, column 1: private Boolean validateRun(): executed 32 times in 1762 ms Class.TriggerHandler.validateRun: line 157, column 1: private String getHandlerName(): executed 64 times in 1761 ms External entry point: public void invoke(): executed 1 time in 146 ms Class.TriggerHandler.run: line 38, column 1: public static Integer compareObjects(Object, Object): executed 32 times in 1 ms 11:23:05.375 (14375373751)|CUMULATIVE_PROFILING_END

Number of SOQL queries: 1 out of 100 Number of query rows: 3026 out of 50000 Number of SOSL queries: 0 out of 20 Number of DML statements: 1 out of 150 Number of DML rows: 3026 out of 10000 Maximum CPU time: 7820 out of 10000 *** CLOSE TO LIMIT Maximum heap size: 0 out of 6000000 Number of callouts: 0 out of 100 Number of Email Invocations: 0 out of 10 Number of future calls: 0 out of 50 Number of queueable jobs added to the queue: 0 out of 50 Number of Mobile Apex push calls: 0 out of 10