Git Product home page Git Product logo

Comments (1)

SYFH avatar SYFH commented on July 17, 2024

0.1.2 版本去除了可能会频繁切换线程代码, 现在只保留了线程锁, 线程调度和切换全部由业务层决定.
Demo 中可以测试一次性添加超多任务的需求, 可以将添加任务组包含到子线程中, 再用 -[FKDownloadManager addedBlock] 获取一添加完任务后事件来刷新 UI.
我已在模拟器中测试过在子线程中一次性添加 5000 个任务, 基本上 CPU 瞬间飙升到 70% 后又回落至 1%, 内存上涨 20 MB 左右, 恒定 1% 是因为有 Timer 运行(可以配置 calculateSpeedWithEstimated = NO 关闭), 20 MB 是任务的内存缓存.
目前的 Timer 已经从 NSTimer 替换成 GCD Timer, 否则 5000 个任务的 Timer 将恒定占用 30% 左右的 CPU.

from fkdownloader.

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.