Giter Club home page Giter Club logo

Comments (2)

kevingpqi123 avatar kevingpqi123 commented on June 3, 2024 1

关于 ANR,有以下三个分析方向:
1、不是所有的 pag 文件的渲染性能都是一样的,pag 文件渲染的性能和素材复杂度强相关,其次就是和机型的计算能力,最直接的优化是素材,在中低端机上尽量使用纯矢量的素材,同时你们可以分析下,出现卡顿的场景大多是使用了含有 BMP 预合成的素材,一个 BMP 预合成相当于一个视频,而视频的解码有属于耗时耗资源的操作,在中低端机型上出现卡顿很正常,因此最直接的优化是优化素材,尽量使用纯矢量的或者分机型下发素材

2、卡顿还有一个原因可能是在 PAGView 播放的过程中直接销毁,由于 pag 是内部线程安全, 播放过程中每帧渲染的 flush 方法相对耗时,一种解决方案是页面销毁前提前调用 PAGView 的 stop 方法,尽可能早的终止播放,避免销毁时的方法调用等待播放时的 flush 方法

3、第三种优化方法:如果不涉及全屏播放、文本编辑或占位图替换,可以升级到 PAG 4.2 版本及以上,切换使用 PAGImageView, PAGImageView 支持将渲染结果缓存至本地,缓存完成后后续使用的是缓存数据

from libpag.

domchen avatar domchen commented on June 3, 2024

最近的几个版本修复了不少相关问题,建议升级一下。

from libpag.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.