Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM forum
Suggested answer

multiple webresources are better than a bundled one

Posted on by 5

Hello Community,

i'm relatively new to the CRM developer world and i'm just wondering if it makes a significant difference if i use for example 10 single javascript webresources or if it's better to merge them into one to save performance or at what point it makes a difference.

  • Suggested answer
    RodRodriguez Profile Picture
    RodRodriguez on at
    RE: multiple webresources are better than a bundled one

    Howdy!

    Honestly, it comes down to a personal preference, performance wise it probably won't make much of a difference.  This is JavaScript we are talking about here, the execution of the code in the file takes MUCH longer than the loading of the file.

    That being said, the smaller individual files are quicker to load.  If "page A" need 3 of the functions then it only needs to load those 3 files which would likely be quicker than the 1 large file.  Now, if "Page B" is going to use 8 or all 10 of those functions, then the one file load would be faster than then 8+ smaller file loads.

    More importantly, your style and preference for how you maintain the .js will be a better indicator/guidepost for figuring out what works better FOR YOU in the long run.

    Some Devs like to keep all their functions in one place so they can make their tweaks once and avoid doing the same work repeatedly.  Say you have a tweak to make to all (or many) of the functions, then you only have to open one file.  To do the same for individual functions means you need to open each file to make the change <shrug>.  You save yourself the trouble of opening and closing multiple files.  That being said, if there is an identical change you need to make across all of your functions, then a copy/search/replace will be easier in just one file.  <shrug^2>

    Some find that having a large "utility" .js file is more trouble than it's worth because someone can come in and muck up the large utility file accidentally and then ALL of the functions are hosed.  With individual function files, you only hose that one function

    If the performance is really important, then I would write up the 10 files, and also combine those into a single file.  Load them on two pages and run a true A/B comparison on the performance.

    Your mileage may vary based on what it is you are having that JavaScript do, the only way to know for sure which is better for YOUR USE CASE is to test it

    But honestly, I don't think you are going to find much/any difference in the performance, it is the maintenance that makes the difference in the long run (In my personal opinion)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,552 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,552 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans