WEB WORKERS made my code over 100x faster (almost ZERO blocking time)

Поделиться
HTML-код
  • Опубликовано: 11 дек 2024

Комментарии • 27

  • @JoshuaMorony
    @JoshuaMorony  15 часов назад +1

    I also have another video covering this stuff (and more) from a game dev perspective on my other channel if you'd like to check it out: ruclips.net/video/7BXvpUbNRno/видео.html

  • @aheendwhz1
    @aheendwhz1 15 часов назад +41

    I almost didn't click on this video, because RUclips shit-translated title and description

    • @gigachad8091
      @gigachad8091 12 часов назад +13

      For me it said Web Employees 😂

    • @NoName-1337
      @NoName-1337 8 часов назад

      @@gigachad8091 true, "Web-Worker" -> "Web-Mitarbeiter". It makes no sense.

  • @NoName-1337
    @NoName-1337 11 часов назад +32

    Uff, yt translates everything into my native language. Horrible.

  • @Simon-yf7fo
    @Simon-yf7fo 11 часов назад +11

    RUclips funily translated the title to Web-Mitarbeiter in german which means web coworker.

  • @karamuto1565
    @karamuto1565 11 часов назад +1

    I also used web workers in our companies project as a request intercepter to a 3rd party application. This also provided the benefit of a cheap caching mechanism.

    • @ralusek
      @ralusek 8 часов назад +1

      Sounds like a service worker

    • @karamuto1565
      @karamuto1565 7 часов назад

      @ralusek oh you got me. I totally mistake them for each other all the time

  • @FloKorp86
    @FloKorp86 14 часов назад +1

    I like the way you think!

  • @AbegazNap
    @AbegazNap 14 часов назад +2

    ever the excellent teacher

  • @judgewest2000
    @judgewest2000 10 часов назад

    Thjis is beautiful.
    Here's a question, with the sheer advances in GPU-native web browser support bluring the lines between a native mobile app or a PWA (or wrapped, don't really mind), web workers, and a TON of native support for other things - other than very few people targeting millions, is there really a benefit anymore to still doing native? This is mainly a mobile question

    • @JoshuaMorony
      @JoshuaMorony  3 часа назад +1

      For a game I think there are definitely strong benefits to going with a lower level/non-browser language, but as for general mobile apps/PWAs I've been of the opinion for a while that JS via something like Ionic/Capacitor is good for the majority of use cases

    • @judgewest2000
      @judgewest2000 2 часа назад

      ​@@JoshuaMorony Appreciate the opinion thank you very much.
      I have built a ton of Ionic stuff for firms with < 1000 users (usually employees, e.g. sales order lookup etc with some offline but not much) and started with Cordova, then Capacitor, but since then I have moved them to pure PWA for one reason. I HATE the app stores!

  • @tmbarral664
    @tmbarral664 10 часов назад

    Joshua, I'd like to know if an OffscreenCanvas could have been helpful here ?

    • @JoshuaMorony
      @JoshuaMorony  3 часа назад

      I haven't experimented with it and don't know much about it, so not sure, but potentially

  • @diadetediotedio6918
    @diadetediotedio6918 12 часов назад

    5s in JS are 5ms in lower level languages, just saying

    • @JoshuaMorony
      @JoshuaMorony  3 часа назад +1

      I mostly went with JS with this because I'm good with it, I can leverage Angular, and I figured it would be a good way to also learn more about perf optimisation in JS/browser. But yes, this path is going to make some things harder and hopefully I don't end up regretting it. At least I'll learn something.

    • @diadetediotedio6918
      @diadetediotedio6918 3 часа назад +1

      @@JoshuaMorony
      Well, I'm not personally opposed to it, I just felt that WFC would benefit from a more performant language. I think you can even leverage wasm to do the heavy lifting and use JS for the core game logic, it is an interesting idea, don't you think?
      Also, talking about web frameworks, I'm personally curious, what is your opinion on solid-js, have you used it before? I recently used it and I felt it resonates with me more than angular, so I think your personal view on the enjoyability of it would be interesting

    • @typedpixels
      @typedpixels 3 часа назад

      ​@@diadetediotedio6918 yes I absolutely agree, but also these are the sorts of awkward situations I kind of wanted to get myself into to see how I could solve it with JS (and yes wasm is absolutely something I want to look into)
      I've never used SolidJS, but I have followed its development somewhat, and if I were to pick a framework solely based on how closely it aligns to how I think about coding/app dev it would probably end up being either SolidJS or CycleJS

  • @aheendwhz1
    @aheendwhz1 14 часов назад +1

    I almost did not click on this video, because RUclips shit-translated title and description

  • @delta4v
    @delta4v 8 часов назад

    Web worker + Shared Array Buffer + wasm = maximum performance

    • @JoshuaMorony
      @JoshuaMorony  3 часа назад

      I haven't had the chance to use SharedArrayBuffer yet, but I have a fire spreading/heat transfer simulation mechanic in this game which is causing me some grief with performance still, I'm thinking there might be the potential here to utilise a worker/SharedArrayBuffer to improve this

  • @Barrybario
    @Barrybario 14 часов назад +2

    It's a shame the interface for working with web workers is so basic

  • @zlatanonkovic2424
    @zlatanonkovic2424 3 часа назад

    The German translation for this video is "Web Coworkers".
    Just don't. Please. I know it's well meant but we're all software engineers. We speak English.
    If the title is translated, I won't click on the video. I won't watch the video.

    • @JoshuaMorony
      @JoshuaMorony  3 часа назад

      It's a new feature that's enabled by default, I'm not sure if I have any control over it. I can control the audio dubs, but I haven't been able to find any settings for title translations, I think this might be a user side setting.