function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
cwoodcwood 

Should I optimize for # of API requests or # of bytes transferred?

I'm writing an app that needs to know about the user's globals and (potentially all of but probably just a couple of) object definitions. The first version calls describeGlobal() once and then calls describeSObjects() once, passing the array of types from the first call to the second. The results are stored in memory (in the browser) and manipulated with Javascript. The good news is that I'm only making 2 API calls. The bad news is they're probably fairly computationally expensive on the SFDC side, and they generate a lot of data that never gets used at all.

I'm considering making describeSObject() calls as needed (when the user selects an object type and I need its fields). This optimizes for # of bytes traferred but not # of API calls.

So my question is, which is preferred? Or does anyone care? (And if no one cares, I'd like to request JOINs and ORDER BY clauses in SOQL. :))

Thanks,
Charlie
Ron HessRon Hess
your users care, optimize for the user experience.
you other requests look like features that are on the roadmap, not sure when these will release.
cwoodcwood
Wow, there was only one right answer to that multiple-choice question and it wasn't either of the choices presented, but you nailed it. (Note to self: buy more salesforce.com stock.)

Thanks!
-Charlie