top | item 8980433

(no title)

lebinh | 11 years ago

Measure and profile the code will always be the best thing to do but for simple 20% effort tips I think it would be:

* Don't write your own data structure, stick to the standard library or, in some rare cases, popular and well-known 3-rd party lib.

* Always prefer a Hash or a Set over anything else.

* Beware of any nested loops.

* Have some local / external caches and try memoization.

* Try parallelizing or better, non-blocking wait for all I/O operations.

discuss

order

No comments yet.