On Jan 3, 2013, at 2:38 PM, Marc Feeley wrote:
On 2012-12-18, at 8:45 AM, Bradley Lucier lucier@math.purdue.edu wrote:
Surely 1MB can be OK as a default heap size nowadays ;-)!
Why not 2, 5 or 10MB?
What's your point?
A default heap size of 5 MB makes some sense given that it is roughly the size of the executable code of the library.
I think a default heap size should be the size of the largest cache (or half the size of the largest cache, given that the garbage collector is stop-and-copy (I think)) in commonly-used processors. That way most of the data working set would be in cache.
My guess is that only a relatively small part of the Gambit runtime code is active at any given time in most programs (especially with the conditional specialization of most standard operators).
BTW, if you want a different default heap size, why don't you use :
export GAMBCOPT=m1000
in your .profile?
I know how to set the cachet; what I'm concerned about is people we'd like to attract to Gambit who try it out first with some trivial code that performs poorly because Gambit is spending 2/3 of its time in GC. Newbies don't understand about boxing flonums, or computations that give ratnum results, etc.
Increasing the default heap size from basically zero would help with this problem.
On my mac mini, with a 3MB L2 cache, 2.4GHz Core 2 Duo, I get the following times for mbrot with the following minimum heap sizes (in K).
Somewhere between 500K and 1500K seems to be the sweet spot for minimum cache size.
BTW, the number of GCs does not seem to vary smoothly, it seems to jump at discrete points in the minimum heap size. That goes against my intuition.
Brad
0: 1831 ms cpu time (1805 user, 27 system) 12549 collections accounting for 1690 ms real time (1543 user, 15 system) 100: 1822 ms cpu time (1798 user, 24 system) 12549 collections accounting for 1649 ms real time (1534 user, 13 system) 200: 1833 ms cpu time (1805 user, 28 system) 12549 collections accounting for 1677 ms real time (1540 user, 16 system) 300: 1824 ms cpu time (1798 user, 25 system) 12549 collections accounting for 1613 ms real time (1534 user, 14 system) 400: 1831 ms cpu time (1803 user, 28 system) 12547 collections accounting for 1698 ms real time (1539 user, 16 system) 500: 602 ms cpu time (594 user, 8 system) 2440 collections accounting for 338 ms real time (318 user, 4 system) 600: 609 ms cpu time (601 user, 8 system) 2440 collections accounting for 335 ms real time (320 user, 4 system) 700: 611 ms cpu time (601 user, 10 system) 2440 collections accounting for 361 ms real time (321 user, 5 system) 800: 603 ms cpu time (595 user, 9 system) 2440 collections accounting for 340 ms real time (318 user, 4 system) 900: 607 ms cpu time (600 user, 7 system) 2440 collections accounting for 336 ms real time (320 user, 3 system) 1000: 604 ms cpu time (595 user, 8 system) 2440 collections accounting for 358 ms real time (318 user, 4 system) 1100: 599 ms cpu time (591 user, 8 system) 2440 collections accounting for 323 ms real time (316 user, 4 system) 1200: 610 ms cpu time (601 user, 9 system) 2440 collections accounting for 342 ms real time (321 user, 4 system) 1300: 628 ms cpu time (618 user, 10 system) 1350 collections accounting for 258 ms real time (232 user, 3 system) 1400: 637 ms cpu time (629 user, 8 system) 1350 collections accounting for 266 ms real time (242 user, 3 system) 1500: 635 ms cpu time (623 user, 11 system) 1350 collections accounting for 289 ms real time (237 user, 4 system) 1600: 625 ms cpu time (617 user, 8 system) 1350 collections accounting for 250 ms real time (232 user, 3 system) 1700: 635 ms cpu time (623 user, 11 system) 1350 collections accounting for 282 ms real time (237 user, 4 system) 1800: 631 ms cpu time (625 user, 7 system) 1350 collections accounting for 245 ms real time (236 user, 2 system) 1900: 632 ms cpu time (625 user, 7 system) 1350 collections accounting for 251 ms real time (236 user, 2 system) 2000: 639 ms cpu time (629 user, 10 system) 1350 collections accounting for 260 ms real time (238 user, 4 system) 100: 1826 ms cpu time (1800 user, 25 system) 12549 collections accounting for 1677 ms real time (1537 user, 14 system) 2200: 805 ms cpu time (794 user, 11 system) 935 collections accounting for 273 ms real time (248 user, 3 system) 2300: 819 ms cpu time (811 user, 8 system) 935 collections accounting for 261 ms real time (252 user, 2 system) 2400: 817 ms cpu time (809 user, 8 system) 935 collections accounting for 259 ms real time (254 user, 2 system) 2500: 814 ms cpu time (806 user, 9 system) 935 collections accounting for 275 ms real time (251 user, 3 system) 2600: 821 ms cpu time (807 user, 15 system) 935 collections accounting for 287 ms real time (254 user, 5 system) 2700: 818 ms cpu time (805 user, 13 system) 935 collections accounting for 284 ms real time (251 user, 4 system) 2800: 809 ms cpu time (797 user, 12 system) 935 collections accounting for 304 ms real time (253 user, 3 system) 2900: 817 ms cpu time (805 user, 11 system) 935 collections accounting for 262 ms real time (252 user, 4 system) 3000: 813 ms cpu time (798 user, 14 system) 935 collections accounting for 272 ms real time (250 user, 4 system) 3100: 862 ms cpu time (847 user, 14 system) 714 collections accounting for 298 ms real time (252 user, 4 system) 3200: 872 ms cpu time (859 user, 13 system) 714 collections accounting for 284 ms real time (257 user, 4 system) 3300: 862 ms cpu time (848 user, 14 system) 714 collections accounting for 288 ms real time (253 user, 4 system) 3400: 865 ms cpu time (853 user, 12 system) 714 collections accounting for 277 ms real time (255 user, 3 system) 3500: 855 ms cpu time (842 user, 13 system) 714 collections accounting for 285 ms real time (252 user, 4 system) 3600: 864 ms cpu time (852 user, 12 system) 714 collections accounting for 291 ms real time (255 user, 4 system) 3700: 879 ms cpu time (866 user, 12 system) 714 collections accounting for 279 ms real time (260 user, 4 system) 3800: 870 ms cpu time (859 user, 11 system) 714 collections accounting for 280 ms real time (258 user, 3 system) 3900: 858 ms cpu time (847 user, 11 system) 714 collections accounting for 284 ms real time (253 user, 3 system) 4000: 851 ms cpu time (835 user, 16 system) 578 collections accounting for 285 ms real time (243 user, 4 system) 4100: 868 ms cpu time (854 user, 13 system) 578 collections accounting for 263 ms real time (247 user, 3 system) 4200: 860 ms cpu time (847 user, 13 system) 578 collections accounting for 268 ms real time (244 user, 4 system) 4300: 868 ms cpu time (853 user, 14 system) 578 collections accounting for 283 ms real time (249 user, 4 system) 4400: 870 ms cpu time (857 user, 12 system) 578 collections accounting for 261 ms real time (249 user, 4 system) 4500: 854 ms cpu time (839 user, 15 system) 578 collections accounting for 285 ms real time (242 user, 4 system) 4600: 860 ms cpu time (846 user, 13 system) 578 collections accounting for 272 ms real time (245 user, 4 system) 4700: 865 ms cpu time (854 user, 11 system) 578 collections accounting for 270 ms real time (248 user, 3 system) 4800: 859 ms cpu time (848 user, 11 system) 578 collections accounting for 266 ms real time (246 user, 3 system) 4900: 858 ms cpu time (844 user, 14 system) 485 collections accounting for 243 ms real time (232 user, 4 system) 5000: 849 ms cpu time (834 user, 14 system) 485 collections accounting for 311 ms real time (229 user, 4 system) 5100: 861 ms cpu time (847 user, 14 system) 485 collections accounting for 247 ms real time (233 user, 4 system) 5200: 838 ms cpu time (822 user, 16 system) 485 collections accounting for 265 ms real time (226 user, 4 system) 5300: 852 ms cpu time (838 user, 14 system) 485 collections accounting for 251 ms real time (230 user, 3 system) 5400: 848 ms cpu time (837 user, 11 system) 485 collections accounting for 259 ms real time (230 user, 3 system) 5500: 850 ms cpu time (832 user, 17 system) 485 collections accounting for 268 ms real time (231 user, 5 system) 5600: 843 ms cpu time (829 user, 13 system) 485 collections accounting for 247 ms real time (228 user, 4 system) 5700: 851 ms cpu time (839 user, 13 system) 485 collections accounting for 256 ms real time (232 user, 3 system) 5800: 841 ms cpu time (827 user, 14 system) 418 collections accounting for 231 ms real time (211 user, 3 system) 5900: 831 ms cpu time (816 user, 15 system) 418 collections accounting for 222 ms real time (209 user, 3 system) 6000: 850 ms cpu time (837 user, 13 system) 418 collections accounting for 221 ms real time (215 user, 3 system) 6100: 839 ms cpu time (826 user, 13 system) 418 collections accounting for 222 ms real time (211 user, 3 system) 6200: 824 ms cpu time (806 user, 18 system) 418 collections accounting for 238 ms real time (206 user, 5 system) 6300: 834 ms cpu time (819 user, 15 system) 418 collections accounting for 223 ms real time (210 user, 3 system) 6400: 833 ms cpu time (816 user, 17 system) 418 collections accounting for 238 ms real time (211 user, 4 system) 6500: 827 ms cpu time (808 user, 18 system) 418 collections accounting for 248 ms real time (206 user, 4 system) 6600: 834 ms cpu time (817 user, 17 system) 418 collections accounting for 231 ms real time (208 user, 4 system) 6700: 830 ms cpu time (816 user, 14 system) 367 collections accounting for 215 ms real time (192 user, 3 system) 6800: 816 ms cpu time (801 user, 15 system) 367 collections accounting for 227 ms real time (189 user, 3 system) 6900: 826 ms cpu time (810 user, 15 system) 367 collections accounting for 212 ms real time (192 user, 3 system) 7000: 826 ms cpu time (810 user, 16 system) 367 collections accounting for 235 ms real time (190 user, 3 system) 7100: 822 ms cpu time (805 user, 17 system) 367 collections accounting for 218 ms real time (190 user, 4 system) 7200: 816 ms cpu time (803 user, 13 system) 367 collections accounting for 227 ms real time (189 user, 3 system) 7300: 833 ms cpu time (820 user, 12 system) 367 collections accounting for 201 ms real time (191 user, 2 system) 7400: 820 ms cpu time (802 user, 18 system) 367 collections accounting for 218 ms real time (188 user, 4 system) 7500: 831 ms cpu time (812 user, 19 system) 367 collections accounting for 208 ms real time (192 user, 4 system) 7600: 809 ms cpu time (790 user, 19 system) 328 collections accounting for 199 ms real time (170 user, 4 system) 7700: 811 ms cpu time (796 user, 14 system) 328 collections accounting for 198 ms real time (172 user, 3 system) 7800: 816 ms cpu time (802 user, 15 system) 328 collections accounting for 193 ms real time (173 user, 3 system) 7900: 811 ms cpu time (795 user, 16 system) 328 collections accounting for 193 ms real time (170 user, 3 system) 8000: 818 ms cpu time (803 user, 15 system) 328 collections accounting for 180 ms real time (171 user, 3 system) 8100: 825 ms cpu time (812 user, 14 system) 328 collections accounting for 178 ms real time (173 user, 2 system) 8200: 813 ms cpu time (799 user, 14 system) 328 collections accounting for 180 ms real time (171 user, 3 system) 8300: 828 ms cpu time (813 user, 15 system) 328 collections accounting for 189 ms real time (174 user, 3 system) 8400: 821 ms cpu time (805 user, 16 system) 328 collections accounting for 183 ms real time (174 user, 3 system) 8500: 813 ms cpu time (797 user, 16 system) 296 collections accounting for 180 ms real time (157 user, 3 system) 8600: 823 ms cpu time (809 user, 15 system) 296 collections accounting for 169 ms real time (159 user, 2 system) 8700: 807 ms cpu time (790 user, 17 system) 296 collections accounting for 164 ms real time (155 user, 3 system) 8800: 814 ms cpu time (797 user, 17 system) 296 collections accounting for 163 ms real time (157 user, 3 system) 8900: 816 ms cpu time (801 user, 16 system) 296 collections accounting for 164 ms real time (157 user, 2 system) 9000: 802 ms cpu time (786 user, 16 system) 296 collections accounting for 170 ms real time (155 user, 2 system) 9100: 811 ms cpu time (794 user, 17 system) 296 collections accounting for 164 ms real time (158 user, 3 system) 9200: 810 ms cpu time (797 user, 14 system) 296 collections accounting for 174 ms real time (157 user, 2 system) 9300: 817 ms cpu time (800 user, 17 system) 296 collections accounting for 172 ms real time (158 user, 3 system) 9400: 798 ms cpu time (780 user, 18 system) 269 collections accounting for 164 ms real time (143 user, 3 system) 9500: 814 ms cpu time (796 user, 17 system) 269 collections accounting for 165 ms real time (146 user, 3 system) 9600: 801 ms cpu time (782 user, 19 system) 269 collections accounting for 165 ms real time (141 user, 3 system) 9700: 802 ms cpu time (783 user, 19 system) 269 collections accounting for 158 ms real time (143 user, 3 system) 9800: 791 ms cpu time (771 user, 20 system) 269 collections accounting for 152 ms real time (138 user, 3 system) 9900: 800 ms cpu time (779 user, 21 system) 269 collections accounting for 155 ms real time (141 user, 3 system) 10000: 794 ms cpu time (774 user, 19 system) 269 collections accounting for 156 ms real time (142 user, 3 system)