Skip to content

Performance: first-time asset display causes frame hitches, then stabilizes #14

Description

@harrytyp

Description

HD textures are loaded lazily on first use (HdObjectManager / HdCostumeManager texture caches with synchronous PNG decode). The first time an asset is displayed — an object, a costume or a background — the frame rate drops noticeably for a moment, then returns to stable levels.

Observed e.g. in the cannon scene (room 10): the first time the skeleton boats render, there is a visible hitch; subsequent frames are smooth.

Likely cause

Synchronous loadObject / loadCostume / loadBackground (PNG decode + cache insert) running inside the render path (renderHDComposite), blocking the frame while a large texture is decoded.

Possible directions

  • Preload / prewarm the texture cache when entering a room
  • Asynchronous (background) texture loading
  • Move decode out of the render path

Environment

  • comiupscale ScummVM fork, HD mode 4x (2560x1920)
  • Reproduced headless and on desktop

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    performancePerformance optimization

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions