Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C
Hey guys,
now i need some help. No, i dont have a code that doesn't run correctly or doesn't run at all. Now i want to amke you a serious question: <<How can I make my C programm run faster and use less memory?>>
 
If you know anything about it, then plz tell me ASAP.
Thanks for your time.
Posted 30-Nov-11 3:28am
Comments
Eugen Podsypalnikov at 30-Nov-11 9:53am
   
// How can I make my C programm run faster and use less memory?
Is there a function in your C programm
that does make you not sure ? :)
Albert Holguin at 30-Nov-11 9:58am
   
There's really not a good general answer to this.. it depends on what your code is doing... otherwise the answer would be a 50 page essay... and quite frankly, most of us don't have that kind of time on our hands. Ask google?
johny10151981 at 9-Jan-12 18:27pm
   
Well, My suggestion would be really rude.
1. Stop bothering people with your pointless question
2. Start doing some real work
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

  Permalink  
v2
Comments
Albert Holguin at 30-Nov-11 13:39pm
   
That second article looks like it covers quite a few different topics in optimization... +5
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

As others already pointed out, you should optimize your code both for speed and memory consumption (and it is a startling task, there is usually a trade-off between these two requirements).
Hand craft optimization is an art and your current attitude (posting an ASAP request at Quick Answer) strongly clashes with.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 5

What you are asking for is something that is a combination of these qualities:
 
1. good judgement (generally comes with experience)
2. good knowledge of the target language you are using (usually comes with experience)
3. good education in the basics (requires the use of good books, and frequently good teachers.. can also be gotten through experience).
 
Bottom line, this is something you can learn, but getting good at it requires time and commitment and correct action (learning from your mistakes).. its not something reducible to a simple 2 paragraph answer on a website, or something you'll learn in a week.
 
Getting really good at programming, much like getting good at anything, is very time-intensive. Fast food it ain't.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Wow, I didn't think I'd have to break out the ol' crystal ball this early in the morning. Here's an answer that matches the lack of information in your question, yet strangely applies to pretty much any program written in any language - write better code.
  Permalink  
Comments
XristosMr at 30-Nov-11 8:33am
   
=.=
CPallini at 30-Nov-11 8:48am
   
My 5. Even if 'better code' is not exactly a synonymous of 'faster and smaller'.
johny10151981 at 30-Nov-11 8:49am
   
me like it ;)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 565
1 Kornfeld Eliyahu Peter 409
2 Maciej Los 369
3 DamithSL 196
4 OriginalGriff 188
0 OriginalGriff 6,353
1 DamithSL 4,854
2 Maciej Los 4,466
3 Kornfeld Eliyahu Peter 4,058
4 Sergey Alexandrovich Kryukov 3,897


Advertise | Privacy | Mobile
Web03 | 2.8.141220.1 | Last Updated 9 Jan 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100