This App is No Longer Maintained. Visit the Replacement at StrokesPlus.net

StrokesPlus Forum
                       
StrokesPlus Forum
Home | Profile | Active Topics
Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General Discussion
 General Discussion
 Performance efficiency
 Forum Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

tia34531

18 Posts

Posted - 12/30/2013 :  09:31:04  Show Profile
Hi..

I have a question about performance.

Which one do you think is more desirable from viewpoint of performance rapidity or system usage? Of course, I mean 'technical performance' because I couldn't notice any difference between the two below.

1. Just adding one global action "Size()"in the 'Configure Actions' tab by adding below code in the 'Global lua'
=================================================================================
function Size()
local iExe=acGetExecutableName(..........)
if iExe=="iexplore.exe" then
.........
elseif iExe=="uTorrent.exe" then
...........
elseif iExe=="Notepad2.exe" then
..............
elseif iExe=="mspaint.exe" then
..................(goes on like this)
end
==============================================================
2. As you know, adding each 'app' and each actions in each 'app' in the 'Configure Actions' tab.

Edited by - tia34531 on 12/30/2013 09:33:27

Rob

USA
2615 Posts

Posted - 12/30/2013 :  10:06:53  Show Profile  Visit Rob's Homepage
Adding each app would likely be the slightly better performer for the following reasons:

a. Even if you only have Global Actions (no other apps), S+ will still do its normal processing, which populates internal variables of the window below the gesture start coordinates. S+ stores the (self, parent, and owner) window class names & titles, EXE name, EXE path, and control ID. Then it begins comparing, looping through each defined app; of course, if you have no defined apps, it would have any to process. However, the point is that S+ has already retrieved these values either way, so having the Global function call acGetExecutableName is repeating the same code twice. Just so you know, getting the EXE name is (relatively) resource intensive as you have to open the process, get the name, release the handle, etc., so ideally you wouldn't want that call happening twice.

b. Looping through each defined app or testing each EXE name string in Lua is going to happen either way, except the compiled native code will always run faster than a script parser. Additionally, calling acGetExecutableName has a little extra overhead in that it goes through more CPU cycles having to pass the variable through to Lua.

This is more of a personal view, but I prefer to keep apps and actions more logically separated in the interface.

Either way, the fact that S+ is going to get the EXE name no matter what means it will be more efficient.
Go to Top of Page

tia34531

18 Posts

Posted - 12/30/2013 :  11:49:11  Show Profile
Thanks..
Your reply gives me in-depth information.
Go to Top of Page
  Previous Topic Topic Next Topic  
 Forum Locked
 Printer Friendly
Jump To:
StrokesPlus Forum © 2011-2018 Rob Yapchanyk Go To Top Of Page
Snitz Forums 2000