Quantcast

Add debug profiling stuffz... no idea why the hell text dump is slower then normal now.

ackis [01-22-09 - 01:51]
Add debug profiling stuffz... no idea why the hell text dump is slower then normal now.
Filename
ARLFrame.lua
AckisRecipeList.lua
diff --git a/ARLFrame.lua b/ARLFrame.lua
index 59948a3..c30ff14 100644
--- a/ARLFrame.lua
+++ b/ARLFrame.lua
@@ -4348,45 +4348,41 @@ function addon:DisplayTextDump(RecipeDB, profession, text)
 	}

 	-- If we haven't created these frames, then lets do so now.
-	if (not _G["ARLCopyFrame"]) then
-		local frame = CreateFrame("Frame", "ARLCopyFrame", UIParent)
+	if (not addon.ARLCopyFrame) then
+		addon.ARLCopyFrame = CreateFrame("Frame", "ARLCopyFrame", UIParent)
 		tinsert(UISpecialFrames, "ARLCopyFrame")
-		frame:SetBackdrop(PaneBackdrop)
-		frame:SetBackdropColor(0,0,0,1)
-		frame:SetWidth(500)
-		frame:SetHeight(400)
-		frame:SetPoint("CENTER", UIParent, "CENTER")
-		frame:SetFrameStrata("DIALOG")
+		addon.ARLCopyFrame:SetBackdrop(PaneBackdrop)
+		addon.ARLCopyFrame:SetBackdropColor(0,0,0,1)
+		addon.ARLCopyFrame:SetWidth(750)
+		addon.ARLCopyFrame:SetHeight(400)
+		addon.ARLCopyFrame:SetPoint("CENTER", UIParent, "CENTER")
+		addon.ARLCopyFrame:SetFrameStrata("DIALOG")

-		local scrollArea = CreateFrame("ScrollFrame", "ARLCopyScroll", frame, "UIPanelScrollFrameTemplate")
-		scrollArea:SetPoint("TOPLEFT", frame, "TOPLEFT", 8, -30)
-		scrollArea:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", -30, 8)
+		local scrollArea = CreateFrame("ScrollFrame", "ARLCopyScroll", addon.ARLCopyFrame, "UIPanelScrollFrameTemplate")
+		scrollArea:SetPoint("TOPLEFT", addon.ARLCopyFrame, "TOPLEFT", 8, -30)
+		scrollArea:SetPoint("BOTTOMRIGHT", addon.ARLCopyFrame, "BOTTOMRIGHT", -30, 8)

-		local editBox = CreateFrame("EditBox", "ARLCopyEdit", frame)
-		editBox:SetMultiLine(true)
-		editBox:SetMaxLetters(99999)
-		editBox:EnableMouse(true)
-		editBox:SetAutoFocus(false)
-		editBox:SetFontObject(ChatFontNormal)
-		editBox:SetWidth(400)
-		editBox:SetHeight(270)
-		editBox:SetScript("OnEscapePressed", function() frame:Hide() end)
-		editBox:SetText(textdump)
-		editBox:HighlightText(0)
+		addon.ARLCopyFrame.editBox = CreateFrame("EditBox", "ARLCopyEdit", addon.ARLCopyFrame)
+		addon.ARLCopyFrame.editBox:SetMultiLine(true)
+		addon.ARLCopyFrame.editBox:SetMaxLetters(99999)
+		addon.ARLCopyFrame.editBox:EnableMouse(true)
+		addon.ARLCopyFrame.editBox:SetAutoFocus(false)
+		addon.ARLCopyFrame.editBox:SetFontObject(ChatFontNormal)
+		addon.ARLCopyFrame.editBox:SetWidth(650)
+		addon.ARLCopyFrame.editBox:SetHeight(270)
+		addon.ARLCopyFrame.editBox:SetScript("OnEscapePressed", function() addon.ARLCopyFrame:Hide() end)
+		addon.ARLCopyFrame.editBox:SetText(textdump)
+		addon.ARLCopyFrame.editBox:HighlightText(0)

-		scrollArea:SetScrollChild(editBox)
+		scrollArea:SetScrollChild(addon.ARLCopyFrame.editBox)

-		local close = CreateFrame("Button", nil, frame, "UIPanelCloseButton")
-		close:SetPoint("TOPRIGHT",frame,"TOPRIGHT")
+		local close = CreateFrame("Button", nil, addon.ARLCopyFrame, "UIPanelCloseButton")
+		close:SetPoint("TOPRIGHT",addon.ARLCopyFrame,"TOPRIGHT")

-		frame:Show()
+		addon.ARLCopyFrame:Show()
 	else
-
-		local buttsecks = _G["ARLCopyFrame"]
-		local mudkipz = _G["ARLCopyEdit"]
-
-		mudkipz:SetText(textdump)
-		buttsecks:Show()
+		addon.ARLCopyFrame.editBox:SetText(textdump)
+		addon.ARLCopyFrame:Show()
 	end

 end
diff --git a/AckisRecipeList.lua b/AckisRecipeList.lua
index 8f5683a..c5b79db 100644
--- a/AckisRecipeList.lua
+++ b/AckisRecipeList.lua
@@ -68,6 +68,7 @@ local MaxFilterIndex = 131
 addon.optionsFrame = {}
 addon.ScanButton = nil
 addon.Frame = nil
+addon.ARLCopyFrame = nil
 _G["arlTooltip"] = nil
 _G["arlTooltip2"] = nil

@@ -1732,17 +1733,44 @@ do
 			playerData.playerSpecialty = self:GetTradeSpecialty(SpecialtyTable, playerData)

 			-- Add the recipes to the database
+			--@debug@
+			local _t0=GetTime()
+			--@end-debug@
 			playerData.totalRecipes = InitializeRecipes(RecipeList, playerData.playerProfession)
+			--@debug@
+			self:Print("DEBUG: Recipe Initialization: " .. GetTime()-_t0)
+			--@end-debug@

+			--@debug@
+			local _t1=GetTime()
+			--@end-debug@
 			-- Scan all recipes and mark the ones which ones we know
 			self:ScanForKnownRecipes(RecipeList, playerData)
+			--@debug@
+			self:Print("DEBUG: Scanning for known recipes: " .. GetTime()-_t1)
+			--@end-debug@

+			--@debug@
+			local _t2=GetTime()
+			--@end-debug@
 			-- Update the table containing which reps to display
 			self:PopulateRepFilters(RepFilters)
+			--@debug@
+			self:Print("DEBUG: Rep Filtering: " .. GetTime()-_t2)
+			--@end-debug@

+			--@debug@
+			local _t3=GetTime()
+			--@end-debug@
 			-- Add filtering flags to the recipes
 			self:UpdateFilters(RecipeList, AllSpecialtiesTable, playerData)
+			--@debug@
+			self:Print("DEBUG: Filtering: " .. GetTime()-_t3)
+			--@end-debug@

+			--@debug@
+			local _t4=GetTime()
+			--@end-debug@
 			-- Mark excluded recipes
 			if (not addon.db.profile.ignoreexclusionlist) then
 				playerData.excluded_recipes_known, playerData.excluded_recipes_unknown = self:GetExclusions(RecipeList)
@@ -1750,20 +1778,27 @@ do
 				playerData.excluded_recipes_known = 0
 				playerData.excluded_recipes_unknown = 0
 			end
+			--@debug@
+			self:Print("DEBUG: Exclusions: " .. GetTime()-_t4)
+			--@end-debug@

 		end

-		-- Sort the recipe list now
-		local sortedindex = self:SortMissingRecipes(RecipeList)
-
+		--@debug@
+		local _t5=GetTime()
+		--@end-debug@
 		if (textdump == true) then
 			self:DisplayTextDump(RecipeList, playerData.playerProfession)
 		else
+			-- Sort the recipe list now
+			local sortedindex = self:SortMissingRecipes(RecipeList)
 			self:CreateFrame(RecipeList, sortedindex, playerData, AllSpecialtiesTable,
 								TrainerList, VendorList, QuestList, ReputationList,
 								SeasonalList, MobList, CustomList)
 		end
-
+		--@debug@
+		self:Print("DEBUG: Frame creation/display: " .. GetTime()-_t5)
+		--@end-debug@
 	end