-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Profiling improvements #591
Conversation
Codecov ReportBase: 97.64% // Head: 97.61% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #591 +/- ##
==========================================
- Coverage 97.64% 97.61% -0.03%
==========================================
Files 14 14
Lines 5595 5615 +20
==========================================
+ Hits 5463 5481 +18
- Misses 132 134 +2
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This reverts commit 01c72a6.
This comment was marked as outdated.
This comment was marked as outdated.
1 similar comment
Repo Comparison Testdiff --git ORI/zombie-strike/src/hub/StarterGui/MainGui/App/Shopkeeper2/init.lua ALT/zombie-strike/src/hub/StarterGui/MainGui/App/Shopkeeper2/init.lua
index 5de9236..9e24393 100644
--- ORI/zombie-strike/src/hub/StarterGui/MainGui/App/Shopkeeper2/init.lua
+++ ALT/zombie-strike/src/hub/StarterGui/MainGui/App/Shopkeeper2/init.lua
@@ -349,126 +349,125 @@ function OpenedItem:render()
e(GoldCount),
}),
- PerkDetails = self.props.itemTypeData.UpgradePerks
- and e(PerkDetails, {
- Perks = self.props.item.Perks,
- Seed = self.props.item.Seed,
+ PerkDetails = self.props.itemTypeData.UpgradePerks and e(PerkDetails, {
+ Perks = self.props.item.Perks,
+ Seed = self.props.item.Seed,
+
+ RenderParent = function(element, size)
+ return e(HoverStack, {
+ Render = function(hovered, hover, unhover)
+ local upgradeButtons = {}
+
+ for perkIndex, perk in ipairs(self.props.item.Perks) do
+ if perk.Upgrades < PerkUtil.MAX_PERK_UPGRADES then
+ local upgradeCost = Upgrades.CostToUpgradePerk(perk)
+ local tooltipSize = TextService:GetTextSize(
+ upgradeCost,
+ 22,
+ Enum.Font.GothamBold,
+ Vector2.new(250, math.huge)
+ )
+
+ upgradeButtons["Perk" .. perkIndex] = e("ImageButton", {
+ AnchorPoint = Vector2.new(0, 0),
+ BackgroundTransparency = 1,
+ Image = "rbxassetid://711219057",
+ LayoutOrder = perkIndex,
+ Position = UDim2.fromScale(1, 0),
+ Size = UDim2.fromScale(1, 1),
+ ZIndex = -perkIndex,
- RenderParent = function(element, size)
- return e(HoverStack, {
- Render = function(hovered, hover, unhover)
- local upgradeButtons = {}
-
- for perkIndex, perk in ipairs(self.props.item.Perks) do
- if perk.Upgrades < PerkUtil.MAX_PERK_UPGRADES then
- local upgradeCost = Upgrades.CostToUpgradePerk(perk)
- local tooltipSize = TextService:GetTextSize(
- upgradeCost,
- 22,
- Enum.Font.GothamBold,
- Vector2.new(250, math.huge)
- )
-
- upgradeButtons["Perk" .. perkIndex] = e("ImageButton", {
- AnchorPoint = Vector2.new(0, 0),
- BackgroundTransparency = 1,
- Image = "rbxassetid://711219057",
- LayoutOrder = perkIndex,
- Position = UDim2.fromScale(1, 0),
- Size = UDim2.fromScale(1, 1),
- ZIndex = -perkIndex,
-
- [Roact.Event.Activated] = self.createUpgradePerk(perkIndex, upgradeCost),
- [Roact.Event.MouseEnter] = hover(perkIndex),
- [Roact.Event.MouseLeave] = unhover(perkIndex),
- }, {
- e("UIAspectRatioConstraint"),
-
- Tooltip = e(Tooltip, {
- Open = hovered == perkIndex,
- Size = UDim2.fromOffset(tooltipSize.X + 50, tooltipSize.Y + 16),
- Render = function(transparency)
- return {
- Inner = e("Frame", {
+ [Roact.Event.Activated] = self.createUpgradePerk(perkIndex, upgradeCost),
+ [Roact.Event.MouseEnter] = hover(perkIndex),
+ [Roact.Event.MouseLeave] = unhover(perkIndex),
+ }, {
+ e("UIAspectRatioConstraint"),
+
+ Tooltip = e(Tooltip, {
+ Open = hovered == perkIndex,
+ Size = UDim2.fromOffset(tooltipSize.X + 50, tooltipSize.Y + 16),
+ Render = function(transparency)
+ return {
+ Inner = e("Frame", {
+ BackgroundTransparency = 1,
+ Position = UDim2.fromOffset(0, 12),
+ Size = UDim2.new(1, 0, 1, -12),
+ }, {
+ UIListLayout = e("UIListLayout", {
+ FillDirection = Enum.FillDirection.Horizontal,
+ HorizontalAlignment = Enum.HorizontalAlignment.Center,
+ SortOrder = Enum.SortOrder.LayoutOrder,
+ VerticalAlignment = Enum.VerticalAlignment.Center,
+ }),
+
+ Label = e("TextLabel", {
+ BackgroundTransparency = 1,
+ Font = Enum.Font.GothamBold,
+ Size = UDim2.new(0, tooltipSize.X, 1, 0),
+ Text = upgradeCost,
+ TextColor3 = Color3.new(1, 1, 1),
+ TextSize = 22,
+ TextTransparency = transparency,
+ }),
+
+ CapIcon = e("ImageLabel", {
BackgroundTransparency = 1,
- Position = UDim2.fromOffset(0, 12),
- Size = UDim2.new(1, 0, 1, -12),
+ Image = ImageCap,
+ ImageTransparency = transparency,
+ LayoutOrder = 2,
+ Size = UDim2.fromScale(1, 1),
}, {
- UIListLayout = e("UIListLayout", {
- FillDirection = Enum.FillDirection.Horizontal,
- HorizontalAlignment = Enum.HorizontalAlignment.Center,
- SortOrder = Enum.SortOrder.LayoutOrder,
- VerticalAlignment = Enum.VerticalAlignment.Center,
- }),
-
- Label = e("TextLabel", {
- BackgroundTransparency = 1,
- Font = Enum.Font.GothamBold,
- Size = UDim2.new(0, tooltipSize.X, 1, 0),
- Text = upgradeCost,
- TextColor3 = Color3.new(1, 1, 1),
- TextSize = 22,
- TextTransparency = transparency,
- }),
-
- CapIcon = e("ImageLabel", {
- BackgroundTransparency = 1,
- Image = ImageCap,
- ImageTransparency = transparency,
- LayoutOrder = 2,
- Size = UDim2.fromScale(1, 1),
- }, {
- UIAspectRatioConstraint = e("UIAspectRatioConstraint"),
- }),
+ UIAspectRatioConstraint = e("UIAspectRatioConstraint"),
}),
- }
- end,
- }),
- })
- else
- -- Take up space
- upgradeButtons["Perk" .. perkIndex] = e("Frame", {
- AnchorPoint = Vector2.new(0, 0),
- BackgroundTransparency = 1,
- LayoutOrder = perkIndex,
- Position = UDim2.fromScale(1, 0),
- Size = UDim2.fromScale(1, 1),
- }, {
- e("UIAspectRatioConstraint"),
- })
- end
+ }),
+ }
+ end,
+ }),
+ })
+ else
+ -- Take up space
+ upgradeButtons["Perk" .. perkIndex] = e("Frame", {
+ AnchorPoint = Vector2.new(0, 0),
+ BackgroundTransparency = 1,
+ LayoutOrder = perkIndex,
+ Position = UDim2.fromScale(1, 0),
+ Size = UDim2.fromScale(1, 1),
+ }, {
+ e("UIAspectRatioConstraint"),
+ })
end
+ end
+
+ return e("Frame", {
+ AnchorPoint = Vector2.new(1, 0.5),
+ BackgroundTransparency = 1,
+ Position = UDim2.fromScale(1, 0.5),
+ Size = size,
+ }, {
+ PerkDetails = element,
+
+ UIScale = e("UIScale", {
+ Scale = 1.4,
+ }),
- return e("Frame", {
- AnchorPoint = Vector2.new(1, 0.5),
+ UpgradeButton = e("Frame", {
BackgroundTransparency = 1,
- Position = UDim2.fromScale(1, 0.5),
- Size = size,
+ Position = UDim2.fromScale(1, 0),
+ Size = UDim2.new(0, 45, 1, 0),
}, {
- PerkDetails = element,
-
- UIScale = e("UIScale", {
- Scale = 1.4,
+ UIListLayout = e("UIListLayout", {
+ Padding = UDim.new(1 / (3 * #self.props.item.Perks), 0),
+ SortOrder = Enum.SortOrder.LayoutOrder,
+ VerticalAlignment = Enum.VerticalAlignment.Center,
}),
- UpgradeButton = e("Frame", {
- BackgroundTransparency = 1,
- Position = UDim2.fromScale(1, 0),
- Size = UDim2.new(0, 45, 1, 0),
- }, {
- UIListLayout = e("UIListLayout", {
- Padding = UDim.new(1 / (3 * #self.props.item.Perks), 0),
- SortOrder = Enum.SortOrder.LayoutOrder,
- VerticalAlignment = Enum.VerticalAlignment.Center,
- }),
-
- UpgradeButtons = Roact.createFragment(upgradeButtons),
- }),
- })
- end,
- })
- end,
- }),
+ UpgradeButtons = Roact.createFragment(upgradeButtons),
+ }),
+ })
+ end,
+ })
+ end,
+ }),
BasicUpgrade = self.props.itemTypeData.UpgradeBasic and e("Frame", {
AnchorPoint = Vector2.new(1, 0.5),
diff --git ORI/lit/deps/coro-wrapper.lua ALT/lit/deps/coro-wrapper.lua
index c4c43d6..f943b65 100644
--- ORI/lit/deps/coro-wrapper.lua
+++ ALT/lit/deps/coro-wrapper.lua
@@ -50,13 +50,12 @@ local function merger(read, scan)
return chunk
end
end
- end,
-
- -- This is used to update or disable the scan function. It's useful for
- -- protocols that change mid-stream (like HTTP upgrades in websockets)
+ end,
+ -- This is used to update or disable the scan function. It's useful for
+ -- protocols that change mid-stream (like HTTP upgrades in websockets)
function(newScan)
- scan = newScan
- end
+ scan = newScan
+ end
end
-- Decoder takes in a read function and a decode function and returns a new
@@ -123,10 +122,9 @@ local function decoder(read, decode)
return item
end
end
- end,
- function(newDecode)
- decode = newDecode
- end
+ end, function(newDecode)
+ decode = newDecode
+ end
end
local function encoder(write, encode)
|
…rofiling-improvements
…rofiling-improvements
Repo Comparison Testdiff --git ORI/zombie-strike/src/hub/StarterGui/MainGui/App/Shopkeeper2/init.lua ALT/zombie-strike/src/hub/StarterGui/MainGui/App/Shopkeeper2/init.lua
index 5de9236..9e24393 100644
--- ORI/zombie-strike/src/hub/StarterGui/MainGui/App/Shopkeeper2/init.lua
+++ ALT/zombie-strike/src/hub/StarterGui/MainGui/App/Shopkeeper2/init.lua
@@ -349,126 +349,125 @@ function OpenedItem:render()
e(GoldCount),
}),
- PerkDetails = self.props.itemTypeData.UpgradePerks
- and e(PerkDetails, {
- Perks = self.props.item.Perks,
- Seed = self.props.item.Seed,
+ PerkDetails = self.props.itemTypeData.UpgradePerks and e(PerkDetails, {
+ Perks = self.props.item.Perks,
+ Seed = self.props.item.Seed,
+
+ RenderParent = function(element, size)
+ return e(HoverStack, {
+ Render = function(hovered, hover, unhover)
+ local upgradeButtons = {}
+
+ for perkIndex, perk in ipairs(self.props.item.Perks) do
+ if perk.Upgrades < PerkUtil.MAX_PERK_UPGRADES then
+ local upgradeCost = Upgrades.CostToUpgradePerk(perk)
+ local tooltipSize = TextService:GetTextSize(
+ upgradeCost,
+ 22,
+ Enum.Font.GothamBold,
+ Vector2.new(250, math.huge)
+ )
+
+ upgradeButtons["Perk" .. perkIndex] = e("ImageButton", {
+ AnchorPoint = Vector2.new(0, 0),
+ BackgroundTransparency = 1,
+ Image = "rbxassetid://711219057",
+ LayoutOrder = perkIndex,
+ Position = UDim2.fromScale(1, 0),
+ Size = UDim2.fromScale(1, 1),
+ ZIndex = -perkIndex,
- RenderParent = function(element, size)
- return e(HoverStack, {
- Render = function(hovered, hover, unhover)
- local upgradeButtons = {}
-
- for perkIndex, perk in ipairs(self.props.item.Perks) do
- if perk.Upgrades < PerkUtil.MAX_PERK_UPGRADES then
- local upgradeCost = Upgrades.CostToUpgradePerk(perk)
- local tooltipSize = TextService:GetTextSize(
- upgradeCost,
- 22,
- Enum.Font.GothamBold,
- Vector2.new(250, math.huge)
- )
-
- upgradeButtons["Perk" .. perkIndex] = e("ImageButton", {
- AnchorPoint = Vector2.new(0, 0),
- BackgroundTransparency = 1,
- Image = "rbxassetid://711219057",
- LayoutOrder = perkIndex,
- Position = UDim2.fromScale(1, 0),
- Size = UDim2.fromScale(1, 1),
- ZIndex = -perkIndex,
-
- [Roact.Event.Activated] = self.createUpgradePerk(perkIndex, upgradeCost),
- [Roact.Event.MouseEnter] = hover(perkIndex),
- [Roact.Event.MouseLeave] = unhover(perkIndex),
- }, {
- e("UIAspectRatioConstraint"),
-
- Tooltip = e(Tooltip, {
- Open = hovered == perkIndex,
- Size = UDim2.fromOffset(tooltipSize.X + 50, tooltipSize.Y + 16),
- Render = function(transparency)
- return {
- Inner = e("Frame", {
+ [Roact.Event.Activated] = self.createUpgradePerk(perkIndex, upgradeCost),
+ [Roact.Event.MouseEnter] = hover(perkIndex),
+ [Roact.Event.MouseLeave] = unhover(perkIndex),
+ }, {
+ e("UIAspectRatioConstraint"),
+
+ Tooltip = e(Tooltip, {
+ Open = hovered == perkIndex,
+ Size = UDim2.fromOffset(tooltipSize.X + 50, tooltipSize.Y + 16),
+ Render = function(transparency)
+ return {
+ Inner = e("Frame", {
+ BackgroundTransparency = 1,
+ Position = UDim2.fromOffset(0, 12),
+ Size = UDim2.new(1, 0, 1, -12),
+ }, {
+ UIListLayout = e("UIListLayout", {
+ FillDirection = Enum.FillDirection.Horizontal,
+ HorizontalAlignment = Enum.HorizontalAlignment.Center,
+ SortOrder = Enum.SortOrder.LayoutOrder,
+ VerticalAlignment = Enum.VerticalAlignment.Center,
+ }),
+
+ Label = e("TextLabel", {
+ BackgroundTransparency = 1,
+ Font = Enum.Font.GothamBold,
+ Size = UDim2.new(0, tooltipSize.X, 1, 0),
+ Text = upgradeCost,
+ TextColor3 = Color3.new(1, 1, 1),
+ TextSize = 22,
+ TextTransparency = transparency,
+ }),
+
+ CapIcon = e("ImageLabel", {
BackgroundTransparency = 1,
- Position = UDim2.fromOffset(0, 12),
- Size = UDim2.new(1, 0, 1, -12),
+ Image = ImageCap,
+ ImageTransparency = transparency,
+ LayoutOrder = 2,
+ Size = UDim2.fromScale(1, 1),
}, {
- UIListLayout = e("UIListLayout", {
- FillDirection = Enum.FillDirection.Horizontal,
- HorizontalAlignment = Enum.HorizontalAlignment.Center,
- SortOrder = Enum.SortOrder.LayoutOrder,
- VerticalAlignment = Enum.VerticalAlignment.Center,
- }),
-
- Label = e("TextLabel", {
- BackgroundTransparency = 1,
- Font = Enum.Font.GothamBold,
- Size = UDim2.new(0, tooltipSize.X, 1, 0),
- Text = upgradeCost,
- TextColor3 = Color3.new(1, 1, 1),
- TextSize = 22,
- TextTransparency = transparency,
- }),
-
- CapIcon = e("ImageLabel", {
- BackgroundTransparency = 1,
- Image = ImageCap,
- ImageTransparency = transparency,
- LayoutOrder = 2,
- Size = UDim2.fromScale(1, 1),
- }, {
- UIAspectRatioConstraint = e("UIAspectRatioConstraint"),
- }),
+ UIAspectRatioConstraint = e("UIAspectRatioConstraint"),
}),
- }
- end,
- }),
- })
- else
- -- Take up space
- upgradeButtons["Perk" .. perkIndex] = e("Frame", {
- AnchorPoint = Vector2.new(0, 0),
- BackgroundTransparency = 1,
- LayoutOrder = perkIndex,
- Position = UDim2.fromScale(1, 0),
- Size = UDim2.fromScale(1, 1),
- }, {
- e("UIAspectRatioConstraint"),
- })
- end
+ }),
+ }
+ end,
+ }),
+ })
+ else
+ -- Take up space
+ upgradeButtons["Perk" .. perkIndex] = e("Frame", {
+ AnchorPoint = Vector2.new(0, 0),
+ BackgroundTransparency = 1,
+ LayoutOrder = perkIndex,
+ Position = UDim2.fromScale(1, 0),
+ Size = UDim2.fromScale(1, 1),
+ }, {
+ e("UIAspectRatioConstraint"),
+ })
end
+ end
+
+ return e("Frame", {
+ AnchorPoint = Vector2.new(1, 0.5),
+ BackgroundTransparency = 1,
+ Position = UDim2.fromScale(1, 0.5),
+ Size = size,
+ }, {
+ PerkDetails = element,
+
+ UIScale = e("UIScale", {
+ Scale = 1.4,
+ }),
- return e("Frame", {
- AnchorPoint = Vector2.new(1, 0.5),
+ UpgradeButton = e("Frame", {
BackgroundTransparency = 1,
- Position = UDim2.fromScale(1, 0.5),
- Size = size,
+ Position = UDim2.fromScale(1, 0),
+ Size = UDim2.new(0, 45, 1, 0),
}, {
- PerkDetails = element,
-
- UIScale = e("UIScale", {
- Scale = 1.4,
+ UIListLayout = e("UIListLayout", {
+ Padding = UDim.new(1 / (3 * #self.props.item.Perks), 0),
+ SortOrder = Enum.SortOrder.LayoutOrder,
+ VerticalAlignment = Enum.VerticalAlignment.Center,
}),
- UpgradeButton = e("Frame", {
- BackgroundTransparency = 1,
- Position = UDim2.fromScale(1, 0),
- Size = UDim2.new(0, 45, 1, 0),
- }, {
- UIListLayout = e("UIListLayout", {
- Padding = UDim.new(1 / (3 * #self.props.item.Perks), 0),
- SortOrder = Enum.SortOrder.LayoutOrder,
- VerticalAlignment = Enum.VerticalAlignment.Center,
- }),
-
- UpgradeButtons = Roact.createFragment(upgradeButtons),
- }),
- })
- end,
- })
- end,
- }),
+ UpgradeButtons = Roact.createFragment(upgradeButtons),
+ }),
+ })
+ end,
+ })
+ end,
+ }),
BasicUpgrade = self.props.itemTypeData.UpgradeBasic and e("Frame", {
AnchorPoint = Vector2.new(1, 0.5),
diff --git ORI/lit/deps/coro-wrapper.lua ALT/lit/deps/coro-wrapper.lua
index c4c43d6..f943b65 100644
--- ORI/lit/deps/coro-wrapper.lua
+++ ALT/lit/deps/coro-wrapper.lua
@@ -50,13 +50,12 @@ local function merger(read, scan)
return chunk
end
end
- end,
-
- -- This is used to update or disable the scan function. It's useful for
- -- protocols that change mid-stream (like HTTP upgrades in websockets)
+ end,
+ -- This is used to update or disable the scan function. It's useful for
+ -- protocols that change mid-stream (like HTTP upgrades in websockets)
function(newScan)
- scan = newScan
- end
+ scan = newScan
+ end
end
-- Decoder takes in a read function and a decode function and returns a new
@@ -123,10 +122,9 @@ local function decoder(read, decode)
return item
end
end
- end,
- function(newDecode)
- decode = newDecode
- end
+ end, function(newDecode)
+ decode = newDecode
+ end
end
local function encoder(write, encode)
|
contains_comments
turns out is a very expensive function for big files...We do some reorganisation and reduce the reliance on this function.
We should try and remove its use completely.
For large files (6MB+), this change makes formatting complete in time :)
https://github.com/WeakAuras/WeakAuras2/blob/main/WeakAurasModelPaths/ModelPaths.lua originally did not complete formatting (20min+), but now completes in <=100s.
Still some room for improvements