gcprobe
Definition
-- @/lua/common/utils.lua:1314
-- prints bytes of garbage created since previous call
function gcprobe(printZero, omitPrint)
local newgccount = collectgarbage("count") * 1024
if __prevgccount__ then
local dif = newgccount - __prevgccount__
collectgarbage('restart')
if (dif > 0 or printZero) and not omitPrint then print(dif) end
__prevgccount__ = false
return dif
else
collectgarbage('stop')
rawset(_G, '__prevgccount__', newgccount)
end
end
Callers
@/lua/ge/extensions/gameplay/rally/driveline/drivelineRoute.lua
-- gcprobe() -- some coming from first half
wpCs = pacenote:getCornerStartWaypoint()
-- gcprobe() -- only on first pass after full reset
speedMph = calcSpeedMph(speedMs)
-- log('D', logTag, string.format('threshold=%.2fs speedMph=%0.2fmph speedMultiplier[%0.1f(%dmph)-%0.1f(%dmph)]=%0.2f audioLenTotal=%.2fs audioLenTotalScaled=%.2fs', threshold, speedMph, self.minMultiplier, self.scaleMinSpeedMph, self.maxMultiplier, self.scaleMaxSpeedMph, speedMultiplier, audioLenTotal, audioLenTotalScaled))
-- gcprobe()
-- gcprobe() -- some coming from second half
-- gcprobe() -- small amount
if not event.csDynamicHit and timeToCs < threshold then
end
-- gcprobe()
-- gcprobe() -- none
-- immediate is only evaluated when the pacenote's trigger type is immediate, unlike the other triggers.
end
-- gcprobe()
-- gcprobe() -- very small amount
local relativeDistCs = vehDistToFinish - wpCs:getOriginalDistToTarget()
end
-- gcprobe()
-- gcprobe() -- about 3000
for percent, hit in pairs(event.cornerPercentHit) do
for percent, hit in pairs(event.cornerPercentHit) do
-- gcprobe() -- a couple on first pass after full reset
-- gcprobe()
-- gcprobe() -- a couple on first pass after full reset
-- gcprobe()
distPercent = pacenote:getCachedLength() * percent -- 284
absDistPercent = wpCs:getOriginalDistToTarget() - distPercent -- 284
-- gcprobe()
relativeDistCsPercent = vehDistToFinish - absDistPercent
shouldTriggerAudio = false
-- gcprobe()
if not hit and relativeDistCsPercent < self.staticDistanceThresholdMeters then
if not hit and relativeDistCsPercent < self.staticDistanceThresholdMeters then
-- gcprobe() -- none
event.cornerPercentHit[percent] = true
end
-- gcprobe()
-- gcprobe() -- none
-- gcprobe()
-- gcprobe() -- none
if self:enableTriggerLogging() then
end
-- gcprobe()
-- gcprobe() -- none
-- gcprobe()
-- gcprobe() -- none
self:callPacenoteEventCallback(self.onPacenoteCornerPercentHit, pacenote, shouldTriggerAudio, percent)
self:callPacenoteEventCallback(self.onPacenoteCornerPercentHit, pacenote, shouldTriggerAudio, percent)
-- gcprobe()
end
end
-- gcprobe()
-- gcprobe() -- none
for offset, hit in pairs(event.csMeterOffsetHit) do
end
-- gcprobe()
-- gcprobe() -- needs attention
for offset, hit in pairs(event.ceMeterOffsetHit) do
end
-- gcprobe()
-- gcprobe() -- none
local relativeDistCe = vehDistToFinish - wpCe:getOriginalDistToTarget()
end
-- gcprobe()
-- gcprobe() -- very small amount
self.events[pacenote.id] = event
self.events[pacenote.id] = event
-- gcprobe()
-- gcprobe()
profilerPopEvent("DrivelineRoute - evaluatePacenoteEvents")
if not evalPos then return end
-- gcprobe() -- about 20% ? coming from here
self.route:trackPosition(evalPos)
self.route:trackPosition(evalPos)
-- gcprobe()
-- log('D', logTag, string.format('evaluating pacenote idx=%d name=%s', i, pacenote.name))
-- gcprobe() -- majority coming from here
audioWasTriggered = self:evaluatePacenoteEvents(evalPacenote, speedMs)
audioWasTriggered = self:evaluatePacenoteEvents(evalPacenote, speedMs)
-- gcprobe()
if audioWasTriggered then
-- gcprobe() -- section 1 - none
if self.trackMouseLikeVehicle then
end
-- gcprobe()
-- gcprobe() -- section 2 - zero, then can 20kb per frame after a vehicle reset, but it can go away after a while.
updateSpeedMs = self:getSpeed()
end
-- gcprobe()
-- gcprobe() -- section 3 - this is where most of the bytes come from.
if self.recalcNeeded then
-- log('D', logTag, 'recalcNeeded')
-- gcprobe() -- recalculate -- emits 300kb when it recalculates.
self:recalculate()
self:recalculate()
-- gcprobe()
self.recalcNeeded = false
if updateSpeedMph > self.minEvalSpeedMph and self.dtSimSumSinceRecalc > self.minWaitTimeSinceRecalc then
-- gcprobe() -- majority is coming from here
self:evaluatePacenotesWindow(updateSpeedMs)
self:evaluatePacenotesWindow(updateSpeedMs)
-- gcprobe()
else
-- gcprobe()
profilerPopEvent("DrivelineRoute - onUpdate")
@/lua/vehicle/controller/gauges/genericGauges.lua
if playerInfo.anyPlayerSeated and obj:getUpdateUIflag() then
--gcprobe()
electricsUpdate(updateTimer)
customModuleUpdate(updateTimer)
--gcprobe()
--dump(gaugeData)
@/lua/ge/extensions/gameplay/rally/rallyManager.lua
if settingAudioPacenotes then
-- gcprobe()
self:sendPacenoteToAudioManager(pacenote)
self:sendPacenoteToAudioManager(pacenote)
-- gcprobe()
end
if settingVisualPacenotes then
-- gcprobe()
self:triggerShowVisualPacenote(pacenote)
self:triggerShowVisualPacenote(pacenote)
-- gcprobe()
end
-- gcprobe()
if self.drivelineRoute then
-- gcprobe()
if self.audioManager then
end
-- gcprobe()
self:processPacenoteQueue()
-- gcprobe()
profilerPopEvent("rallyManager:onUpdate")
@/lua/vehicle/controller/gauges/analogOdometer.lua
if hasChanged and playerInfo.anyPlayerSeated and obj:getUpdateUIflag() then
--gcprobe()
gaugeData.electrics.trip = extensions.odometer.getRelativeRecording()
gaugeData.electrics.odometer = currentOdometerValue
--gcprobe()
oldtrip = trip
@/lua/ge/extensions/gameplay/rallyLoop.lua
-- gcprobe()
if showLoopToolbox[0] then
end
-- gcprobe()
@/lua/ge/extensions/gameplay/rally.lua
-- gcprobe()
RecceApp.onUpdate(dtReal, dtSim, dtRaw)
RecceApp.onUpdate(dtReal, dtSim, dtRaw)
-- gcprobe()
-- gcprobe()
if rallyManager and not RecceApp.isRecording() then
end
-- gcprobe()
-- gcprobe()
if rallyToolbox and showRallyToolbox[0] then
end
-- gcprobe()
@/lua/ge/extensions/gameplay/route/raceRoute.lua
if xnorm > 0 then
-- gcprobe()
-- a.pos = lerp(a.pos, b.pos, xnorm)
a.pos:setLerp(a.pos, b.pos, xnorm)
-- gcprobe()
a.wp = nil
startEndPosTable.pos:set(pos)
-- gcprobe()
fixStartEnd(startEndPosTable, self.path[1], self.path[2], resetMetadata)
fixStartEnd(startEndPosTable, self.path[1], self.path[2], resetMetadata)
-- gcprobe()