I've uploaded an improved version of my scr_ThumbMin script.

-- snip from script --
It overcomes all shortcomings of ThumbMin plugin, e.g.
- windows are not hidden from taskbar
- smart size can be set
- customizable left, middle, right click actions
- icon/window-title overlay, tooltips, customizable fonts, etc.
- many helper scripts to use the script everywhere
- off-screen windows are handled correctly
- thumbnails can be aligned to a desktop grid
- original virtual desktop is restored
- works well with (most) Delphi programs and alike, those which
   appear on Alt-Tab list even when they're on a separate vdesk
- works perfectly with partially off-screen windows
- AND it's as fast as ThumbMin plugin, usually even faster!
-- snip from script --

Now you may ask, how a script can outperform a plugin. Here is how.

I was pretty disappointed with the performance of my script compared to 
the plugin and my similar linux setup. So I wrote a small plugin called 
benchmark, which I am currently developing (more to it below). With the 
help of it, I've gained much insight of how PP-structures work. E.g. a 
disappointment was how the "jump" statements slowed down my script. With 
this version, on a DualCore 2GHz machine, minimization usually takes 
about 40-100ms, which is most of the time faster than the plugin (in its 
current version). The bulk of this time is capturing the window and 
writing the generated skin to disk; the rest is negligible.



benchmark currently have these services:
str benchmark.getcounter()      ; get performance counter (PP clone)
str benchmark.getfreq()         ; get performance frequency (PP clone)
str benchmark.startlap(raw)     ; start new lap and get elapsed ms/cntr
str benchmark.stop(raw)         ; stop counting and get elapsed ms/cntr
str benchmark.getcurrent()      ; get elapsed seconds since bootup
str benchmark.getcurrentms()    ; get elapsed milliseconds since bootup
str benchmark.getcurrentus()    ; get elapsed microseconds since bootup
str benchmark.getcurrentns()    ; get elapsed nanoseconds since bootup
void benchmark.unload()         ; unloads the plugin
and these are in development:
int benchmark.getcpu()          ; using PDH, and not GetSystemTimes
int benchmark.getanyperf(str)   ; get any performance counter on system

I know first 2 are in PP's arsenal, I've included them just for the sake 
of completeness. The other functions save you simply lots of string 
conversions back and forth to int64. The overhead of the plugin is very 
low, e.g. calling getcurrentms twice before and after a wait.for(1000) 
gives me ~1010 msec (1%) difference (with default.pcf on idle desktop).



Typical usages could be:

@someScriptlet
   benchmark.startlap   ;; similar to the "lap" buttons on stopwatches

   ;; do some stuff block A
   win.debug("elapsed since start:", benchmark.startlap)

   ;; do more stuff block B
   win.debug("elapsed on block B:", benchmark.startlap)

   ;; yet more stuff block C
   win.debug("elapsed on block C:", benchmark.stop)
   quit

@someOther
   local _start = benchmark.getcurrentms
   ;; do even more stuff
   win.debug("total time:", benchmark.getcurrentms - _start)
   quit



Before I release the plugin I ask you if there are more services you'd 
like to see in the plugin; because once I'm finished with it, it's 
highly unlikely that I develop it further. I'll uploaded it to 
_Temp-Section shortly.

Feedback and testers are welcome.

Reply via email to