by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • May 14 22:39
    @bjorno43 banned @minitechtips_twitter
  • May 14 22:38
    @bjorno43 banned @real-action
  • Feb 01 00:27
    @bjorno43 banned @Ndoua
  • Jan 07 03:10
    @bjorno43 banned @doctor-sam
  • Aug 17 2019 09:32
    User @bjorno43 unbanned @linkin-park
  • Jun 20 2019 21:19
    @bjorno43 banned @shenerd140
  • Apr 25 2019 17:13
    @mstellaluna banned @cmal
  • Jan 08 2019 22:05
    @mstellaluna banned @dertiuss323
  • Nov 07 2018 04:42
    User @texas2010 unbanned @ows-ali
  • Nov 02 2018 16:25
    @texas2010 banned @ows-ali
  • Oct 12 2018 05:50
    @bjorno43 banned @NACH74
  • Oct 05 2018 23:02
    @mstellaluna banned @JomoPipi
  • Sep 16 2018 12:21
    @bjorno43 banned @yash-kedia
  • Sep 16 2018 12:16
    @bjorno43 banned @vnikifirov
  • Sep 05 2018 08:12
    User @bjorno43 unbanned @androuino
  • Sep 05 2018 07:38
    @bjorno43 banned @androuino
  • Aug 23 2018 16:57
    User @bjorno43 unbanned @rahuldkjain
  • Aug 23 2018 16:23
    @bjorno43 banned @rahuldkjain
  • Jul 29 2018 14:13
    User @bjorno43 unbanned @jkyereh
  • Jul 29 2018 01:00
    @bjorno43 banned @jkyereh
Christopher McCormack
@cmccormack
you're filtering on all the cells every iteration
Adel
@AdelMahjoub
requestAnimation frame is most likemy updated at 60fps
Christopher McCormack
@cmccormack
in the slow version
Adel
@AdelMahjoub
yes query selector in this context will be more performant than getElement
refresh at 60fps + the iteration on 30x30 array
Christopher McCormack
@cmccormack
but using getElementsByClassName could you not eliminate at least one of the loops?
given I didn't review the code closely
Adel
@AdelMahjoub
we could yes
but I want the two method in the same context inside an iteration
Christopher McCormack
@cmccormack
grid = JSON.parse(JSON.stringify(nextGrid)); this is also very slow
I mean, relatively anyhow
Adel
@AdelMahjoub
that's actually surprising, but it is very fast
faster than spread operator
maybe because the implementation in chromium is fast idk
Christopher McCormack
@cmccormack
oops was I doing that on your project?
I'm sorry!
it's really fast now though
Adel
@AdelMahjoub
wow, amazing @cmccormack
that spread operator on a HTMLCollection !!
never thought about it :laughing:
Christopher McCormack
@cmccormack
probably not the fastest but I think it looks clean in code hehe
Adel
@AdelMahjoub
it is faster than earlier
Christopher McCormack
@cmccormack
sorry for editing your project though I thought it would only change for me
Adel
@AdelMahjoub
I invited you to edit, no problem , that was the purpose
Christopher McCormack
@cmccormack
glad I didn't delete a bunch of code then!
Adel
@AdelMahjoub
No I'm convinced that it is faster :laughing:
Christopher McCormack
@cmccormack
doesn't classList have a toggle method?
Adel
@AdelMahjoub
thats jQuery I think
idk when it was added , it seems clasList has a toggle method
Christopher McCormack
@cmccormack
yeah that api is pretty good
I think to use it in this context you would only want a single class though, maybe the default for a cell is whatever style you have for dead, then cell_live would change it
Adel
@AdelMahjoub
@cmccormack well I learned a lot, thank you
Christopher McCormack
@cmccormack
np
this stuff is always fun!
if @ezioda004 hadn't fallen asleep he could probably improve performance a bit more
Adel
@AdelMahjoub
usually I would use canvases for this stuff, but making it fast on the dom is good to try
Christopher McCormack
@cmccormack
I think it's pretty dang fast with just HTML haha
but I agree
I would probably change mine to canvas had I planned it from the beginning, mine isn't very performant
it would be if it didn't need click handlers I think
Adel
@AdelMahjoub
I made a lot of different versions, vue, angular, react all using dom and canvases, this one is one of a lot
it can be even faster using webgl with phaser
or pixijs
but yeah, one is a video game framework the latter is a rendering library so :laughing:
Adel
@AdelMahjoub
the good thing , it is possible to create git braches from glitch, now it is merged, I guess it will be useful for future ref
Christopher McCormack
@cmccormack
didn't know you could make branches that's neat
Adel
@AdelMahjoub
yeah, it is very different from what is was, very good work
live editing was like freezing every 2sec
Maybe they 'll add private projects in the future
Christopher McCormack
@cmccormack
like private github repos?