Commit Graph

57 Commits

Author SHA1 Message Date
Dylan K. Taylor
10f3145af2 Merge branch 'minor-next' into major-next 2023-03-29 23:22:02 +01:00
Dylan K. Taylor
5e1f837a73 ... 2023-03-28 22:46:18 +01:00
Dylan K. Taylor
b49a9ae81d Added timings for calling events
this gives a somewhat better overview of events, particularly if many plugins are subscribed to the same costly event (e.g. PlayerMoveEvent).

In addition, it allows us to see the frequency that events are occurring.
2023-03-28 17:26:20 +01:00
Dylan K. Taylor
04197d6b80 Merge remote-tracking branch 'origin/minor-next' into major-next 2023-03-27 19:08:34 +01:00
Dylan K. Taylor
c1cef19f84 stringifyKeys 2023-03-27 01:17:15 +01:00
Dylan K. Taylor
cebdb95265 Optimise plugin timings report entries
this format is already supported by the timings host, so no changes are required to support this.
2023-03-27 01:15:42 +01:00
Dylan K. Taylor
a4d34be6df Merge branch 'minor-next' into major-next 2023-03-20 23:42:40 +00:00
Dylan K. Taylor
e7771d76f2 Cover buffered inventory sync in timings 2023-03-20 23:29:02 +00:00
Dylan K. Taylor
7cdab75b05 Merge branch 'minor-next' into major-next 2023-03-20 22:12:54 +00:00
Dylan K. Taylor
419962d3a2 Added timer for player-specific movement code
players use an entirely different pathway for movement processing, which could be costly.
2023-03-19 16:12:47 +00:00
Dylan K. Taylor
054c06fab9 Add specialized entityBaseTick timer for item entities
since item merging is a potential hotspot, we want to know if this code section is a performance problem.
Current timers only tell us whether overall ticking of a particular entity is slow, but that includes movement and therefore isn't particularly helpful.
2023-03-19 15:59:06 +00:00
Dylan K. Taylor
7bc5d8c824 Rename more timers 2023-03-19 15:57:36 +00:00
Dylan K. Taylor
607bdfa42f Timings: added new timers for entity move collision checks and projectile move ray tracing
projectiles get their own distinct sub-timer, since the logic is completely different from regular entities.
2023-03-19 15:49:35 +00:00
Dylan K. Taylor
eec53f9ae0 Timings: clean up timer names 2023-03-19 15:39:44 +00:00
Dylan K. Taylor
3d56bd267c Timings: fixup network timer inheritance 2023-03-18 23:13:25 +00:00
Dylan K. Taylor
6db2b022fb Merge branch 'next-minor' into next-major 2023-03-04 16:58:03 +00:00
Dylan K. Taylor
a523189149 Added separate timings for broadcast and session buffer compression 2023-03-04 16:41:41 +00:00
Dylan K. Taylor
50b8d39aba Merge branch 'next-minor' into next-major 2023-02-21 15:41:57 +00:00
Dylan K. Taylor
871bd169a8 Timings: remove unnecessary code 2023-02-19 17:58:12 +00:00
Dylan K. Taylor
9cdb641936 Added encode packet timings
these changes required some new APIs in BedrockProtocol.
2023-02-19 16:47:20 +00:00
Dylan K. Taylor
3a13f5cf5f Merge branch 'next-minor' into next-major 2023-01-16 19:56:51 +00:00
Dylan K. Taylor
edb8f19a0c Merge branch 'stable' into next-minor 2023-01-16 19:56:38 +00:00
Dylan K. Taylor
ab21fcdd67 Server: fixed load statistics not including Snooze processing time
this has been a bug ever since Snooze was first introduced. The load statistic, similarly to timings, did not account for time spent processing notifications between ticks. The problem is that this is often where a significant amoutn of the load actually comes from, because Snooze is most often activated due to incoming packets.

This change fixes the problem by including the time spent processing notifications since the previous tick in the current tick's usage metric.
2023-01-16 19:26:32 +00:00
Dylan K. Taylor
d9b8251f7b Merge branch 'next-minor' into next-major 2023-01-16 18:31:51 +00:00
Dylan K. Taylor
ad6a423d12 Merge branch 'stable' into next-minor 2023-01-16 18:30:13 +00:00
Dylan K. Taylor
768650cee0 CS 2023-01-16 17:46:50 +00:00
Dylan K. Taylor
c2c529e2da Include Snooze interrupts in timings results
fixes #5511

This requires any Timings instances to be updated to
pmmp/timings@5410f62436, otherwise the TPS
reported will be incorrect.
2023-01-16 17:40:39 +00:00
Dylan K. Taylor
8909aa6a18 Merge branch 'next-minor' into next-major 2023-01-13 17:29:25 +00:00
Dylan K. Taylor
dff3f45d22 Constify more tick-related things 2023-01-13 16:29:09 +00:00
Dylan K. Taylor
bd01a919e5 Move command timings to Timings::
this avoids duplicate timings entries when command labels are changed and changed back, or if multiple command maps are in use.
In addition, it also solves some PHPStan issues :)
2022-10-16 16:57:10 +01:00
Dylan K. Taylor
c8a8e33fc1 Merge branch 'next-minor' into next-major 2022-07-24 21:24:08 +01:00
Dylan K. Taylor
42f9336f7a Split packet receive timings into decode and handle subcomponents 2022-07-24 21:16:52 +01:00
Dylan K. Taylor
aa9f8781ff Merge branch 'next-minor' into next-major 2022-06-07 19:56:26 +01:00
Dylan K. Taylor
38cf9fc6e6 Fixed some timings not being initialized in unit tests
previously this error was unnoticed, since uninitialized typeless properties are populated by NULL, but now it causes an error to be thrown.
2022-06-04 18:27:22 +01:00
Dylan K. Taylor
083a35f970 Modernize property type declarations 2022-06-04 18:16:32 +01:00
Dylan K. Taylor
38d6284671 Use PHP-CS-Fixer to enforce file header presence 2022-06-04 17:34:49 +01:00
Dylan K. Taylor
1d5430937f Modernize private property declarations in src/timings 2022-05-17 21:54:45 +01:00
Dylan K. Taylor
bcc3e87730 Timings: rename core timers to remove 'timer' from the names
this makes them shorter and more consistent.
2020-12-23 17:52:25 +00:00
Dylan K. Taylor
5282ae3298 TimingsHandler::printTimings() now returns a list of strings instead of requiring a resource 2020-12-09 22:32:32 +00:00
Dylan K. Taylor
58db3531c7 Use hrtime() for collecting timings
this allows nanosecond resolution and generally better accuracy than microtime(), which is subject to floating-point errors.
2020-12-09 22:24:31 +00:00
Dylan K. Taylor
5197707d32 Separated TimingsRecord from TimingsHandler (different lifetimes)
this fixes #3906.
TimingsHandler will now be automatically destroyed when there are no TimingsRecord referencing it and its owner has no references left to it.
TimingsRecord will be automatically destroyed at the end of the timings session (if active).

This fixes records from temporary timers being lost after the timings handlers are removed, while also fixing TimingsHandlers piling up regardless of whether timings are running or not.
This opens the doors to have more volatile timers, such as per-player/per-session timers, which are destroyed on player quit, but which won't result in the timings disappearing from the final timings result.
2020-12-03 15:45:49 +00:00
Dylan K. Taylor
0634426c26 PermissibleBase: compute permission diff, do not fire callbacks when diff is empty
this fixes AvailableCommandsPacket getting sent twice when adding a PermissionAttachment.
2020-12-02 01:09:29 +00:00
Dylan K. Taylor
87033592b1 Timings: remove obsolete timings handler 2020-12-01 17:40:09 +00:00
Dylan K. Taylor
4d42f0c3db Timings: added timers for player data I/O 2020-11-27 00:02:34 +00:00
Dylan K. Taylor
31089ce3b2 Timings: added broadcastPackets timer
the body of this function is potentially very expensive and isn't currently recorded by any timer.
2020-11-12 17:53:07 +00:00
Dylan K. Taylor
3bf87378ef Merge branch 'stable'
# Conflicts:
#	resources/vanilla
#	src/pocketmine/VersionInfo.php
#	src/pocketmine/level/LevelTimings.php
2020-11-08 19:44:30 +00:00
Dylan K. Taylor
98db4c5200 Merge branch 'stable' into master
# Conflicts:
#	.gitmodules
#	composer.lock
#	resources/vanilla
#	src/network/mcpe/protocol/PlayerAuthInputPacket.php
#	src/pocketmine/Player.php
#	src/pocketmine/network/mcpe/protocol/LoginPacket.php
2020-08-10 17:55:49 +01:00
Dylan K. Taylor
3473254d01 added Timings::INCLUDED_BY_OTHER_TIMINGS constant 2020-05-24 16:09:45 +01:00
Dylan K. Taylor
fb1126797a Merge branch 'stable' 2020-02-07 18:13:55 +00:00
Dylan K. Taylor
5c4487c980 added some callable prototypes for phpstan 2020-01-29 19:56:16 +00:00