Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!news.solani.org!.POSTED!not-for-mail From: Thomas 'PointedEars' Lahn Newsgroups: comp.lang.javascript Subject: Re: Bind custom function to the all Function objects Date: Mon, 16 Jun 2014 23:26:16 +0200 Organization: PointedEars Software (PES) Lines: 63 Message-ID: <2333271.cc9OM5qQbL@PointedEars.de> References: <98e91$539b0b89$6def49ce$21580@nntpswitch.blueworldhosting.com> <1649322.pjBWu2vbqe@PointedEars.de> <94a15$539b16e4$6def49ce$21821@nntpswitch.blueworldhosting.com> <2459085.3y454gxjXg@PointedEars.de> <1e6b6$539b6200$6def49ce$25031@nntpswitch.blueworldhosting.com> <1464959.oZ30Yp1K6V@PointedEars.de> <7aed7$539f4bb6$6def49ce$31576@nntpswitch.blueworldhosting.com> Reply-To: Thomas 'PointedEars' Lahn Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8Bit X-Trace: solani.org 1402953978 12182 eJwFwYEBwCAIBLGZEA7tOKD8/iM0wdPy7kgyEHqtjdc7t8RanLmD2g7mhGwWFl90qUZ4/zBIEcA= (16 Jun 2014 21:26:18 GMT) X-Complaints-To: abuse@news.solani.org NNTP-Posting-Date: Mon, 16 Jun 2014 21:26:18 +0000 (UTC) User-Agent: KNode/4.12.4 X-User-ID: eJwFwYEBwCAIA7CXRCjoOaPY/09YAk9LViQyIOgr1Lxpbkbl0Hw5HkJ+moPZ0PKgnna/ynu7UzKSxybYP3YXFuU= Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEXTxa4RFk5dUWANED8PFEfy7+MGBiW+n3ZNF/QuAAACaElEQVQ4jVXUwVOcMBQG8Dc7Rc4PUntdWV2uxjDpGaGeozOp1woar4jd5t/v9wLstMwsA/ntlxdCAgUc1hjTc9/JCZfGoo3wG3HdmdAWrIJRHe7GM/TmpY5VFefuVcAkkPbLIaN8rmPmjloyZxgyR3GuJ4K0AGtJ2htz8o7yqikm759fldQXaMpbDzjKAG+8v+AugVTOPO5DOjLvGtUYQwh0CPjnVMyGd+8/GfUB5nLKJDD2aLDh5HYyMDJGDwQIo2ZmZcKbowNmAdB/AzyFhrmF2MHRb0QJJfaAnwGB6orZhoykLzJtGwF/xpYxI1dswomiUj3gTuAIqCn/4C7cULwGNBtwMTk3Y4LfKB5YUaOKBKYtpplm7u0vip8tU1NWWyI/7XdcSuIDoMt6rVHMWT0DbjHPGqDqZVSa6zleLcUTcIKLoMv3ueJluALtAo9B302zPPlrtiVScRdCjXvVh3e3JpYa/jjkuC9N+LrBMlz/eAN4eQijX2EdLo6c5tGGHwLyHFtXk89dDGHwCVhG9T0S/j55AhRZgkMCmUQXJ49TnS1wnQDvw0eAh9ICeMmEFbCnPMFzjAvsWoEWEFdYEx+S0MoUZ1gT1wId8+AF3Bl2OoEu906AUHx5VLw/gXYg/x84loOah/2UYNrgiwSwGO7RfUzVBbx/kgpckumGOi6QirtD6gkLTitbnxNol47S2jVc2vsN5kPqaAHT8uUdAJM4v/DanjYOwmUjWznGfwB7sGtAtor5BgofDuzaRj4kSQAqDakTsKORa3Q3xKi3gE1fhl71KRMqrdZ2AWNNg/YOhQyrVBnb+i+nEg4bsDA+egAAAABJRU5ErkJggg== X-Face: %i>XG-yXR'\"2P/C_aO%~;2o~?g0pPKmbOw^=NT`tprDEf++D.m7"}HW6.#=U:?2GGctkL,f89@H46O$ASoW&?s}.k+&. 2014-06-14 01:57, Thomas 'PointedEars' Lahn wrote: >> Cezary Tomczyk wrote: >>> Let me rephrase it. When I run the web application in the browser >>> environment then I'd like to check how many times every >>> functions/methods are called. The simplest way is to add console.count >>> (https://developer.mozilla.org/en-US/docs/Web/API/console.count) to >>> every function/method. >> Thanks, I did not know of that method. > > You welcome. ^are > [...] >> It is possible to wrap all *your* functions (that you *know*) simply by >> replacing them (I do something similar in jsx.dom.addEventListener() in >> order to emulate EventTarget::addEventListener() when unavailable): > [...] > > I was thinking about same approach. However, I preferred something more > simpler so that it could be "applied once and works everywhere" without > even updating it in the future whenever main code will change. Within limits, using object introspection, this approach can be adapted so that it can be “applied once and works everywhere”. See also my addendum. >> > > That I know. It would be good if you published your findings in advance. > 1. What, if you want to measure it in the product across thousands of > testers around the world. Let's say the product is in testing phase. > Possible solution would be send the results periodically to the server > and having the web site where data from the server would be presented. I do not see why it would be necessary to compare the number of calls around the world. However, I cannot advise on hypothetical scenarios if I do not know all relevant facts. > 2. "Profile" measure performance in some very specific range: from start > click to end click. I'd like to measure it all the time during working > with application and see the results in real time. There are console.profile() and console.profileEnd() (described on the Firebug website). As for “real time”, you will probably have to find another way. I would have expected console.profileEnd() to return the results as an object. >> I could not find a similar feature in Iceweasel 30’s built-in Web >> Developer Tools or in Chrome Developer Tools in Chromium 34. > > Google Chrome contains "Profiles". Yes, but how can I get the *call count* that way? -- PointedEars FAQ: | SVN: Twitter: @PointedEars2 | ES Matrix: Please do not Cc: me. / Bitte keine Kopien per E-Mail.