2024-02-27 10:36:03 +00:00
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
|
|
|
|
|
|
|
using System;
|
|
|
|
|
|
|
|
namespace osu.Game.Performance
|
|
|
|
{
|
2024-02-27 12:46:25 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Allows creating a temporary "high performance" session, with the goal of optimising runtime
|
|
|
|
/// performance for gameplay purposes.
|
|
|
|
///
|
|
|
|
/// On desktop platforms, this will set a low latency GC mode which collects more frequently to avoid
|
|
|
|
/// GC spikes.
|
|
|
|
/// </summary>
|
2024-02-27 10:36:03 +00:00
|
|
|
public interface IHighPerformanceSessionManager
|
|
|
|
{
|
2024-04-16 01:51:43 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Whether a high performance session is currently active.
|
|
|
|
/// </summary>
|
|
|
|
bool IsSessionActive { get; }
|
|
|
|
|
2024-02-27 12:46:25 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Start a new high performance session.
|
|
|
|
/// </summary>
|
|
|
|
/// <returns>An <see cref="IDisposable"/> which will end the session when disposed.</returns>
|
2024-02-27 10:36:03 +00:00
|
|
|
IDisposable BeginSession();
|
|
|
|
}
|
|
|
|
}
|