Version: 5.5
iOS 성능 최적화
빌트인 프로파일러로 성능 측정(Measuring Performance with the Built-in Profiler)

iOS 관련 최적화(iOS Specific Optimizations)

이 페이지에서는 iOS 기기 배포에만 해당되는 최적화에 대해 자세하게 설명합니다.

스크립트 호출 최적화(Script Call Optimization)

Most of the functions in the UnityEngine namespace are implemented in C/C++. Calling a C/C++ function from a Mono script involves a performance overhead. You can use iOS Script Call optimization (menu: Edit->Project Settings->Player) to save about 1 to 4 milliseconds per frame. The options for this setting are:-

  • Slow and Safe - the default Mono internal call handling with exception support.
  • Fast and Exceptions Unsupported - a faster implementation of Mono internal call handling. However, this doesn’t support exceptions and so should be used with caution. An app that doesn’t explicitly handle exceptions (and doesn’t need to deal with them gracefully) is an ideal candidate for this option.

원하는 프레임 속도 설정(Setting the Desired Framerate)

Unity iOS를 사용하면 애플리케이션이 렌더링 루프 실행을 시도하는 빈도를 변경할 수 있습니다. 기본 설정은 초당 30프레임입니다. 이 숫자를 낮춰서 배터리 소모를 줄일 수 있지만, 그러면 당연히 프레임 업데이트가 감소하는 대가를 치러야 합니다. 반대로 프레임 속도를 높여서 터치 입력이나 가속 센서 등 다른 작업보다 렌더링에 더 높은 우선 순위를 부여할 수도 있습니다. 프레임 속도를 다양하게 선택하고 실험해 보면서 게임플레이에 미치는 영향을 파악해야 합니다.

애플리케이션이 많은 연산이나 렌더링을 수반하고 예를 들어 초당 15프레임만 유지할 수 있는 경우 원하는 프레임 속도를 15보다 높게 설정해도 성능이 향상되지 않습니다. 더 높은 프레임 속도를 얻을 수 있으려면 애플리케이션을 충분히 최적화해야 합니다.

원하는 프레임 속도를 설정하려면 Application.targetFrameRate를 변경해야 합니다.

가속 센서 프로세싱 프리퀀시 튜닝(Tuning Accelerometer Processing Frequency)

가속 센서 입력이 너무 자주 처리되는 경우, 게임의 전반적인 성능이 저하되는 원인이 될 수 있습니다. Unity iOS 애플리케이션은 기본적으로 가속 센서를 초당 60번 샘플링합니다. 가속 센서 샘플링 빈도를 낮추면 성능이 다소 향상될 수 있고, 가속 센서 입력을 사용하지 않는 게임의 경우 0으로 설정할 수도 있습니다. 가속 센서 빈도는 iOS 플레이어 설정Other Settings 패널에서 변경할 수 있습니다.

iOS 성능 최적화
빌트인 프로파일러로 성능 측정(Measuring Performance with the Built-in Profiler)