Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #24892

Re: Bind custom function to the all Function objects

From Thomas 'PointedEars' Lahn <PointedEars@web.de>
Newsgroups comp.lang.javascript
Subject Re: Bind custom function to the all Function objects
Date 2014-06-16 23:26 +0200
Organization PointedEars Software (PES)
Message-ID <2333271.cc9OM5qQbL@PointedEars.de> (permalink)
References (2 earlier) <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>

Show all headers | View raw


Cezary Tomczyk wrote:

> 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.
 
>> <https://getfirebug.com/javascript>
> 
> 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: <http://PointedEars.de/faq> | SVN: <http://PointedEars.de/wsvn/>
Twitter: @PointedEars2 | ES Matrix: <http://PointedEars.de/es-matrix>
Please do not Cc: me. / Bitte keine Kopien per E-Mail.

Back to comp.lang.javascript | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Bind custom function to the all Function objects Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2014-06-13 16:32 +0200
  Re: Bind custom function to the all Function objects Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-06-13 16:56 +0200
    Re: Bind custom function to the all Function objects Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2014-06-13 17:21 +0200
      Re: Bind custom function to the all Function objects "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2014-06-13 08:39 -0700
      Re: Bind custom function to the all Function objects Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-06-13 19:01 +0200
        Re: Bind custom function to the all Function objects Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2014-06-13 22:41 +0200
          Re: Bind custom function to the all Function objects Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-06-14 01:57 +0200
            Re: Bind custom function to the all Function objects Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-06-14 15:55 +0200
            Re: Bind custom function to the all Function objects Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2014-06-16 21:55 +0200
              Re: Bind custom function to the all Function objects Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-06-16 23:26 +0200
  Re: Bind custom function to the all Function objects Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-06-18 21:04 +0200

csiph-web