Page 1 of 1 1
Topic Options
#211062 - 2016-02-02 02:35 PM ComputerinGroup Functions
Robdutoit Offline
Hey THIS is FUN
***

Registered: 2012-03-27
Posts: 363
Loc: London, England
I was busy trying to optimise the speed of my scripts and I noticed that one area where my script seems to pause is with computeringroup function.

Looking at the function - I was using this one - http://www.kixtart.org/UDF/UDF_lister.php?what=post&code=84539

it would seem that its more suited for XP/2003 environments.

I tried this function

http://www.kixtart.org/UDF/UDF_lister.php?what=post&code=195717

and it seems to be much faster - virtually no delay!

I don't know if it would be advisable to either delete the slower version or if is required for xp/2003 machines then perhaps the older one should be listed as intended for XP/2003 upwards clients and servers and the newer one could be listed as intended for Vista/2008 clients and servers

What do you guys think?

Top
#211063 - 2016-02-02 03:42 PM Re: ComputerinGroup Functions [Re: Robdutoit]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4567
Loc: USA
To answer your question, I'm not sure. BUT... the version that is LDAP based should work as long as you have your Active Directory. Also, that was written in 2009, so XP was still in support at the time. I would bet it works fine.
Top
#211064 - 2016-02-02 03:44 PM Re: ComputerinGroup Functions [Re: Allen]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4567
Loc: USA
And... I seem to remember when I was working on that function, someone else saying they simply replaced the old function with it. Your results may vary.
Top
#211066 - 2016-02-02 07:17 PM Re: ComputerinGroup Functions [Re: Allen]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4402
Loc: New Jersey
There's also a ComputerInGroup UDF on my site that's similar to Allen's except that you can supply a list or array of group names and it returns true if the computer is a member of any of the listed groups.

Different function in reality, Allen's tests for membership in a specific group, which might be needed for group membership manipulation. Mine was optimized for login script processing, allowing a function to be performed (such as printer mapping) when the computer is a member of any or all of a list of groups - this reduces the number of UDF calls when testing multiple group memberships.

I have a similar fInGroup() UDF for user group matching.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#211067 - 2016-02-02 07:55 PM Re: ComputerinGroup Functions [Re: Glenn Barnas]
Robdutoit Offline
Hey THIS is FUN
***

Registered: 2012-03-27
Posts: 363
Loc: London, England
That will be my next task with the script. To optimise UDF Calls to group memberships as I have them in several places in the script. I will try and consolidate them.

I am not too fussed about the matter as both work and one may well be faster on another network - mileage may vary. But I am going to update my scripts for all my clients to use the LDAP version as everything is in active directory anyway!

I just found out today that Britain does indeed have a turn off switch for the Internet. We had a countrywide outage lasting over two hours today from London and below all the way up to Scotland for any customer using BT - must have been a catastrophic failure given how many redundancies are built in. \:\)

Top
#211068 - 2016-02-02 10:56 PM Re: ComputerinGroup Functions [Re: Robdutoit]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4402
Loc: New Jersey
Must be a helluva toggle switch! \:D

The InGroup functions on my site were performance-optimized for use in our login script. The most complex configuration I've ever deployed for a client mapped about 14 drive and 6 printer resources out of a pool of almost 475 shares and almost as many printers. Most were done through four different lookup tables with 440 entries each. On the LAN, the script ran in about 6 seconds, and on the WAN, it took about 11 seconds on the older 256K DDS (frame relay) service. Their original script took 90+ seconds to complete in the remote offices, and 30+ seconds on the LAN!

Our group matching logic in our latest release shaves about 2-5 seconds off of those times by eliminating all of the individual InGroup lookups. \:\) In our network, the login script finishes in about 3 seconds when there are no messages*, so we added a delay to display it for at least 6 seconds. (*Messages impart a minimum 2-second per message delay to allow time to read them.)

Point is - careful selection of UDFs and optimizing your logic can provide a significant increase in performance.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#211069 - 2016-02-02 11:05 PM Re: ComputerinGroup Functions [Re: Glenn Barnas]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4567
Loc: USA
The ComputerInGroup I worked on above, could also be optimized to cache the information. I actually did this with the PrinterConnection udf in the 2.x version (NOT posted in the UDFs) and while I never measured the performance difference, I can tell you it was faster. The reason I never did the caching with this function is because I almost never use it. Mostly written because someone asked for it here in the forums. Anyway, probably something that could be added very easily if you need it.
Top
#211070 - 2016-02-03 08:24 AM Re: ComputerinGroup Functions [Re: Allen]
Robdutoit Offline
Hey THIS is FUN
***

Registered: 2012-03-27
Posts: 363
Loc: London, England
The funniest thing about it, was all the people on Twitter complaining they couldn't get onto the Internet - I don't know whether they saw the irony lol.

Wow Glenn, your network must be massive. My script does not need that kind of optimisation. It now takes about 3 seconds to run the script and the only area where it pauses for a second is with my pinned icons udf as the computer is taking time to delete pinned icons and add whatever. I need to rewrite that so that it checks if pinned icon exists and doesn't rewrite it. But thats a minor niggle.

My biggest problem which I fixed months ago was two things. Deleting temp files on logon was really slow because the computer was busy booting up so using the hard drive. Moving this to the logoff script fixed that. The BGI Wallpaper also slowed the script down especially on netbooks until I coped the bgi wallpaper to a local directory on each computer/netbook and now its a lot faster as I am not copying that wallpaper over the network every login.

Allen, I think the LDAP and other script already caches the information as it definitely is faster when I run it for a second time/third time/fourth time. It only loses the cache like after a minute or two which for a logon script is not an issue.

Top
#211072 - 2016-02-03 12:58 PM Re: ComputerinGroup Functions [Re: Robdutoit]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4402
Loc: New Jersey
No, my network isn't.. 3 desktops, 3 laptops, and 2 older tablets in special service. We do have 28 servers (not including VMware), but that's mostly to have the resources to develop and certify enterprise capable code. We have a full RDS Farm (3 farm groups, 5 servers total), a web farm infrastructure (1 farm manager, 1 Code Management, and 4 Code Delivery servers), a CA infrastructure, an email content filter gateway fronting Exchange 2013 CAS and MBX servers, in addition to file/print, backup, media delivery and other infrastructure platforms. 3 servers are dedicated to pure development - a W2003 host, a Linux based load balancer, and a Linux based virtual iSCSI SAN, which is used when we test virtualized Windows clusters. The 2K3 server will soon be replaced with a 2K8 server - this is used for older platform certification.

I have deployed some of our software, such as our login script, log management service, WUS management service, and software deployment system to some fairly large organizations, including Liberty Travel (Flight Centre USA), CIT Group, the Federal Reserve, and Christian Dior. Liberty Travel, described in my earlier post, was probably the most complex as they had 435 departments across many retail locations around the US and two central office sites. They had 435 BAT files coupled with 435 Kix scripts for basic login, plus a handful of other BAT and EXE utilities. This was reduced to a single script with a single configuration file and is still in use (code unchanged) since 2007.

Having an infrastructure that mirrors (on a smaller scale) the type found in larger organizations allows us to test code in situations that a smaller environment could not provide.

Glenn


_________________________
Actually I am a Rocket Scientist! \:D

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 476 anonymous users online.
Newest Members
batdk82, StuTheCoder, M_Moore, BeeEm, min_seow
17885 Registered Users

Generated in 0.061 seconds in which 0.024 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org