简体   繁体   English

主线程上的createImagebitmap?

[英]createImagebitmap on main thread?

I have problem with lags while replacing textures so I decided to use createImagebitmap(it did not help).我在替换纹理时遇到滞后问题,所以我决定使用 createImagebitmap(它没有帮助)。 As far as I know, it should work on separated threads, not on the main one.据我所知,它应该在分离的线程上工作,而不是在主线程上。 While using dev-tools performance sections it is displayed as it is working on the main thread.在使用 dev-tools 性能部分时,它显示为它在主线程上工作。 Is that correct?那是对的吗? (I'm using angular+pixi.js on Chrome) (我在 Chrome 上使用 angular+pixi.js)

主线程

Javascript is a single threaded language. Javascript 是一种单线程语言。 This means it has one call stack and one memory heap.这意味着它有一个调用栈和一个内存堆。 As expected, it executes code in order and must finish executing a piece code before moving onto the next.正如预期的那样,它按顺序执行代码,并且必须在执行下一段代码之前完成一段代码。 Please see: https://dev.to/steelvoltage/if-javascript-is-single-threaded-how-is-it-asynchronous-56gd请参阅: https : //dev.to/steelvoltage/if-javascript-is-single-threaded-how-is-it-asynchronous-56gd

HTML5 and CSS3 are multithreaded, but javascript is not. HTML5 和 CSS3 是多线程的,但 javascript 不是。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM