When HTMLEditor is created AjaxControlToolkit.HTMLEditor.ToolbarButton.CommonButton.OnInit (EventArgs) is called 56 times. Each call creates a new instance ResoureManager and reads a single string.
When I did a static field _rm and tested on OnInit if not null, I save 2999ms.
private static ResourceManager _rm;
protected override void OnInit(EventArgs e)
{
if (_rm == null)
_rm = new ResourceManager("ScriptResources.BaseScriptsResources", Assembly.GetExecutingAssembly());
ToolTip = _rm.GetString("HTMLEditor_toolbar_button_" + this.GetType().Name + "_title");
base.OnInit(e);
}
Comments: Outdated.
When I did a static field _rm and tested on OnInit if not null, I save 2999ms.
private static ResourceManager _rm;
protected override void OnInit(EventArgs e)
{
if (_rm == null)
_rm = new ResourceManager("ScriptResources.BaseScriptsResources", Assembly.GetExecutingAssembly());
ToolTip = _rm.GetString("HTMLEditor_toolbar_button_" + this.GetType().Name + "_title");
base.OnInit(e);
}
Comments: Outdated.