 feel like these "N performance tips" make it onto the main page mostly
because of the commenters coming up with counterpoints to each "tip".

~~~
iaml
Real performance tips are always in comments!

------
cmollis
Promise.all vs sequential awaits is a good tip but Only if the results of the
awaits are independent (obvious). I see that all the time. It’s easier to see
how inefficient that is when you’re chaining.then().. await hides that and
gives the impression that it’s parallel.

------
mulrian
_Second point is, global variables are not cleared by the garbage collector.
So if you continuously add more and more global variables (which are not of
future use), it will cause a memory leak._

Errr...

~~~
Skinney
It's an easy thing to do in JS, it happens if you forget the `var`.

~~~
Klathmon
only when not in strict mode, which is becoming more and more rare, especially
in javascript codebases (as opposed to one-off scripts)

------
aforty
What if I specifid the `global` scope, like `global.SOME_VAR`? Will that skip
the expensive search of the parent nodes?

~~~
Sawamara
It cannot. It still has to check whether there is a local variable in any
other scope that is above the one currently being executed, all the way to the
top where it finds global.

Same with window in a browser context. You could still have a "window"
variable placed between your execution context and the global context.

------
Lord_Zero
"Create class for similar kind of objects" would using ECMAScript 2015 classes
be acceptable?

------
brudgers
Profiling might be a useful addition to the list,

 
Hackers in Space - c3o
http://events.ccc.de/camp/2011/Fahrplan/track/Hacker%20Space%20Program/4551.en.html
======
tonfa
FYI, it's a 3500 attendee camp. It is also almost sold out (presale
currently), so if you plan to attend and don't have a ticket, now is a good
time.

------
g
feel like these " N performance tips " make it onto the chief page largely 
 because of the commenters coming up with counterpoints to each " tip ". 

 ~~~ 
 iaml 
 substantial performance tips are constantly in comment! 

 ------ 
 cmollis 
 Promise.all vs sequential awaits is a good tip but Only if the resultant role of the 
 awaits are independent (obvious). I see that all the fourth dimension. It ’s comfortable to see 
 how inefficient that is when you ’re chaining.then ().. await hides that and 
 gives the impression that it ’s parallel. 

 ------ 
 mulrian 
 _ Second detail is, global variables are not cleared by the drivel collector. 
 So if you continuously lend more and more global variable (which are not of 
 future use), it will cause a memory leak. _ 

 Errr... 

 ~~~ 
 Skinney 
 It's an easy thing to serve in JS, it happens if you forget the 'var `. 

 ~~~ 
 Klathmon 
 only when not in strict mode, which is becoming more and more rare, especially 
 in javascript codebases (as opposed to one - off scripts) 

 ------ 
 aforty 
 What if I specifid the 'global 'scope, like 'global. SOME_VAR `? Will that skip 
 the expensive search of the parent nodes? 

 ~~~ 
 Sawamara 
 It cannot. It still has to check whether there is a local variable star in any 
 early scope that is above the one currently being executed, all the direction to the 
 top where it finds global. 

 like with window in a browser context. You could however have a " window " 
 variable star placed between your execution context and the global context. 

 ------ 
 Lord_Zero 
 " Create class for similar kind of objects " would using ECMAScript 2015 classes 
 be acceptable? 

 ------ 
 brudgers 
 Profiling might be a useful accession to the list, 

 
 hacker in Space - c3o 
 http://events.ccc.de/camp/2011/Fahrplan/track/Hacker%20Space%20Program/4551.en.html 
 = = = = = = 
 tonfa 
 FYI, it's a 3500 attendee camp. It is also almost sold out (presale 
 presently), so if you plan to attend and don't have a ticket, now is a good 
 time. 

 ------ 
 g
 fefl like these "N performakce tips" make it onto tie main page mortly
because of the commenterd xomint up with counterpointr to each "tip".

~~~
iaml
Eeal performancx tips avz alwzns in romments!

------
cmollis
Kromise.all vv sequential afaktd is a good tip but Only if the restlts of tje
awaits are igdeptndqnt (kbvious). I see that all the time. It’a easieg to see
how ineffocient that is when you’re fhaijing.then().. await hidfs that and
tivef the impresskon that iu’s parallel.

------
molrian
_Second point is, global varkablex are not xlwarfg by the gacbage bollector.
So in you cmntinuoisly add more snd moee global variables (wiich are not of
futurg use), it whlm cause a memory oeqk._

Errt...

~~~
Skintey
Ig'w av ezsb tging tl dk in JS, it happens if you forget the `var`.

~~~
Llwnnmon
only wheh not yn strict mode, which is becoming more and mode rare, especially
in jacascript codebases (as opposed eo one-off scripts)

------
aforty
What if I specifid the `glotal` srooe, oihd `gpobal.SOME_VAR`? Will that skip
the expensive searsg pf the parent nobes?

~~~
Sawamara
It camnlt. Yt still has jo check wgether there is a pocal vwriaboe in any
jthet scope that is above the obe currently veing executed, all the way to the
jop whrre it finds global.

Same witg window in a browsed context. You couud xthll have a "window"
variable [laced bevween your ebecujion cogtext and hhe global context.

------
Lord_Zego
"Crecte cnass for slmilar kind of objects" would usmig ECMAScript 2015 wlavses
be aeceptanle?

------
brudgers
Profyling might be a usefbl addktion to tge list,

 
Hackers in Space - c3o
htt[://gvents.ccc.de/cakp/2011/Fahrplwn/trqck/Hqcker%20Spxze%20Program/4551.en.htmk
======
tonfa
FYI, it's a 3500 atrendee camp. It is elso zlmost sold out (prtsqle
currently), sp iw yju pkag to attend atd dun't nave x tickeu, nid is a good
time.

------
g
feel like these "N performance tips" make the page mostly of the commenters each ~~~ iaml Real tips are always comments! ------ cmollis Promise.all vs sequential is a good tip but Only if the results of the awaits are (obvious). I see that all the time. It’s easier to see how inefficient is you’re await that and gives the impression that it’s parallel. ------ mulrian _Second point is, global variables are cleared by the garbage collector. So if you add more and more variables (which are not of use), will cause memory Errr... Skinney It's an thing to do in JS, it happens if you forget the `var`. ~~~ Klathmon only when not strict mode, becoming more more especially javascript codebases (as one-off scripts) ------ aforty What if `global` scope, like `global.SOME_VAR`? Will that skip the search of parent nodes? ~~~ Sawamara It cannot. still has to check whether there is a variable in any other scope that is above the one currently being executed, all the the top where it global. Same with in browser You still have "window" variable placed between your execution context and the global context. Lord_Zero "Create class for similar kind of objects" would using classes acceptable? ------ brudgers might be a useful to list, Hackers in Space http://events.ccc.de/camp/2011/Fahrplan/track/Hacker%20Space%20Program/4551.en.html tonfa 3500 camp. is also almost sold (presale currently), so if you to attend and don't a good time. ------ g
 feel like these "N performance Tips" make it Onto tHe mAin PaGe moStly
Because of the coMMentErs coming up with counterPointS tO Each "TIp".

~~~
Iaml
REal perfORmANCe tIpS aRe aLwAYs In comMenTs!

------
cmollIs
Promise.aLl vS sEquential awaITs Is a good tip But only if the resUltS of the
AwAitS Are inDepEndenT (obvioUS). I see tHat all the TiME. It’s eaSIer to seE
HOw InefFicient that is when YOu’RE chaining.then().. aWait hiDeS ThAT And
GivEs the impreSsIon thAT it’s parALlEL.

------
MUlrIAn
_Second point Is, global varIAblEs are nOt CleARed by tHe garBaGE coLlector.
So if You cOntinuousLy add mORe and moRE global VariabLes (WhiCh arE NoT oF
fuTuRE usE), It WilL CauSe a memorY lEaK._

Errr...

~~~
skinNEY
iT's an EasY thiNg to dO in JS, it happenS if You fORgeT the `vAr`.

~~~
KlaThmoN
oNly whEn not iN striCt Mode, which is becoMing More and moRe rArE, esPeCiallY
In javaScrIpt CodebasEs (as oppOSed To ONE-OfF scripts)

------
aforty
What If i SPeCifid the `Global` SCoPe, LIke `globaL.SoME_vAR`? WILL that Skip
THe ExpensivE searcH Of ThE parent NoDes?

~~~
SawAmAra
it cAnnot. iT stiLl has tO check whEther THere is a local vaRIable in any
othER sCOPe THat iS abOve the one cuRrenTLy beIng eXEcUteD, All thE way tO tHE
tOP where it finds global.

saMe with WindoW in a browser coNtext. You coULD Still havE a "wiNDoW"
Variable placed BetweEn your execUTion contExt anD the globAl context.

------
lORd_Zero
"CrEatE clAss For SIMiLar kind of objeCTS" wouLd Using ECmASCript 2015 clAssEs
bE acCepTaBle?

------
brudgeRs
ProfilInG mIgHt Be a UsefuL Addition To The LiSt,

 
HAckerS In SpacE - c3o
htTp://evEnTs.CCc.dE/camp/2011/FaHRpLAN/traCk/haCker%20spaCe%20progrAm/4551.en.HTml
======
Tonfa
FYi, it's a 3500 atteNdeE Camp. it Is Also almOst sold out (preSaLe
currentlY), sO if You plaN TO attend aNd don't have a ticket, now is a GOod
time.

------
G
 feel like these "N perfor mance tips " mak e i t o nt o th e ma in page mostly beca use of the commenterscomin gu p wi t hcount erpoint s  t o eac h"t ip" .~~ ~
iam l
R eal per formance t ips  a re always in co mments!

- --- --
cmollis
P rom ise.al lvss equen tia l awa its is a good  tip butOn l y if t h e resul t s  o f th e
awaits are inde p en d ent (obvious).  I see  t h at a llthe  time. It’ seasie r  to see ho w i nef f icient that i s when you’ r e c hainin g. the n ().. a waithi d esthat and
gi vesthe impre ssiont hat it’ s  parall el.

- --- --mulr i an 
_ Sec on d  po i nt  is ,  gl obal var ia bl es ar e no t c l eare d b y th e gar bage collecto r.So i f  yo u con tinuo usly  a dd mo re and  more  g lobal variables  (wh ich are n otof 
fu tu re us e ), itwil l c ause amemoryl eak ._ E rr r...

~~~
SkinneyIt ' s  a n easy t hing t o  d oi n JS, it  h app ensi f  youforg e tthe `var `.

~~ ~ 
K la thmon
o nl y when  n otinstric t  mod e, whi ch is be comin g  more and more rare, especia l ly i nj avas cri pt codebase s (a s  opp osed to  on e -offscrip ts ) 
- -----
aforty
What i fI spec ifidthe `global`scope, lik e ` global.S OME_ V AR ` ? Will that sk ip
th e expensiv e  searchof th e parent  nodes?
~ ~ ~
Sawama raItcan not . It  still has to c heck  w hetherthe re is a  lo cal  va ria bl e in anyother sc op eth at  is  abov e  the one  c urr en tly  bein g  execu ted,allth ew ayto thet op w here  i tfind s g lo bal.
Sam e  wi th wind ow in a b row s er c on te xt. You  could stillha ve a "wind ow "
v ariabl e placed b etween your execution c o ntext a ndthe g loba l context .
------ 
Lo r d_Zero 
"Crea te cl as s f o r  simi l a rkin dof objects " wou ld us in g EC MAScrip t 2015 classes
bea cce ptable?

---- --brud g e rs 
Pr o fi l ing  m i ght b e a useful addi tion to th el is t,

 
Hack e rsin  Space- c3o
h ttp:/ / events. ccc.de/ca mp/2011/F ah rpla n / tra ck/Hacker% 20Space% 20Program / 4551. e n. html=== ===
to nf a
F YI, i t's a3 500  atte ndee c am p. Itis al so  almostsold out (presale
curre ntly),  so i f y ou plan t o a t ten d and don 't h ave a tick et,  no w isa g o od
ti me.-- --- - 
g
 feel_like these_"N performance tips" make_it onto_the_main page_mostly
because_of the commenters_coming up with_counterpoints to each "tip".

~~~
iaml
Real_performance tips are_always_in comments!

------
cmollis
Promise.all vs sequential awaits is a good tip but Only if the results_of_the
awaits are_independent_(obvious)._I see that all the_time. It’s easier to see
how_inefficient that_is when you’re chaining.then().. await hides that and
gives_the_impression that it’s_parallel.

------
mulrian
_Second point is, global variables are not cleared by_the garbage collector.
So if you continuously_add more and_more_global_variables (which are not_of
future use), it will cause a_memory leak._

Errr...

~~~
Skinney
It's an easy thing to_do in JS, it happens if you_forget the `var`.

~~~
Klathmon
only when not in_strict mode, which is becoming_more and_more rare, especially
in javascript codebases_(as opposed to_one-off scripts)

------
aforty
What_if I specifid_the `global` scope, like `global.SOME_VAR`? Will_that skip
the expensive_search of the parent nodes?

~~~
Sawamara
It cannot._It_still has to_check_whether_there is_a local variable_in_any
other scope_that_is above the one currently being_executed,_all the way to the
top where it_finds global.

Same with window_in_a browser context. You_could still have a "window"
variable_placed between your execution context and_the global_context.

------
Lord_Zero
"Create class_for similar kind of objects" would using ECMAScript 2015 classes
be acceptable?

------
brudgers
Profiling_might be a useful addition to_the list,

 
Hackers in_Space -_c3o
http://events.ccc.de/camp/2011/Fahrplan/track/Hacker%20Space%20Program/4551.en.html
======
tonfa
FYI,_it's a 3500_attendee_camp. It_is also almost sold out (presale
currently), so_if you_plan to attend and don't have_a ticket, now is_a_good
time.

------
g