0

How much performance benefit is there in adding a file (master page for example) via Module than code?

Getting the file from database (added via code) is slower than getting it from file system (adding it ghosted via Module) but how much?

How many % on average this is from a http request for example, considering that the file is retrieved each time during a request?

Does SharePoint always get the file from the database? Publishing at least has the object cache..

0

Getting the file from database (added via code) is slower than getting it from file system (adding it ghosted via Module) but how much?

Negligible.

How many % on average this is from a http request for example, considering that the file is retrieved each time during a request?

It's cached by SharePoint's code first, then ASP.NET's runtime, then SQL Server's various caches, then probably whatever disk based caching you have, so forget about it.

Does SharePoint always get the file from the database?

Files servered in virtual directories (those starting with an underscore) generally are not from the database, though chances are they use artefacts stored in the database.

SharePoint can be architected to easily handle 10s of thousands RPS, and is built around scaling horizontally. If you see a slowdown through request volume, you simply throw hardware at it after configuring your software (SQL Server, Request Management, etc) properly.

  • What would you say about adding masterpages / page layouts / site pages via code instead of Modules - see Daniel's answer above? – thomius Jan 7 '14 at 8:52
  • I'd deploy them via modules - for the simple reason being most developers do it this way - your code is easier understood by those who will maintain it in future. – James Love Jan 7 '14 at 11:10
0

Adding files such as Masterpages via Modules are more manageable than by doing it through code.

Keep in mind that not all files are added to the databases, some files are added to the file system (e.g. in the /_layouts folder).

I don't have numbers on how much time you save doing one over the other, but I do know that with files such as Masterpages, Pagelayout, SitePages etc. which needs to be placed on the file system and only referenced in SharePoint, adding those through code is just silly.

  • How would this change in the cloud / O365? Or remote provisioning. Or for publishing pages? – thomius Jan 7 '14 at 8:50
  • End user can just upload a masterpage or pagelayout to _catalogs/masterpage via explorer view, or files to sitepages; What do you mean by them needing to be added to file system? Why do you consider adding them through code silly? – thomius Jan 7 '14 at 8:54
  • How adding files via Modules is more managable than doing it through code? I think if adding them through code we would have the proper code architecture with software lifecycle thought out. We would have integration testing (even per file such as masterpage) / regression testing for versioning and development (which is probably more difficult with declarative provisioning). – thomius Jan 7 '14 at 8:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.