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


Groups > comp.lang.javascript > #24890

Re: Bind custom function to the all Function objects

Date 2014-06-16 21:55 +0200
From Cezary Tomczyk <cezary.tomczyk@gmail.com>
Newsgroups comp.lang.javascript
Subject Re: Bind custom function to the all Function objects
References (1 earlier) <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>
Message-ID <7aed7$539f4bb6$6def49ce$31576@nntpswitch.blueworldhosting.com> (permalink)
Organization BWH Usenet NNTPSwitch-Cluster

Show all headers | View raw


2014-06-14 01:57, Thomas 'PointedEars' Lahn wrote:
> Cezary Tomczyk wrote:
[...]
>>> Learn to think in terms of versions of implementations, not browsers.
>>
>> Agreed. However before I start think in terms of versions of
>> implementations I need to figure out those implementations
>
> So you should ask “Which implementation X supports feature Y?” and then
> “Which browser Z supports implementation X?”, and not “Which browser Z
> supports feature Y?”

Thanks.

>> Based on your previous answer there is nothing I can find and use in my
>> case (below details).
>
> Do not jump to conclusions.  Your case was not at all clear.

Ok.

>> 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.

[...]
> 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.

> However, as I have (re)discovered today thanks to your posting, it is easier
> to use the Firebug profiler.  Go to the “Console” tab, select “Profile”, and
> select “Profile” again when you are done.  The second column of the profile
> shows the number of times each function/method was called.
>
> <https://getfirebug.com/javascript>

That I know. However, above do not solving 2 problems:

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.

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.

> However, note that you will be only profiling the behavior of your code with
> Mozilla JavaScript.

And that's another problem.

> 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".

-- 
Cezary Tomczyk
http://www.ctomczyk.pl/

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