CTR Pia
4.11.3
Game Communication Engine
|
This profiling program measures the load on the CPU and the amount of memory used when communicating using Pia and NEX.
You can measure these values by changing the macros in ProfilingTest_Common.h
. This program does not serve as a good sample because it implements a large number of features for profiling. A compatible NEX package is required to build this program. With this sample, communication is possible with a maximum of 12 devices by default.
You can adjust the profiling conditions by building your program with the appropriate macros in ProfilingTest_Common.h
set to 1
. By default, the Pia library does not measure CPU load or memory usage during communication. Nintendo recommends running a release build to minimize the processing load caused by log output.
Macro | What Is Profiled |
---|---|
ENABLE_CPU_PROFILING | Enables profiling of the CPU load. |
ENABLE_MEMORY_PROFILING | Enables profiling of memory usage. |
ENABLE_WATERMARK | Enables profiling of the peak values of Pia's internal buffer usage. |
ENABLE_LOCAL | Profiles when in local communication. When set to 0 , profiles when in Internet communication (default). |
ENABLE_NEX_NETZ | Profiles using NEX's NetZ . When set to 0 , uses Pia for profiling (default). |
ENABLE_UNRELIABLE_COMMUNICATION | Profiles when using unreliable communication. Do not enable at the same time as ENABLE_RELIABLE_COMMUNICATION . |
ENABLE_RELIABLE_COMMUNICATION | Profiles when using reliable communication. Do not enable at the same time as ENABLE_UNRELIABLE_COMMUNICATION . |
GAME_PARTICIPANTS_NUM | Sets the maximum number of devices that can participate in a session. Operation has been confirmed for up to 12 devices. |
ENABLE_CPU_PROFILING
in ProfilingTest_Common.h
to 1
and build. The following information appears in the log output of the debugger.
Press A : Start automatch Press B : Logout
Press the A Button to perform matchmaking. The console that first started random matchmaking becomes the host. After that, consoles on which the A Button (for Internet communication) or the Y Button (for local communication) is pressed can perform matchmaking as clients until the number of devices set in the GAME_PARTICIPANTS_NUM
session macro is reached.
After the number of systems set in GAME_PARTICIPANTS_NUM
have been matched, the program transitions to the profiling sequence automatically.
Press the A Button during matchmaking to transition to the profiling sequence with the currently matched systems.
Press A : Start profiling for game loop Press START: Start (unreliable/reliable) communication
-- Profiler -- PiaSession StationNum: 2 Idle Profile Result: 9913 (10000 [ms], 9913) Base Profile Result: 9105 (10000 [ms], 9105) Target Profile Result: 8910 (10000 [ms], 8910) Profile Result: 1.97 % -- Packet Loss -- StationId: 1 SendTo(Lost/Total (ratio)):( 0 / 0 (0.00%))) Multicast: 0 StationId: 2 SendTo(Lost/Total (ratio)):( 0 / 0 (0.00%))) Multicast: 0 -- ThreadStreamManager -- ReceivePacket: 10 SendPacket: 322
ProfilingTest_Common.h
file, set ENABLE_CPU_PROFILING
, ENABLE_MEMORY_PROFILING
, and ENABLE_WATERMARK
to 1
, set USE_MULTIUNITHEAP
to 0
, and then build the program. Press A: Start automatch Press B: Logout Press Y: Logout and NEX Finalize // Only appears during Internet communication.Press the A Button to perform matchmaking.
GAME_PARTICIPANTS_NUM
session macro is reached. GAME_PARTICIPANTS_NUM
have been matched, the program transitions to the profiling sequence automatically. Press A : Start profiling for game loop Press X : Print watermark result Press R : Print memory report Press START: Start (unreliable/reliable) communication
ENABLE_RELIABLE_COMMUNICATION
is enabled, Reliable communication begins automatically. When ENABLE_UNRELIABLE_COMMUNICATION
is enabled, Unreliable communication begins automatically. FinalizeRuntimeMemory:Nex memory usage: Now memory usage:0, Max memory usage:241888 / 1099776If you profile using a
NetZ
module built with ENABLE_NEX_NETZ
set to 1, this value is the memory usage. ENABLE_NEX_NETZ
and ENABLE_LOCAL
set to 0
during the build, this value becomes the amount of NEX memory used when Pia communicates with the server. The sum of this value and the value that results the next time you profile optimized Pia memory use is the amount of memory used. Watermark: <SendThreadStream buffer num> max: 4, min: 0, latest: 0, Updates: 3654 Watermark: <ReceiveThreadStream buffer num> max: 8, min: 0, latest: 0, Updates: 1840 Watermark: <StationProtocolReliable send buffer num> max: 3, min: 0, latest: 3, Updates: 166 Watermark: <StationProtocolReliable receive buffer num> max: 0, min: 0, latest: 0, Updates: 67 Send: 916, Recv: 719 Pia memory usage: 435160 bytes. (424 KB)