Garry's Mod

Garry's Mod

364 ratings
Addon hooks Lag Finder
2
3
2
   
Award
Favorite
Favorited
Unfavorite
Content Type: Addon
Addon Type: Tool
File Size
Posted
Updated
5.839 KB
11 May, 2016 @ 10:48pm
28 Jul, 2017 @ 2:49pm
10 Change Notes ( view )

Subscribe to download
Addon hooks Lag Finder

In 9 collections by Cédric GÉRILLE [GiletJaune]
Board Games by Mohamed Rachid
16 items
The TTT by Mohamed Rachid
39 items
The DarkRP by Mohamed Rachid
44 items
Soccer by Mohamed RACHID
37 items
Université Joseph Poireau (serveur)
70 items
MR: Serveur Garry's Mod Jeu en 2D
11 items
Dev Tests Mohamed
50 items
G-1:788429
50 items
Optimization addons
7 items
Description
This addon finds the laggiest hooks and displays them in console.
It is not magic, read description to learn how to use it!

[curse.com]

Available on GitHub: Addon hooks Lag Finder[github.com]

The reports display laggy hook names, performance impact, file location and matching Workshop addon.
Proceeding with the test to identify a lag that is not observable will not help. Locating a lag implies that a lag is occurring.
Currently, inspected hooks are from: GM, hook, net, usermessage, timer, ENT, SWEP and the main scene rendering.
This addon ignores lags from VGUI and lags that do not involve Lua.
As a golden rule, avoid modifying Lua files during the test, in order to prevent restoring old functions and to prevent ignoring added / reloaded functions.
GM, ENT and SWEP functions added / modified / reloaded during the test are ignored and an old version will be restored at the end of the test.
Hooks / callbacks added / modified / reloaded without the provided function during the test will be ignored.

The Addon hooks Conflict Finder is required in order to identify Workshop addons.
The Addon hooks Conflict Finder is the base of this addon. See its description.

Usage
These commands must be entered in console.
The command finishing with "sv" is for a serverside test, only for superadmins.
The command finishing with "cl" is for a clientside test.

- To start a simple test:
find_laggy_hooks_sv find_laggy_hooks_cl
- To stop a simple test:
find_laggy_hooks_sv 0 find_laggy_hooks_cl 0
- Full syntax:
find_laggy_hooks_sv [ReportInterval=30 or 0] [TopCount=16 or RatioThreshold] find_laggy_hooks_cl [ReportInterval=30 or 0] [TopCount=16 or RatioThreshold]
ReportInterval - How many seconds between reports, small values recommended
TopCount - How many hooks to display on each report
RatioThreshold - Display all hooks above the given impact threshold, example: 0.1 means 10%

The more ReportInterval is high, the less you will see one-time lags on top of the list. This is due to the Impact which is not affected by the unreliable Max time.

Columns
Identifier: The type and the name of the hook
Impact: Calculated impact on framerate
Executions: Number of executions of the hook during last capture period
Mean time per frame: Mean execution time per frame over last capture period
Max time: Maximum execution time of the hook

Known bugs
- The time measurement often goes wrong, causing Max time to have a crazy high value.

See also
DBugR[github.com], by oubliette32
LagDetector, by Buzzkill
FProfiler[github.com], by FPtje

Good luck!
93 Comments
Cédric GÉRILLE [GiletJaune]  [author] 6 Jun @ 10:17am 
Hey! Thanks for the love! :extralife:
Shimyo 3 Jun @ 5:50pm 
hey so i love u for this
Cédric GÉRILLE [GiletJaune]  [author] 3 Jun @ 11:10am 
I made it specially for you in the first place! 😉
Boing 14 May @ 10:56pm 
this has been very handy, thank you.
Cédric GÉRILLE [GiletJaune]  [author] 2 Jan @ 11:52am 
Greetings!
Your case is a little special. As mentioned in the messages, the errors come from the conflict finder, not the lag finder. Please retry the lag finder after uninstalling the conflict finder. I'm sorry for the inconvenience.
It seems that there is a special case where the conflict finder tries to send information, but for an odd reason, it seems that the information is too large, and that is surprising to me!
Well, good point here: the conflict finder needs to be fixed to handle this special case where there is too much information about the location of Lua files. I did not expect this!
The message about the not found hooks for event "1" does not give me any ideas BTW.
Mr.Toymaker 31 Dec, 2024 @ 9:26am 
It stopped working for me.. it pops me "Could find no hook with event name "1"!

[Addon hooks Conflict Finder] net.WriteData: Invalid length 67602!
1. unknown - lua/autorun/find_conflicts_hook.lua:72
2. pcall - [C]:-1
3. func - lua/autorun/find_laggy_hooks.lua:312
4. unknown - lua/includes/extensions/net.lua:37


[Addon hooks Conflict Finder] lua/autorun/find_conflicts_hook.lua:81: bad argument #1 to 'JSONToTable' (string expected, got no value)
1. JSONToTable - [C]:-1
2. net_ReceiveLuaFiles - lua/autorun/find_conflicts_hook.lua:81
3. func - lua/autorun/find_conflicts_hook.lua:147
4. unknown - lua/includes/extensions/net.lua:37" As i try to do a clientside test..
Cédric GÉRILLE [GiletJaune]  [author] 21 Apr, 2024 @ 1:39am 
"lua/entities/ent_proxsensor/cl_init.lua" is missing. That's all I can tell.
Market Pluh 20 Apr, 2024 @ 2:14am 
[Stealth 2.1 (Improved Stealth Mod)] AddCSLuaFile: Couldn't find 'cl_init.lua'
1. unknown - lua/entities/ent_proxsensor/init.lua:1

where do I find the hook here?
and what do I type in the command?
Cédric GÉRILLE [GiletJaune]  [author] 30 Mar, 2024 @ 1:34am 
Yes! :missing: Thank you!
Lexeychik 29 Mar, 2024 @ 11:38am 
most usefull addon EVER:steamthumbsup::missing::steamthumbsup: