owned this note changed 4 years ago
Published Linked with GitHub

陳柏融(PJCHENder)- JavaScript 中鼓勵用非同步的 API,但用了就會提升效能避免阻塞嗎?

歡迎來到 JSDC 2020 下半場 | 術場 (14:00 ~ 17:00) 共筆

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

共筆入口:https://hackmd.io/9r79EYfvTgW23Yy9fgTFxA

點選主題就可以進到個別場次的共筆

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

tags: jsdc2020, 下 半場 - 術場

MDN Web Worker

Event Loop + 非同步語法(ex:SetTimeout, Promise)並不會讓主執行緒不被複雜運算卡住
非同步語法只是讓複雜運算晚一點發生,實際執行運算的地方還是在主執行緒

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

web worker可以開另外一個執行緒,把複雜運算放到web worker來做,就能避免主執行緒被複雜運算占用而有卡住現象
前端和後端都有web worker
前端卡住現象:使用者畫面hang住
後端卡住現象:無法取得回應

Select a repo