[SOLVED] need help to further *optimize* my small C program that produces absolute path
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
There's a lot of code there, I sincerely doubt that replacing the abspath functions will make a noticeable difference, but it's hard to say without some typical input files to test things with.
That's probably the reason why I really can't have much for a choice.
I have test scripts but I didn't include it in the package. It's not really necessary to include them I guess.
Quote:
If you are serious about optimizing I would go back to my earlier suggestion: rewrite the program to handle multiple paths per run, perhaps using a fifo or socket.
Probably but I'm not sure if that's really applicable since no part of the code requires more than 1 path at a time.
Quote:
I'm wondering why you have a hashing function in your compiler, aren't all awk arrays hash tables already?
Do you mean makehash()? I just use it to create hashes like the ones created by md5sum and the likes. I use it to create functions that will represent call files.
By the way I finally finished the Simpler version as well. Loader-Simpler includes the extended functions loadx(), includex() and callx(). They acknowledge patterns and expressions.
The last will be the full and non-stripped version but it's the most difficult and surely it will not be soon.. though.
If you are serious about optimizing I would go back to my earlier suggestion: rewrite the program to handle multiple paths per run, perhaps using a fifo or socket.
I think I know now what you mean but I think it would be better if I put that on a different package since it appears to be more like a hack and I'm not sure if it will be stable as a generic implementation for shells.
There's a lot of code there, I sincerely doubt that replacing the abspath functions will make a noticeable difference, but it's hard to say without some typical input files to test things with.
That's probably the reason why I really can't have much for a choice.
Um, I can't parse this sentence.
Quote:
I have test scripts but I didn't include it in the package. It's not really necessary to include them I guess.
But you have some example that runs slow (which is why you asked for optimization help), right? It would be interesting to see that.
Last edited by ntubski; 08-31-2009 at 05:41 PM.
Reason: grammar
But you have some example that runs slow (which is why you asked for optimization help), right? It would be interesting to see that.
About the scripts? Not really. I'm pretty happy with what they are right now and they appear to be already stable and consistent. After many revisions, I finally found their final form (probably the most optimized and most balanced form). And nothing has changed much since the first release (only descriptions and documents except for the generic loader where I didn't test its failure function).
But of course and nevertheless, I can never be sure of that and suggestions like yours (esp. from someone that helped me a lot already) will always be welcomed.
Just made the cleaner version of the test scripts and uploaded them. Same site at sourceforge in the extra folder. Good luck and enjoy .
But you have some example that runs slow (which is why you asked for optimization help), right? It would be interesting to see that.
I just made a new upload of my other project. The project uses ShellScript Loader and I just thought that you might also want to see how it proves the concept.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.