Thursday, 15 September 2011

javascript - What is the specific impact of assigning __proto__ in each browser? -



javascript - What is the specific impact of assigning __proto__ in each browser? -

this specific utilize case. , in typescript (which utilize case think has no impact mention in case does).

we have our main code , single web worker background processing. utilize worker.postmessage() post messages , forth. phone call postmessage(mydata) mydata object. object has fellow member variables objects have fellow member variables objects... it's lot of objects beingness passed across.

when phone call postmessage() receive on other side submitted object, data. methods (ie prototype) not passed across. web worker communication serializes info , rebuilds it, data, on far side. looking @ proto delivered object, object far can tell, basic object.

so, appears sensible approach walk objects setting proto on them (discussed here). avoids re-creating every object 1 time again in re-create constructor (which takes time, doubles memory hit, , increases work garbage collector). , seems reasonable thing because we're reapplying prototypes had on sent side. (and in es6 browsers we'll utilize setprototypeof().)

my question is, specific nail next browsers. impact have these specific ones (all care recent versions because must have web workers):

internet explorer 10 & 11? chrome 34 & 35? safari 7?

and in case of firefox - it doesn't it.

is nail ie, chrome, & safari? , if so, what/how?

and reply - bad in chrome & opera, bad in firefox, horribly bad in ie. did performance testing of re-create constructors vs setting prototype.

details here:

javascript internet-explorer google-chrome safari prototype

No comments:

Post a Comment