Sign in to follow this  
Followers 0
Jettison

Memory and size

3 posts in this topic

#1 ·  Posted (edited)

General question. If this has been asked 5 million times before, apologies. The only search results I found were those regarding FileReadLine() etc. My problem: I have a script that's similar to another app that was written in C. The C app has the same features, and takes about 4k memory. My script takes about 5k memory. I know what you're thinking...I must be crazy...but I've seen worse. What my question is, is there any 'good practice' or something out there to free up unused memory? Does any unused memory even exist? :whistle:

Any help would be appreciated. I know I'm a nitpicker, but I really want my script to be lean and take as few resources as possible. If it doesn't, I see no reason why I shouldn't write it in C/C++ instead.

Also...regarding size. The same C app weighs 90 kb or so. My script weighs a whopping 230 kb. I've done python, and I know this is due to packaging the interpreter, etc...but is there no way to reduce the size? The C app launches a lot quicker, too.

Edited by Jettison

[font="Impact"]Cats rule, humans drool.[/font]

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

A script will generally always run slower, take up more memory and have a larger .exe footprint than a programed equivalent. AutoIt itself was written in hundreds upon hundreds of lines of C code. There's very little you can do about execution speed. Leaving the script un-packed (not using UPX) may SLIGHTLY increase the initial running speed, but that leave you with a larger .exe footprint (this is a common trade off in any program). Likewise, you can use a different .exe packer or a higher compression level in UPX to possibly yeild a SLIGHTLY smaller .exe size. As for its memory size you can make liberal calls to a function called _ReduceMemory (Search the forums for it) which will manually do GC on your porgram. Keep it mind while this may reduce memory footprint, it will probly only make your program go slower in most situations especially on newer version of windows (xp-vista) since they handle memory pretty well without you but-ing in.

Edited by evilertoaster

Share this post


Link to post
Share on other sites

Ah ok. Thanks.


[font="Impact"]Cats rule, humans drool.[/font]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0