任务调度
Search documents
腾讯申请任务调度方法及相关装置专利,提高任务处理效率
Jin Rong Jie· 2025-12-04 12:13
本文源自:市场资讯 国家知识产权局信息显示,腾讯科技(深圳)有限公司申请一项名为"任务调度方法、装置、电子设备 及存储介质"的专利,公开号CN 121050841 A,申请日期为2024年5月。专利摘要显示,本申请涉及计 算机技术领域,尤其涉及一种任务调度方法、装置、电子设备及存储介质,所述方法包括:从所述预设 资源中确定多个候选资源;对所述多个候选资源进行性能分析,得到所述多个候选资源各自对应的资源 性能信息;对所述每个候选资源的资源性能信息,以及所述目标任务与所述每个候选资源的标签匹配度 进行数据融合处理,得到所述目标任务与所述每个候选资源的关联度基于所述目标任务与所述每个候选 资源的关联度,从所述多个候选资源中确定目标资源;将所述目标任务分配给所述目标资源。本申请能 够在提高任务分配效率的同时,实现各资源的负载均衡,进而提高资源利用率以及任务处理效率。 作者:情报员 天眼查资料显示,腾讯科技(深圳)有限公司,成立于2000年,位于深圳市,是一家以从事软件和信息 技术服务业为主的企业。企业注册资本200万美元。通过天眼查大数据分析,腾讯科技(深圳)有限公 司共对外投资了15家企业,参与招投标项目275次, ...
为什么 setTimeout(0) 不是真的 0 毫秒?浏览器藏了这些“小心思”
程序员的那些事· 2025-09-14 11:04
Core Viewpoint - The article discusses the behavior of JavaScript's `setTimeout` function, highlighting that it does not execute with a true delay of 0 milliseconds, but rather has a minimum delay of approximately 4 milliseconds due to browser limitations aimed at preventing abuse and ensuring user experience [6][8]. Group 1: Timer Behavior and Limitations - Browsers impose a minimum delay of 4 milliseconds for `setTimeout` to prevent excessive battery drain and maintain page interactivity [8]. - Different browsers have varying restrictions, with older versions of Edge increasing the delay to 16 milliseconds on battery-powered devices, and Chrome imposing a 1-second delay on background tabs [8]. - A benchmark test showed that `setTimeout` in Chrome took 4.2 milliseconds, while alternatives like `MessageChannel` and `scheduler.postTask` performed significantly better [10][11]. Group 2: Alternatives to setTimeout - The article evaluates alternatives to `setTimeout`, including `setImmediate`, `MessageChannel.postMessage`, `window.postMessage`, and `scheduler.postTask`, with the latter being recommended for its ease of use and performance [9][11]. - The benchmark results indicated that `scheduler.postTask` and `MessageChannel.postMessage` had comparable performance, while `setTimeout` was consistently slower across different browsers [10][11]. Group 3: Developer Responsibility and Browser Design - There is a debate within the industry regarding whether developers should be held accountable for their code or if browsers should impose restrictions to prevent misuse of APIs like `setTimeout` [12]. - The article suggests that providing developers with better tools for task scheduling could reduce reliance on `setTimeout` and the need for browser interventions [12][13]. - The existence of the Scheduler API indicates a shift towards empowering developers while aligning with browser rendering processes [13].