Say you're at the end of your program. All the work is done and you want to quit. But say that you’ve got some big objects laying around. If all you have to do in your destructors is de-allocate memory, I’ve re-discovered that you can avoid having your objects destroyed by calling exit(3) rather than returning from main. This really helped in my situation, below.
1006: alex@minusone:~/fully-factoring$ time ./full 30000000 There are 1857859 primes. The largest is 29999999. real 1m16.196s user 0m40.990s sys 0m1.832s 1009: alex@minusone:~/fully-factoring$ time ./full 30000000 There are 1857859 primes. The largest is 29999999. real 0m35.794s user 0m32.942s sys 0m1.621s
The first is with a return 0; the second calls exit(0).
Deleted comment
July 28 2005, 00:45:24 UTC 6 years ago
July 28 2005, 14:43:30 UTC 6 years ago
duh!
Just don't try it in win98!July 29 2005, 14:34:26 UTC 6 years ago
Re: duh!
No kidding!