The Un-Official Proxomitron Forum
Load time - Printable Version

+- The Un-Official Proxomitron Forum (https://www.prxbx.com/forums)
+-- Forum: Proxomitron Filters (/forumdisplay.php?fid=38)
+--- Forum: Filter Help/Request (/forumdisplay.php?fid=31)
+--- Thread: Load time (/showthread.php?tid=1122)

Pages: 1 2


Load time - lnminente - Oct. 11, 2008 07:57 PM

Hi all!

I'm testing with some ideas for new filters, and i would like to use the fastest of them. So:
¿What is the best way to measure the time wich uses proxomitron to filter a page?
¿Does the page must be local?

Thanks in advance.


RE: Load time - z12 - Oct. 12, 2008 01:50 PM

Perhaps injecting a comment with $DTM() at <start> and <end> will do what you want.

z12


RE: Load time - lnminente - Oct. 12, 2008 05:18 PM

Sure, this will work. But still would depend of server, and i would need to take the calc :/ hehe

I was asking myself if someone worked on this before, i think the best is to save a big webpage bypassed, maybe copied ten or more times in the same local file.

I saw JD5000 made some filters for load time in his config 050902. I will test them or try to find an addon for firefox, and will comments the results here.


RE: Load time - ProxRocks - Oct. 12, 2008 05:38 PM

sidki's config has a page load timer also, i believe it is "more" than a <start> and <end> thing, else the timer wouldn't be timing image loads on connections 9 and 10 out of 10 when the <end> was hit on connection 3, or so it seems...


RE: Load time - Guest - Oct. 13, 2008 02:38 AM

Can't you just use the "test" option in the filter editor box? Paste the html text in the top box, click "test", then click "profile."


RE: Load time - z12 - Oct. 13, 2008 01:03 PM

lnminente Wrote:i think the best is to save a big webpage bypassed

I was thinking the same.

Then you could use proxo's url command:
Code:
http://file//path

Used to filter a local file as if it were a web page. Similar to the file:// URL used by most browsers.

If the browser has cached the pages external resources, server lag would be minimal.

Here's some js filters that will calc the time for you: Smile!
Code:
[Patterns]
Name = "Inject Start Time js"
Active = TRUE
Limit = 256
Match = "<start>"
Replace = "<script type="text/javascript">\r\n"
          "  proxoT0 = new Date();\r\n"
          "</script>\r\n"

Code:
[Patterns]
Name = "Inject End Time js"
Active = TRUE
Limit = 256
Match = "<end>"
Replace = "\r\n"
          "<script type="text/javascript">\r\n"
          "  // calc delta time\r\n"
          "  var proxoDT = new Date()-proxoT0;\r\n"
          "  var proxoLT = 'Load Time = ' + proxoDT + ' ms';\r\n"
          "  document.write('<div><span>'+proxoLT+'<\/span><\/div>');\r\n"
          "</script>\r\n"

HTH
z12


RE: Load time - lnminente - Oct. 13, 2008 03:38 PM

To proxrocks:
Sidki, had a load timer too, but you know, i got stuck seeing too many vars in his filters, and i don't know his dependances with another filters. Anyway it's probably an evolution from JD's. I think using JD without loading images maybe would be almost the same.

To the unknown:
hehe Really thanks, i must admit i didn't thinked in that Whistling I was always thinking the test window was for small amounts of text. It will be sufficient for testing some filters, but i'm still looking for something better, wich could measure how interacts all the filters working at the same time.

To z12:
To filter a local file there is a old very good registry tip. This is for firefox when Proxomitron.exe is in c:\proxN45j\

Code:
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\FirefoxHTML\shell\proxomitron]

[HKEY_CLASSES_ROOT\FirefoxHTML\shell\proxomitron\command]
@="\"c:\\ProxN45j\\Proxomitron.exe\" %1"

You save this as anyname.reg, double click, and accept the modification.
Later, each time you right click over an html file in explorer, you will see a new option to filter with proxo Wink

Heyy Z12!! These filters are really good!! That's exactly what i was looking for!!
Maaany thanks!! :DDDDDDDDDDD


RE: Load time - lnminente - Oct. 13, 2008 05:26 PM

Ups, one problem, the first filter breaks pages because of the insertion of the script at the beginning.

You can see it here http://www.softonic.com/

I moved it to the start filters or just after <head*> to get similar results i think and it works.

In other part, would be better if we could set a variable with $DTM() at <start>, without inserting anything in the page, doing it compatible with the format wich javascript uses. And later we could use $GET(LoadTimer) in the second filter.

Code:
[Patterns]
Name = "WIP Set Start Time js {z12}081013"
Active = FALSE
URL = "$TYPE(htm)"
Limit = 50
Match = "<start>"
Replace = "$SET(LoadTimer=$DTM(EDIT THIS TO DO IT COMPATIBLE WITH JS))"
          "$STOP()"

Maybe it's more dificult than i think, i don't know much about javascript, i will search in internet and see what i can do :/
http://www.w3schools.com/jsref/jsref_obj_date.asp


RE: Load time - z12 - Oct. 13, 2008 07:43 PM

lnminente Wrote:Ups, one problem, the first filter breaks pages because of the insertion of the script at the beginning.

You can see it here http://www.softonic.com/

It doesn't seem to be breaking pages for me.
But, that could be due to several different factors.
I normally don't inject anything at <start>.
IE sometimes has a problem with that.
Probably better to inject the <start> script where you normally inject your scripts.

Needless to say, those filters were quick and dirty.
To start with, I didn't include a $TYPE(htm) or style the injected code.
They were more of a demo of js code to get the load time.

You could pass proxo variables to a script as you suggested.
But you would still need an injected script to process that info.
Given that, it's probably easier just to let js do it all.

Anyway, I viewed these as test filters, not something you would run all the time.
But if you can fix them up, maybe other people would find them useful. Smile!

z12


RE: Load time - lnminente - Oct. 13, 2008 09:34 PM

Sorry, maybe i expressed myself very bad. When i said i was getting similar results moving the first filters to the place where i put start filters, i was trying to say similar times, but the pages were not broken.

You're right, they are test filters, if i find a fast way for doing what i said, good, if not, good also Wink


RE: Load time - lnminente - Oct. 14, 2008 12:48 PM

I got it! "My" first javascript Big Teeth
Code:
[Patterns]
Name = "<util> CPU load timer: start {z12,ln}081014"
Active = TRUE
URL = "$TYPE(htm)"
Limit = 1
Match = "<start>"
Replace = "$SET(LoadTimer0=$DTM(Y,M,D,H,m,s,t))"
          "$STOP()"

Name = "<util> CPU load timer: end {z12,ln}081014"
Active = TRUE
URL = "$TYPE(htm)"
Limit = 1
Match = "<end>"
Replace = "$SET(LoadTimer1=$DTM(Y,M,D,H,m,s,t))"
          "\r\n"
          "<script type="text/javascript">\r\n"
          "  // calc delta time\r\n"
          "  var proxoDT = Date.UTC($GET(LoadTimer1))-Date.UTC($GET(LoadTimer0));\r\n"
          "  var proxoLT = 'Load Time = ' + proxoDT + ' ms';\r\n"
          "  document.write('<div><span>'+proxoLT+'<\/span><\/div>');\r\n"
          "</script>\r\n"



RE: Load time - ProxRocks - Oct. 14, 2008 04:23 PM

it "works", but define "works"...

if you go here: http://www.ehowa.com/
and hit the "page down" button 'while' the page is loading, you'll see Load Time = (w|)xyz ms BEFORE ANY of the images are "loaded"...

sidki's "timer" keeps on ticking WHILE those images are "loading"...
after nearly THIRTY SECONDS, that page will "finally" be loaded...


RE: Load time - lnminente - Oct. 14, 2008 06:38 PM

I went to http://www.ehowa.com/ and i didn't see anything in firefox, neither in IE6. Anyway i saw the load time in same iframes in other webs...

The time you say depends a lot of how many connections you do to a server and your internet speed, but my intention is to measure the cpu time used by proxomitron to proccess the code of a web page, but not the time to donwload and render it completely. It's something similar to the test window but for the complete set of filters.

This is the procedure i use to know the cpu it takes:

- It need to be server independant, so i download the pages to test and store them in hard disk as "only html".
- Clean cache and filter the local page using a cfg file wich only has these two filters.
- Clean cache and filter again the local page but with my usual filters and also the load timers.
- Theoretically the time of the second filtering minus the time of the first filtering is the time the cpu needed.
-The browser was maximized in both cases and don't scrolling or pushing any key to don't use CPU time. No other aplications using much CPU.

Testing with http://www.mocosoft.com/principal.htm saved locally, the time to filter with only time loaders was 0-78 ms, and with all the filters was 188-234ms. So the time used by proxomitrom was 172ms.

Handycaps of this method:
-Fluctuations of numbers, makes me not confide too much in them :/

Maybe i chosen a confusing name for the filters, renamed them to CPU load timer Wink


RE: Load time - ProxRocks - Oct. 14, 2008 06:58 PM

(Oct. 14, 2008 06:38 PM)lnminente Wrote:  but my intention is to measure the cpu time used by proxomitron to proccess the code of a web page, but not the time to donwload and render it completely

ah! now i see, cool!


RE: Load time - lnminente - Oct. 14, 2008 07:05 PM

It took my all the evening to write it, i'm not so good with english Sad
But glad you like it Wink