I created an empty custom application page, it has all defaults and I didn't add anything to it.
It takes at least 3 minutes to load...
I don't need SharePoint functionality in this custom page but I do want code behind... one trick I can think of is removing SharePoint master page from it... as I don't need it all
It takes ages loading ribbon etc.. scripts which I don't want
If I change following,
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PerfDemo.aspx.cs" Inherits="my.ApplicationPages.Layouts.my.ApplicationPages.PerfDemo"
DynamicMasterPageFile="~masterurl/default.master"
%>
TO,
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PerfDemo.aspx.cs" Inherits="my.ApplicationPages.Layouts.my.ApplicationPages.PerfDemo"
MasterPageFile="~sitecollection/_catalogs/masterpage/masterpages/mycustom.master"
%>
It throws this error,
The file '/_layouts/15/mycustom.ApplicationPages/~sitecollection/_catalogs/masterpage/masterpages/mycustom.master' does not exist.
Also tried this but doesn't work
DynamicMasterPageFile="~masterurl/minimal.master"