15
v-vp
4y

Keep it simple.

Comments
  • 4
    If only there wasn't a huge performance difference between a regular for loop and a forEach function
  • 3
    @Tayo If you care about the minimal performance difference the two have, you should not be writing JavaScript.
  • 1
    @PrivateGER Still makes a difference on bulk operations. Can make an effective difference using webWorkers, for example.
  • 2
    @010001111 If you're doing serious bulk processing with Javascript of all things, you're doing something wrong. Most heavy stuff should be done by the server.
  • 1
    @PrivateGER Our application fetches a ton of table data (35+ columns, 5000+ rows) obviously loaded in chunks from the server. But for faster app and offline usage, we store and diff all these rows to estimate the most-likely relevant data, that has been loaded before.
  • 2
    @PrivateGER (We‘re investigating in wasm, not at the limits right now, tough)
  • 1
    @010001111 Yeah, you should definitely look into WASM for that. It's practically made for such applications.
  • 0
    But can u can break out of for loop, I don't have idea about for each
  • 0
    @shiv7071007 Of course you can.
  • 2
    @PrivateGER if only NodeJS didn't exist
  • 0
    I like a typical loop better because:

    -It doesn't affect "this"
    -It has an iterator (if you're wanting to look at item n+1 or n-1, very helpful)
  • 0
    @Tayo Eh, Node can easily use WASM files.
  • 1
    @PrivateGER yes, but how many script kiddies will actually use WASM instead of doing the ez JavaScript which is "fast enough"

    I mean, if it's slow, just add more servers right
  • 0
    The nerd level on this post is huge. :P
  • 1
    @CaptainRant Well that’s what I signed up for!
Add Comment