SlideShare uma empresa Scribd logo
1 de 36
Baixar para ler offline
Reducing Waste in 
Expandable Collections: 
The Pharo Case 
Alexandre Bergel, Alejandro Infante, Juan Pablo 
Sandoval Alcocer 
! 
University of Chile
c 
array! 
size = 0 
c := OrderedCollection new.
c 
array! 
size = 0 
capacity = 10 
c := OrderedCollection new.
c 
array! 
size = 0 
capacity = 10 
c := OrderedCollection new.! 
11 timesRepeat: [ c add: 42 ].
c 
array! 
size = 1 
42 
capacity = 10 
c := OrderedCollection new.! 
11 timesRepeat: [ c add: 42 ].
c 
array! 
size = 2 
42 42 
capacity = 10 
c := new OrderedCollection.! 
11 timesRepeat: [ c add: 42 ].
c 
array! 
size = 3 
42 42 42 
capacity = 10 
c := OrderedCollection new.! 
11 timesRepeat: [ c add: 42 ].
c 
array! 
size = 10 
capacity = 10 
42 42 42 42 42 42 42 42 42 42 
c := OrderedCollection new.! 
11 timesRepeat: [ c add: 42 ].
c 
array! 
size = 10 
capacity = 10 
42 42 42 42 42 42 42 42 42 42 
c := OrderedCollection new.! 
11 timesRepeat: [ c add: 42 ].
c 
array! 
size = 10 
capacity = 10 
42 42 42 42 42 42 42 42 42 42 
42 
c := OrderedCollection new.! 
11 timesRepeat: [ c add: 42 ].
c 
array! 
size = 10 
capacity = 10 
42 42 42 42 42 42 42 42 42 42 
42 42 
c := OrderedCollection new.! 
11 timesRepeat: [ c add: 42 ].
c 
array! 
size = 10 
capacity = 10 
42 42 42 42 42 42 42 42 42 42 
42 42 42 42 42 42 42 42 42 42 
42 
c := OrderedCollection new.! 
11 timesRepeat: [ c add: 42 ].
c 
array! 
size = 11 
capacity = 20 
42 42 42 42 42 42 42 42 42 42 
42 
c := OrderedCollection new.! 
11 timesRepeat: [ c add: 42 ].
c := OrderedCollection new. 
[ 30000000 timesRepeat: [ c add: 42 ] ] timeToRun! 
=> 3375 milliseconds!
c := OrderedCollection new. 
[ 30000000 timesRepeat: [ c add: 42 ] ] timeToRun! 
=> 3375 milliseconds! 
22 expansions, 164 Mb copied
c := OrderedCollection new. 
[ 30000000 timesRepeat: [ c add: 42 ] ] timeToRun! 
=> 3375 milliseconds! 
22 expansions, 164 Mb copied 
c := OrderedCollection new: 30000000. 
[ 30000000 timesRepeat: [ c add: 42 ] ] timeToRun! 
=> 1356 milliseconds! 
0 expansion, 0 Mb copied
Our Paper 
Characterize the use of expandable collections 
! 
Measure the overhead associated with expandable 
collections 
! 
Reducing the overhead associated with expandable 
collections
index Application LOC #Ref 
*1 AST 8,091 57 
2 Arki 627 6 
3 Glamour 17,525 105 
4 GraphET 2,757 10 
5 Magritte 5,884 29 
6 Manifest 2,864 11 
7 NECompletion 3,446 33 
*8 Nautilus 1,566 9 
*9 Petit 14,919 95 
10 Refactoring 21,328 125 
*11 Regex 5,055 16 
12 Ring 3,378 50 
*13 Roassal 19,844 133 
14 RoelTyper 2,003 85 
15 Shout 3,290 10 
16 SmallDude 3,805 66 
17 Spec 10,212 37 
Table 2: Description of the benchmark (the #Ref column 
indicates the number of references to expandable collection 
in source code)
bench. NC NNEC NEC NCE NCB NAC NOSM NSM NAB NUB 
1 643,603 151,665(23%) 491,938(76%) 2,636 35,940 646,239 112,308(17%) 112,439(17%) 18,819,920 17,907,204 
2 13 12(92%) 1(7%) 0 0 13 1(7%) 1(7%) 468 392 
3 78,976 34,912(44%) 44,064(55%) 322 2,272 79,298 10,604(13%) 10,681(13%) 2,374,464 2,213,384 
4 1,690 512(30%) 1,178(69%) 30 1,720 1,720 245(14%) 245(14%) 65,760 55,420 
5 3,191 2,009(62%) 1,182(37%) 30 1,208 3,193 200(6%) 251(7%) 77,808 67,724 
6 96 44(45%) 52(54%) 0 0 96 40(41%) 40(41%) 3,740 3,464 
7 612 218(35%) 394(64%) 614 2,257,960 1,231 48(7%) 48(7%) 4,657,696 837,948 
8 2 0(0%) 2(100%) 0 0 2 0(0%) 0(0%) 40 40 
9 158,589 58,371(36%) 100,218(63%) 5,663 280,876 164,252 57,644(36%) 57,728(36%) 6,833,532 5,534,280 
10 1,432,306 14,891(1%) 1,417,415(98%) 6,074 12,258,424 1,438,380 8,248(0%) 8,344(0%) 46,958,632 34,241,204 
11 6,839 2,058(30%) 4,781(69%) 1,280 78,712 6,967 471(6%) 480(7%) 291,052 256,852 
12 8,363 3,530(42%) 4,833(57%) 1,103 47,852 9,466 73(0%) 73(0%) 279,236 165,460 
13 108,571 57,590(53%) 50,981(46%) 1,739 369,336 109,990 8,151(7%) 8,810(8%) 5,778,016 4,845,764 
14 10,305 586(5%) 9,719(94%) 145 14,044 10,448 82(0%) 110(1%) 443,828 420,352 
15 20,815 14,886(71%) 5,929(28%) 255 125,900 21,070 5,736(27%) 5,740(27%) 2,692,404 1,984,240 
16 766 172(22%) 594(77%) 17 496 783 123(16%) 123(16%) 126,368 122,532 
17 1,203 880(73%) 323(26%) 1,512 48,384 2,715 764(63%) 764(63%) 127,356 35,988 
total 2,475,940 342,336(13%) 2,133,604(86%) 21,420 15,523,124 2,495,863 204,738(8%) 205,877(8%) 89,530,320 68,692,248 
bAST1 210,000 38,000(18%) 172,000(81%) 0 0 210,000 38,000(18%) 38,000(18%) 6,752,000 6,468,000 
bAST2 179,000 47,000(26%) 132,000(73%) 4,000 24,000 183,000 41,000(22%) 41,000(22%) 5,928,000 5,580,000 
bAST3 428,550 103,830(24%) 324,720(75%) 2,670 28,200 431,220 87,570(20%) 87,570(20%) 13,795,440 13,212,720 
bN1 150 0(0%) 150(100%) 0 0 150 0(0%) 0(0%) 3,000 3,000 
bN2 180 150(83%) 30(16%) 60 9,000 240 120(66%) 120(66%) 22,440 7,680 
bN3 240 240(100%) 0(0%) 60 9,000 300 180(75%) 180(75%) 22,680 7,560 
bPP1 90,600 46,200(50%) 44,400(49%) 5,600 436,800 96,200 46,200(50%) 46,200(50%) 4,214,400 3,033,600 
bPP2 78,000 44,800(57%) 33,200(42%) 6,600 476,800 84,600 44,800(57%) 44,800(57%) 3,790,400 2,571,200 
bPP3 546,710 398,420(72%) 148,290(27%) 52,860 6,475,120 599,570 398,420(72%) 398,420(72%) 29,103,720 17,192,120 
bReg1 1,000 200(20%) 800(80%) 0 0 1,000 100(10%) 100(10%) 34,400 33,600 
bReg2 2,162,830 427,970(19%) 1,734,860(80%) 427,950 17,118,080 2,162,860 10(0%) 10(0%) 86,513,920 84,799,800 
bReg3 1,949,950 476,010(24%) 1,473,940(75%) 476,020 19,042,680 1,950,010 10(0%) 10(0%) 78,001,720 76,093,720 
bR1 400,011 7(0%) 400,004(99%) 46 2,631,600 400,055 0(0%) 3(0%) 17,263,480 13,023,236 
bR2 2,530 1,583(62%) 947(37%) 117 15,608 2,642 289(11%) 299(11%) 141,056 99,404 
bR3 79,456 53,259(67%) 26,197(32%) 4,809 686,196 84,073 13,365(16%) 13,454(16%) 7,701,916 6,045,808 
total 6,129,207 1,637,669(26%) 4,491,538(73%) 980,792 46,953,084 6,205,920 670,064(10%) 670,166(10%) 253,288,572 228,171,448 
Total 8,605,147 1,980,005(23%) 6,625,142(76%) 1,002,212 62,476,208 8,701,783 874,802(10%) 876,043(10%) 342,818,892 296,863,696 
Table 3: Original benchmark (baseline for all the other measurements)
Lazy Array creation 
c 
array! 
size = 0 
nil 
c := OrderedCollection new.
Lazy Array creation 
c 
array! 
size = 0 
42 
c := OrderedCollection new.! 
c add: 42
bench. NC NNEC NEC NCE NCB NAC NOSM NSM NAB NUB 
1 643,603 151,665(23%) 491,938(76%) 2,636 35,940 229,379 112,308(17%) 112,439(17%) 3,956,792 3,044,076 
2 13 12(92%) 1(7%) 0 0 13 1(7%) 1(7%) 468 392 
3 79,035 34,970(44%) 44,065(55%) 45 2,272 44,294 10,612(13%) 10,689(13%) 1,397,668 1,236,260 
4 1,690 512(30%) 1,178(69%) 30 1,720 905 245(14%) 245(14%) 33,160 22,820 
5 3,551 2,009(56%) 1,542(43%) 30 1,208 2,685 200(5%) 251(7%) 65,208 55,124 
6 96 44(45%) 52(54%) 0 0 91 40(41%) 40(41%) 3,560 3,284 
7 644 218(33%) 426(66%) 614 2,257,960 927 48(7%) 48(7%) 4,509,216 689,468 
8 2 0(0%) 2(100%) 0 0 0 0(0%) 0(0%) 0 0 
9 158,395 58,331(36%) 100,064(63%) 5,663 280,876 123,703 57,637(36%) 57,718(36%) 5,220,152 3,921,204 
10 1,432,306 14,891(1%) 1,417,415(98%) 6,074 12,258,424 68,132 8,248(0%) 8,344(0%) 19,547,672 6,830,248 
11 6,839 2,058(30%) 4,781(69%) 1,280 78,712 2,186 471(6%) 480(7%) 109,212 75,012 
12 7,870 3,472(44%) 4,398(55%) 1,094 44,384 5,253 20(0%) 20(0%) 194,732 84,716 
13 108,571 57,590(53%) 50,981(46%) 1,739 369,336 62,510 8,151(7%) 8,810(8%) 4,218,656 3,286,404 
14 10,305 586(5%) 9,719(94%) 145 14,044 963 82(0%) 110(1%) 136,008 112,532 
15 20,815 14,886(71%) 5,929(28%) 255 125,900 18,489 5,736(27%) 5,740(27%) 2,640,784 1,932,632 
16 766 172(22%) 594(77%) 17 496 221 123(16%) 123(16%) 14,288 10,452 
17 1,203 880(73%) 323(26%) 1,512 48,384 2,392 764(63%) 764(63%) 120,856 29,488 
total 2,475,704 342,296(13%) 2,133,408(86%) 21,134 15,519,656 562,143 204,686(8%) 205,822(8%) 42,168,432 21,334,112 
bAST1 210,000 38,000(18%) 172,000(81%) 0 0 47,000 38,000(18%) 38,000(18%) 820,000 536,000 
bAST2 179,000 47,000(26%) 132,000(73%) 4,000 24,000 53,000 41,000(22%) 41,000(22%) 1,016,000 668,000 
bAST3 428,550 103,830(24%) 324,720(75%) 2,670 28,200 113,040 87,570(20%) 87,570(20%) 2,389,680 1,806,960 
bN1 150 0(0%) 150(100%) 0 0 0 0(0%) 0(0%) 0 0 
bN2 180 150(83%) 30(16%) 60 9,000 210 120(66%) 120(66%) 21,840 7,080 
bN3 240 240(100%) 0(0%) 60 9,000 300 180(75%) 180(75%) 22,680 7,560 
bPP1 90,600 46,200(50%) 44,400(49%) 5,600 436,800 78,000 46,200(50%) 46,200(50%) 3,490,400 2,309,600 
bPP2 78,000 44,800(57%) 33,200(42%) 6,600 476,800 70,200 44,800(57%) 44,800(57%) 3,218,400 1,999,200 
bPP3 546,710 398,420(72%) 148,290(27%) 52,860 6,475,120 543,770 398,420(72%) 398,420(72%) 26,952,320 15,040,720 
bReg1 1,000 200(20%) 800(80%) 0 0 200 100(10%) 100(10%) 7,200 6,400 
bReg2 2,162,830 427,970(19%) 1,734,860(80%) 427,950 17,118,080 428,000 10(0%) 10(0%) 17,120,000 15,405,880 
bReg3 1,949,950 476,010(24%) 1,473,940(75%) 476,020 19,042,680 476,070 10(0%) 10(0%) 19,044,600 17,136,600 
bR1 400,011 7(0%) 400,004(99%) 46 2,631,600 52 0(0%) 3(0%) 5,263,360 1,223,116 
bR2 2,422 1,583(65%) 839(34%) 117 15,608 1,698 289(11%) 299(12%) 109,356 67,704 
bR3 78,145 53,259(68%) 24,886(31%) 4,809 686,196 63,400 13,365(17%) 13,454(17%) 7,034,296 5,378,188 
total 6,127,788 1,637,669(26%) 4,490,119(73%) 980,792 46,953,084 1,874,940 670,064(10%) 670,166(10%) 86,510,132 61,393,008 
Total 8,603,492 1,979,965(23%) 6,623,527(76%) 1,001,926 62,472,740 2,437,083 874,750(10%) 875,988(10%) 128,678,564 82,727,120 
Table 4: Lazy internal array creation
bench. NC NNEC NEC NCE NCB NAC NOSM NSM NAB NUB 
1 643,603 151,665(23%) 491,938(76%) 2,636 35,940 229,379 112,308(17%) 112,439(17%) 3,956,792 3,044,076 
2 13 12(92%) 1(7%) 0 0 13 1(7%) 1(7%) 468 392 
3 79,035 34,970(44%) 44,065(55%) 45 2,272 44,294 10,612(13%) 10,689(13%) 1,397,668 1,236,260 
4 1,690 512(30%) 1,178(69%) 30 1,720 905 245(14%) 245(14%) 33,160 22,820 
5 3,551 2,009(56%) 1,542(43%) 30 1,208 2,685 200(5%) 251(7%) 65,208 55,124 
6 96 44(45%) 52(54%) 0 0 91 40(41%) 40(41%) 3,560 3,284 
7 644 218(33%) 426(66%) 614 2,257,960 927 48(7%) 48(7%) 4,509,216 689,468 
8 2 0(0%) 2(100%) 0 0 0 0(0%) 0(0%) 0 0 
9 158,395 58,331(36%) 100,064(63%) 5,663 280,876 123,703 57,637(36%) 57,718(36%) 5,220,152 3,921,204 
10 1,432,306 14,891(1%) 1,417,415(98%) 6,074 12,258,424 68,132 8,248(0%) 8,344(0%) 19,547,672 6,830,248 
11 6,839 2,058(30%) 4,781(69%) 1,280 78,712 2,186 471(6%) 480(7%) 109,212 75,012 
12 7,870 3,472(44%) 4,398(55%) 1,094 44,384 5,253 20(0%) 20(0%) 194,732 84,716 
13 108,571 57,590(53%) 50,981(46%) 1,739 369,336 62,510 8,151(7%) 8,810(8%) 4,218,656 3,286,404 
14 10,305 586(5%) 9,719(94%) 145 14,044 963 82(0%) 110(1%) 136,008 112,532 
15 20,815 14,886(71%) 5,929(28%) 255 125,900 18,489 5,736(27%) 5,740(27%) 2,640,784 1,932,632 
16 766 172(22%) 594(77%) 17 496 221 123(16%) 123(16%) 14,288 10,452 
17 1,203 880(73%) 323(26%) 1,512 48,384 2,392 764(63%) 764(63%) 120,856 29,488 
total 2,475,704 342,296(13%) 2,133,408(86%) 21,134 15,519,656 562,143 204,686(8%) 205,822(8%) 42,168,432 21,334,112 
bAST1 210,000 38,000(18%) 172,000(81%) 0 0 47,000 38,000(18%) 38,000(18%) 820,000 536,000 
bAST2 179,000 47,000(26%) 132,000(73%) 4,000 24,000 53,000 41,000(22%) 41,000(22%) 1,016,000 668,000 
bAST3 428,550 103,830(24%) 324,720(75%) 2,670 28,200 113,040 87,570(20%) 87,570(20%) 2,389,680 1,806,960 
bN1 150 0(0%) 150(100%) 0 0 0 0(0%) 0(0%) 0 0 
bN2 180 150(83%) 30(16%) 60 9,000 210 120(66%) 120(66%) 21,840 7,080 
bN3 240 240(100%) 0(0%) 60 9,000 300 180(75%) 180(75%) 22,680 7,560 
bPP1 90,600 46,200(50%) 44,400(49%) 5,600 436,800 78,000 46,200(50%) 46,200(50%) 3,490,400 2,309,600 
bPP2 78,000 44,800(57%) 33,200(42%) 6,600 476,800 70,200 44,800(57%) 44,800(57%) 3,218,400 1,999,200 
bPP3 546,710 398,420(72%) 148,290(27%) 52,860 6,475,120 543,770 398,420(72%) 398,420(72%) 26,952,320 15,040,720 
bReg1 1,000 200(20%) 800(80%) 0 0 200 100(10%) 100(10%) 7,200 6,400 
bReg2 2,162,830 427,970(19%) 1,734,860(80%) 427,950 17,118,080 428,000 10(0%) 10(0%) 17,120,000 15,405,880 
bReg3 1,949,950 476,010(24%) 1,473,940(75%) 476,020 19,042,680 476,070 10(0%) 10(0%) 19,044,600 17,136,600 
bR1 400,011 7(0%) 400,004(99%) 46 2,631,600 52 0(0%) 3(0%) 5,263,360 1,223,116 
bR2 2,422 1,583(65%) 839(34%) 117 15,608 1,698 289(11%) 299(12%) 109,356 67,704 
bR3 78,145 53,259(68%) 24,886(31%) 4,809 686,196 63,400 13,365(17%) 13,454(17%) 7,034,296 5,378,188 
total 6,127,788 1,637,669(26%) 4,490,119(73%) 980,792 46,953,084 1,874,940 670,064(10%) 670,166(10%) 86,510,132 61,393,008 
Total 8,603,492 1,979,965(23%) 6,623,527(76%) 1,001,926 62,472,740 2,437,083 874,750(10%) 875,988(10%) 128,678,564 82,727,120 
Table 4: Lazy internal array creation 
-69% 
-73% 
-72% 
-77% 
-70% 
-73%
When adding the 11th element 
c 
array! 
size = 10 
42 42 42 42 42 42 42 42 42 42 
42 42 42 42 42 42 42 42 42 42 
42 
c := OrderedCollection new.! 
11 timesRepeat: [ c add: 42 ].
When adding the 11th element 
c 
array! 
size = 10 
42 42 42 42 42 42 42 42 42 42 
42 42 42 42 42 42 42 42 42 42 
42 
c := OrderedCollection new.! 
11 timesRepeat: [ c add: 42 ].
Recycling the array … 
42 42 42 42 42 42 42 42 42 42
Emptying it
Inserting the array in a pool 
Global Pool
Inserting the array in a pool 
Global Pool 
OrderedCollection new
bench. NC NNEC NEC NCE NCB NAC NOSM NSM NAB NUB 
1 643,603 151,665(23%) 491,938(76%) 2,636 35,940 226,736 112,308(17%) 112,439(17%) 3,921,136 3,044,076 
2 13 12(92%) 1(7%) 0 0 13 1(7%) 1(7%) 468 392 
3 78,977 34,912(44%) 44,065(55%) 45 2,272 44,193 10,604(13%) 10,681(13%) 1,393,396 1,234,432 
4 1,690 512(30%) 1,178(69%) 30 1,720 873 245(14%) 245(14%) 31,200 22,820 
5 3,551 2,009(56%) 1,542(43%) 30 1,208 2,683 200(5%) 251(7%) 65,168 55,124 
6 96 44(45%) 52(54%) 0 0 91 40(41%) 40(41%) 3,560 3,284 
7 644 218(33%) 426(66%) 614 2,257,960 235 48(7%) 48(7%) 2,372,616 689,468 
8 2 0(0%) 2(100%) 0 0 0 0(0%) 0(0%) 0 0 
9 158,399 58,333(36%) 100,066(63%) 5,663 280,876 118,044 57,639(36%) 57,720(36%) 4,938,224 3,921,356 
10 1,432,306 14,891(1%) 1,417,415(98%) 6,074 12,258,424 62,065 8,248(0%) 8,344(0%) 11,877,480 6,830,244 
11 6,839 2,058(30%) 4,781(69%) 1,280 78,712 2,056 471(6%) 480(7%) 91,804 75,012 
12 7,870 3,472(44%) 4,398(55%) 1,094 44,384 4,163 20(0%) 20(0%) 144,144 84,716 
13 108,571 57,590(53%) 50,981(46%) 1,739 369,336 61,326 8,151(7%) 8,810(8%) 3,907,184 3,286,404 
14 10,305 586(5%) 9,719(94%) 145 14,044 817 82(0%) 110(1%) 119,512 112,532 
15 20,815 14,886(71%) 5,929(28%) 255 125,900 18,233 5,736(27%) 5,740(27%) 2,514,840 1,932,620 
16 766 172(22%) 594(77%) 17 496 203 123(16%) 123(16%) 13,700 10,452 
17 1,203 880(73%) 323(26%) 1,512 48,384 882 764(63%) 764(63%) 72,536 29,488 
total 2,475,650 342,240(13%) 2,133,410(86%) 21,134 15,519,656 542,613 204,680(8%) 205,816(8%) 31,466,968 21,332,420 
bAST1 210,000 38,000(18%) 172,000(81%) 0 0 47,000 38,000(18%) 38,000(18%) 820,000 536,000 
bAST2 179,000 47,000(26%) 132,000(73%) 4,000 24,000 49,002 41,000(22%) 41,000(22%) 992,012 668,000 
bAST3 428,550 103,830(24%) 324,720(75%) 2,670 28,200 110,370 87,570(20%) 87,570(20%) 2,361,480 1,806,960 
bN1 150 0(0%) 150(100%) 0 0 0 0(0%) 0(0%) 0 0 
bN2 180 150(83%) 30(16%) 60 9,000 153 120(66%) 120(66%) 13,400 7,080 
bN3 240 240(100%) 0(0%) 60 9,000 243 180(75%) 180(75%) 14,240 7,560 
bPP1 91,000 46,400(50%) 44,600(49%) 5,600 437,600 72,603 46,400(50%) 46,400(50%) 3,058,196 2,312,800 
bPP2 78,000 44,800(57%) 33,200(42%) 6,600 476,800 63,604 44,800(57%) 44,800(57%) 2,743,088 2,000,000 
bPP3 546,710 398,420(72%) 148,290(27%) 52,170 6,449,480 490,915 398,420(72%) 398,420(72%) 20,488,808 15,051,560 
bReg1 1,000 200(20%) 800(80%) 0 0 200 100(10%) 100(10%) 7,200 6,400 
bReg2 2,162,830 427,970(19%) 1,734,860(80%) 427,950 17,118,080 427,970 10(0%) 10(0%) 17,119,200 15,405,880 
bReg3 1,949,950 476,010(24%) 1,473,940(75%) 476,020 19,042,720 476,011 10(0%) 10(0%) 19,042,492 17,136,640 
bR1 400,011 7(0%) 400,004(99%) 46 2,631,600 38 0(0%) 3(0%) 5,243,040 1,023,116 
bR2 2,422 1,583(65%) 839(34%) 117 15,608 1,597 289(11%) 299(12%) 94,656 67,712 
bR3 78,145 53,259(68%) 24,886(31%) 4,872 699,036 58,872 13,365(17%) 13,454(17%) 6,375,776 5,390,776 
total 6,128,188 1,637,869(26%) 4,490,319(73%) 980,165 46,941,124 1,798,578 670,264(10%) 670,366(10%) 78,373,588 61,420,484 
Total 8,603,838 1,980,109(13%) 6,623,729(86%) 1,001,299 62,460,780 2,341,191 874,944(8%) 876,182(8%) 109,840,556 82,752,904 
Table 5: Lazy internal array creation + reuse of array
bench. NC NNEC NEC NCE NCB NAC NOSM NSM NAB NUB 
1 643,603 151,665(23%) 491,938(76%) 2,636 35,940 226,736 112,308(17%) 112,439(17%) 3,921,136 3,044,076 
2 13 12(92%) 1(7%) 0 0 13 1(7%) 1(7%) 468 392 
3 78,977 34,912(44%) 44,065(55%) 45 2,272 44,193 10,604(13%) 10,681(13%) 1,393,396 1,234,432 
4 1,690 512(30%) 1,178(69%) 30 1,720 873 245(14%) 245(14%) 31,200 22,820 
5 3,551 2,009(56%) 1,542(43%) 30 1,208 2,683 200(5%) 251(7%) 65,168 55,124 
6 96 44(45%) 52(54%) 0 0 91 40(41%) 40(41%) 3,560 3,284 
7 644 218(33%) 426(66%) 614 2,257,960 235 48(7%) 48(7%) 2,372,616 689,468 
8 2 0(0%) 2(100%) 0 0 0 0(0%) 0(0%) 0 0 
9 158,399 58,333(36%) 100,066(63%) 5,663 280,876 118,044 57,639(36%) 57,720(36%) 4,938,224 3,921,356 
10 1,432,306 14,891(1%) 1,417,415(98%) 6,074 12,258,424 62,065 8,248(0%) 8,344(0%) 11,877,480 6,830,244 
11 6,839 2,058(30%) 4,781(69%) 1,280 78,712 2,056 471(6%) 480(7%) 91,804 75,012 
12 7,870 3,472(44%) 4,398(55%) 1,094 44,384 4,163 20(0%) 20(0%) 144,144 84,716 
13 108,571 57,590(53%) 50,981(46%) 1,739 369,336 61,326 8,151(7%) 8,810(8%) 3,907,184 3,286,404 
14 10,305 586(5%) 9,719(94%) 145 14,044 817 82(0%) 110(1%) 119,512 112,532 
15 20,815 14,886(71%) 5,929(28%) 255 125,900 18,233 5,736(27%) 5,740(27%) 2,514,840 1,932,620 
16 766 172(22%) 594(77%) 17 496 203 123(16%) 123(16%) 13,700 10,452 
17 1,203 880(73%) 323(26%) 1,512 48,384 882 764(63%) 764(63%) 72,536 29,488 
total 2,475,650 342,240(13%) 2,133,410(86%) 21,134 15,519,656 542,613 204,680(8%) 205,816(8%) 31,466,968 21,332,420 
bAST1 210,000 38,000(18%) 172,000(81%) 0 0 47,000 38,000(18%) 38,000(18%) 820,000 536,000 
bAST2 179,000 47,000(26%) 132,000(73%) 4,000 24,000 49,002 41,000(22%) 41,000(22%) 992,012 668,000 
bAST3 428,550 103,830(24%) 324,720(75%) 2,670 28,200 110,370 87,570(20%) 87,570(20%) 2,361,480 1,806,960 
bN1 150 0(0%) 150(100%) 0 0 0 0(0%) 0(0%) 0 0 
bN2 180 150(83%) 30(16%) 60 9,000 153 120(66%) 120(66%) 13,400 7,080 
bN3 240 240(100%) 0(0%) 60 9,000 243 180(75%) 180(75%) 14,240 7,560 
bPP1 91,000 46,400(50%) 44,600(49%) 5,600 437,600 72,603 46,400(50%) 46,400(50%) 3,058,196 2,312,800 
bPP2 78,000 44,800(57%) 33,200(42%) 6,600 476,800 63,604 44,800(57%) 44,800(57%) 2,743,088 2,000,000 
bPP3 546,710 398,420(72%) 148,290(27%) 52,170 6,449,480 490,915 398,420(72%) 398,420(72%) 20,488,808 15,051,560 
bReg1 1,000 200(20%) 800(80%) 0 0 200 100(10%) 100(10%) 7,200 6,400 
bReg2 2,162,830 427,970(19%) 1,734,860(80%) 427,950 17,118,080 427,970 10(0%) 10(0%) 17,119,200 15,405,880 
bReg3 1,949,950 476,010(24%) 1,473,940(75%) 476,020 19,042,720 476,011 10(0%) 10(0%) 19,042,492 17,136,640 
bR1 400,011 7(0%) 400,004(99%) 46 2,631,600 38 0(0%) 3(0%) 5,243,040 1,023,116 
bR2 2,422 1,583(65%) 839(34%) 117 15,608 1,597 289(11%) 299(12%) 94,656 67,712 
bR3 78,145 53,259(68%) 24,886(31%) 4,872 699,036 58,872 13,365(17%) 13,454(17%) 6,375,776 5,390,776 
total 6,128,188 1,637,869(26%) 4,490,319(73%) 980,165 46,941,124 1,798,578 670,264(10%) 670,366(10%) 78,373,588 61,420,484 
Total 8,603,838 1,980,109(13%) 6,623,729(86%) 1,001,299 62,460,780 2,341,191 874,944(8%) 876,182(8%) 109,840,556 82,752,904 
Table 5: Lazy internal array creation + reuse of array 
-0.0005% 
+0.0004% 
0% 
-0.03% 
-0.04% 
-0.00003%
ROView>>elementsToRender! | answer | 
answer := OrderedCollection new.! self elementsToRenderDo: ! [ :el | answer add: el ]. ! 
ˆ answer! 
ROView>>elementsToRender! | answer | 
answer := OrderedCollection new: ! (self elements size).! 
! self elementsToRenderDo: ! [ :el | answer add: el ]. ! 
ˆ answer!
bench. NC NNEC NEC NCE NCB NAC NOSM NSM NAB NUB 
1 643,626 151,687(23%) 491,939(76%) 2,648 35,956 226,964 112,329(17%) 112,460(17%) 3,906,608 3,029,456 
2 13 12(92%) 1(7%) 0 0 13 1(7%) 1(7%) 468 392 
3 79,043 34,974(44%) 44,069(55%) 65 2,108 44,259 10,616(13%) 10,693(13%) 1,384,428 1,225,288 
4 1,691 513(30%) 1,178(69%) 30 1,760 874 246(14%) 246(14%) 30,952 22,532 
5 3,551 2,009(56%) 1,542(43%) 28 1,120 2,683 200(5%) 251(7%) 65,352 55,308 
6 96 44(45%) 52(54%) 0 0 91 40(41%) 40(41%) 3,560 3,284 
7 644 218(33%) 426(66%) 614 2,257,960 235 48(7%) 48(7%) 2,372,608 689,492 
8 2 0(0%) 2(100%) 0 0 0 0(0%) 0(0%) 0 0 
9 158,399 58,333(36%) 100,066(63%) 5,651 280,636 118,043 57,639(36%) 57,720(36%) 4,938,340 3,921,516 
10 1,432,306 14,891(1%) 1,417,415(98%) 6,069 12,280,124 62,070 8,248(0%) 8,344(0%) 11,852,428 6,828,504 
11 6,839 2,058(30%) 4,781(69%) 1,280 78,760 2,055 471(6%) 480(7%) 91,812 75,064 
12 7,870 3,472(44%) 4,398(55%) 1,095 46,236 4,163 20(0%) 20(0%) 145,360 86,528 
13 108,571 57,589(53%) 50,982(46%) 1,683 367,164 61,330 8,150(7%) 8,809(8%) 3,865,908 3,245,964 
14 10,305 586(5%) 9,719(94%) 145 14,044 819 82(0%) 110(1%) 120,872 112,660 
15 20,815 14,886(71%) 5,929(28%) 255 125,900 18,233 5,736(27%) 5,740(27%) 2,514,084 1,932,656 
16 766 172(22%) 594(77%) 14 376 202 123(16%) 123(16%) 12,488 9,428 
17 1,203 880(73%) 323(26%) 0 0 880 764(63%) 764(63%) 72,472 29,488 
total 2,475,740 342,324(13%) 2,133,416(86%) 19,577 15,492,144 542,914 204,713(8%) 205,849(8%) 31,377,740 21,267,560 
bAST1 210,000 38,000(18%) 172,000(81%) 0 0 47,000 38,000(18%) 38,000(18%) 820,000 536,000 
bAST2 179,000 47,000(26%) 132,000(73%) 4,000 24,000 49,002 41,000(22%) 41,000(22%) 992,012 668,000 
bAST3 428,550 103,830(24%) 324,720(75%) 2,670 28,200 110,370 87,570(20%) 87,570(20%) 2,329,080 1,774,560 
bN1 150 0(0%) 150(100%) 0 0 0 0(0%) 0(0%) 0 0 
bN2 180 150(83%) 30(16%) 60 9,000 154 120(66%) 120(66%) 11,280 4,920 
bN3 240 240(100%) 0(0%) 60 9,000 244 180(75%) 180(75%) 12,120 5,400 
bPP1 90,600 46,200(50%) 44,400(49%) 5,600 437,600 72,403 46,200(50%) 46,200(50%) 3,057,396 2,312,800 
bPP2 78,000 44,800(57%) 33,200(42%) 6,600 476,800 63,604 44,800(57%) 44,800(57%) 2,743,088 2,000,000 
bPP3 546,710 398,420(72%) 148,290(27%) 52,170 6,449,480 490,915 398,420(72%) 398,420(72%) 20,488,808 15,051,560 
bReg1 1,000 200(20%) 800(80%) 0 0 200 100(10%) 100(10%) 7,200 6,400 
bReg2 2,162,830 427,970(19%) 1,734,860(80%) 427,950 17,118,080 427,970 10(0%) 10(0%) 17,119,200 15,405,880 
bReg3 1,949,950 476,010(24%) 1,473,940(75%) 476,020 19,042,720 476,011 10(0%) 10(0%) 19,042,492 17,136,640 
bR1 400,011 7(0%) 400,004(99%) 46 2,631,600 38 0(0%) 3(0%) 5,243,040 1,023,116 
bR2 2,422 1,583(65%) 839(34%) 117 15,608 1,597 289(11%) 299(12%) 94,616 67,672 
bR3 78,145 53,259(68%) 24,886(31%) 4,872 699,036 58,872 13,365(17%) 13,454(17%) 6,375,736 5,390,736 
total 6,127,788 1,637,669(26%) 4,490,119(73%) 980,165 46,941,124 1,798,380 670,064(10%) 670,166(10%) 78,336,068 61,383,684 
Total 8,603,528 1,979,993(23%) 6,623,535(76%) 999,742 62,433,268 2,341,294 874,777(10%) 876,015(10%) 109,713,808 82,651,244 
Table 6: Lazy internal array creation + reuse of array + code refactoring
bench. NC NNEC NEC NCE NCB NAC NOSM NSM NAB NUB 
1 643,626 151,687(23%) 491,939(76%) 2,648 35,956 226,964 112,329(17%) 112,460(17%) 3,906,608 3,029,456 
2 13 12(92%) 1(7%) 0 0 13 1(7%) 1(7%) 468 392 
3 79,043 34,974(44%) 44,069(55%) 65 2,108 44,259 10,616(13%) 10,693(13%) 1,384,428 1,225,288 
4 1,691 513(30%) 1,178(69%) 30 1,760 874 246(14%) 246(14%) 30,952 22,532 
5 3,551 2,009(56%) 1,542(43%) 28 1,120 2,683 200(5%) 251(7%) 65,352 55,308 
6 96 44(45%) 52(54%) 0 0 91 40(41%) 40(41%) 3,560 3,284 
7 644 218(33%) 426(66%) 614 2,257,960 235 48(7%) 48(7%) 2,372,608 689,492 
8 2 0(0%) 2(100%) 0 0 0 0(0%) 0(0%) 0 0 
9 158,399 58,333(36%) 100,066(63%) 5,651 280,636 118,043 57,639(36%) 57,720(36%) 4,938,340 3,921,516 
10 1,432,306 14,891(1%) 1,417,415(98%) 6,069 12,280,124 62,070 8,248(0%) 8,344(0%) 11,852,428 6,828,504 
11 6,839 2,058(30%) 4,781(69%) 1,280 78,760 2,055 471(6%) 480(7%) 91,812 75,064 
12 7,870 3,472(44%) 4,398(55%) 1,095 46,236 4,163 20(0%) 20(0%) 145,360 86,528 
13 108,571 57,589(53%) 50,982(46%) 1,683 367,164 61,330 8,150(7%) 8,809(8%) 3,865,908 3,245,964 
14 10,305 586(5%) 9,719(94%) 145 14,044 819 82(0%) 110(1%) 120,872 112,660 
15 20,815 14,886(71%) 5,929(28%) 255 125,900 18,233 5,736(27%) 5,740(27%) 2,514,084 1,932,656 
16 766 172(22%) 594(77%) 14 376 202 123(16%) 123(16%) 12,488 9,428 
17 1,203 880(73%) 323(26%) 0 0 880 764(63%) 764(63%) 72,472 29,488 
total 2,475,740 342,324(13%) 2,133,416(86%) 19,577 15,492,144 542,914 204,713(8%) 205,849(8%) 31,377,740 21,267,560 
bAST1 210,000 38,000(18%) 172,000(81%) 0 0 47,000 38,000(18%) 38,000(18%) 820,000 536,000 
bAST2 179,000 47,000(26%) 132,000(73%) 4,000 24,000 49,002 41,000(22%) 41,000(22%) 992,012 668,000 
bAST3 428,550 103,830(24%) 324,720(75%) 2,670 28,200 110,370 87,570(20%) 87,570(20%) 2,329,080 1,774,560 
bN1 150 0(0%) 150(100%) 0 0 0 0(0%) 0(0%) 0 0 
bN2 180 150(83%) 30(16%) 60 9,000 154 120(66%) 120(66%) 11,280 4,920 
bN3 240 240(100%) 0(0%) 60 9,000 244 180(75%) 180(75%) 12,120 5,400 
bPP1 90,600 46,200(50%) 44,400(49%) 5,600 437,600 72,403 46,200(50%) 46,200(50%) 3,057,396 2,312,800 
bPP2 78,000 44,800(57%) 33,200(42%) 6,600 476,800 63,604 44,800(57%) 44,800(57%) 2,743,088 2,000,000 
bPP3 546,710 398,420(72%) 148,290(27%) 52,170 6,449,480 490,915 398,420(72%) 398,420(72%) 20,488,808 15,051,560 
bReg1 1,000 200(20%) 800(80%) 0 0 200 100(10%) 100(10%) 7,200 6,400 
bReg2 2,162,830 427,970(19%) 1,734,860(80%) 427,950 17,118,080 427,970 10(0%) 10(0%) 17,119,200 15,405,880 
bReg3 1,949,950 476,010(24%) 1,473,940(75%) 476,020 19,042,720 476,011 10(0%) 10(0%) 19,042,492 17,136,640 
bR1 400,011 7(0%) 400,004(99%) 46 2,631,600 38 0(0%) 3(0%) 5,243,040 1,023,116 
bR2 2,422 1,583(65%) 839(34%) 117 15,608 1,597 289(11%) 299(12%) 94,616 67,672 
bR3 78,145 53,259(68%) 24,886(31%) 4,872 699,036 58,872 13,365(17%) 13,454(17%) 6,375,736 5,390,736 
total 6,127,788 1,637,669(26%) 4,490,119(73%) 980,165 46,941,124 1,798,380 670,064(10%) 670,166(10%) 78,336,068 61,383,684 
Total 8,603,528 1,979,993(23%) 6,623,535(76%) 999,742 62,433,268 2,341,294 874,777(10%) 876,015(10%) 109,713,808 82,651,244 
Table 6: Lazy internal array creation + reuse of array + code refactoring 
-0.003% 
-0.001% 
-0.001% 
+0.0005% 
-0.0001% 
-0.03%
Conclusion 
Expandable collections are an important piece of the 
runtime 
3 optimizations 
Lazy array initialization 
Recycling arrays 
Refactoring applications
Conclusion 
reduced the number of created intermediary internal 
array storage by 73% 
reduced the number of allocated bytes by 67% 
reduced the number of unused bytes by 72% 
! 
Lazy array creation should be put in the main release

Mais conteúdo relacionado

Destaque

The Moldable Inspector
The Moldable InspectorThe Moldable Inspector
The Moldable InspectorESUG
 
A bytecode set for adaptive optimizations
A bytecode set for adaptive optimizationsA bytecode set for adaptive optimizations
A bytecode set for adaptive optimizationsESUG
 
Pharo Arm Status
Pharo Arm StatusPharo Arm Status
Pharo Arm StatusESUG
 
Beacon
BeaconBeacon
BeaconESUG
 
Lowcode: Redoing NativeBoost Portably
Lowcode: Redoing NativeBoost PortablyLowcode: Redoing NativeBoost Portably
Lowcode: Redoing NativeBoost PortablyESUG
 
Understanding Pharo’s global state
Understanding Pharo’s global stateUnderstanding Pharo’s global state
Understanding Pharo’s global stateESUG
 
ClockSystem: Embedding Time in Smalltalk
ClockSystem: Embedding Time in SmalltalkClockSystem: Embedding Time in Smalltalk
ClockSystem: Embedding Time in SmalltalkESUG
 
Toward a Methodology to turn Smalltak code into FPGA
Toward a Methodology to turn Smalltak code into FPGAToward a Methodology to turn Smalltak code into FPGA
Toward a Methodology to turn Smalltak code into FPGAESUG
 
SUnit: latest developments
SUnit: latest developmentsSUnit: latest developments
SUnit: latest developmentsESUG
 
Representing Code History with Development Environment Events
Representing Code History with Development Environment EventsRepresenting Code History with Development Environment Events
Representing Code History with Development Environment EventsESUG
 
First steps towards Self-Adaptive IDEs
First steps towards Self-Adaptive IDEsFirst steps towards Self-Adaptive IDEs
First steps towards Self-Adaptive IDEsESUG
 
Shoreline Bugs, the Smalltalk way
Shoreline Bugs, the Smalltalk wayShoreline Bugs, the Smalltalk way
Shoreline Bugs, the Smalltalk wayESUG
 
Advanced Seaside
Advanced SeasideAdvanced Seaside
Advanced SeasideESUG
 
Smalltalk Metaprogramming supports Probabilistic Program Analysis
Smalltalk Metaprogramming supports Probabilistic Program AnalysisSmalltalk Metaprogramming supports Probabilistic Program Analysis
Smalltalk Metaprogramming supports Probabilistic Program AnalysisESUG
 
Parcels
ParcelsParcels
ParcelsESUG
 
Of metacello, git, scripting and things
Of metacello, git, scripting and thingsOf metacello, git, scripting and things
Of metacello, git, scripting and thingsESUG
 
Painting with Roassal2
Painting with Roassal2Painting with Roassal2
Painting with Roassal2ESUG
 
The STEPS Project recap and more
The STEPS Project recap and moreThe STEPS Project recap and more
The STEPS Project recap and moreESUG
 
Towards cross-platfrom application development
Towards cross-platfrom application developmentTowards cross-platfrom application development
Towards cross-platfrom application developmentESUG
 
Scratching the itch, making Scratch for the Raspberry Pie
Scratching the itch, making Scratch for the Raspberry PieScratching the itch, making Scratch for the Raspberry Pie
Scratching the itch, making Scratch for the Raspberry PieESUG
 

Destaque (20)

The Moldable Inspector
The Moldable InspectorThe Moldable Inspector
The Moldable Inspector
 
A bytecode set for adaptive optimizations
A bytecode set for adaptive optimizationsA bytecode set for adaptive optimizations
A bytecode set for adaptive optimizations
 
Pharo Arm Status
Pharo Arm StatusPharo Arm Status
Pharo Arm Status
 
Beacon
BeaconBeacon
Beacon
 
Lowcode: Redoing NativeBoost Portably
Lowcode: Redoing NativeBoost PortablyLowcode: Redoing NativeBoost Portably
Lowcode: Redoing NativeBoost Portably
 
Understanding Pharo’s global state
Understanding Pharo’s global stateUnderstanding Pharo’s global state
Understanding Pharo’s global state
 
ClockSystem: Embedding Time in Smalltalk
ClockSystem: Embedding Time in SmalltalkClockSystem: Embedding Time in Smalltalk
ClockSystem: Embedding Time in Smalltalk
 
Toward a Methodology to turn Smalltak code into FPGA
Toward a Methodology to turn Smalltak code into FPGAToward a Methodology to turn Smalltak code into FPGA
Toward a Methodology to turn Smalltak code into FPGA
 
SUnit: latest developments
SUnit: latest developmentsSUnit: latest developments
SUnit: latest developments
 
Representing Code History with Development Environment Events
Representing Code History with Development Environment EventsRepresenting Code History with Development Environment Events
Representing Code History with Development Environment Events
 
First steps towards Self-Adaptive IDEs
First steps towards Self-Adaptive IDEsFirst steps towards Self-Adaptive IDEs
First steps towards Self-Adaptive IDEs
 
Shoreline Bugs, the Smalltalk way
Shoreline Bugs, the Smalltalk wayShoreline Bugs, the Smalltalk way
Shoreline Bugs, the Smalltalk way
 
Advanced Seaside
Advanced SeasideAdvanced Seaside
Advanced Seaside
 
Smalltalk Metaprogramming supports Probabilistic Program Analysis
Smalltalk Metaprogramming supports Probabilistic Program AnalysisSmalltalk Metaprogramming supports Probabilistic Program Analysis
Smalltalk Metaprogramming supports Probabilistic Program Analysis
 
Parcels
ParcelsParcels
Parcels
 
Of metacello, git, scripting and things
Of metacello, git, scripting and thingsOf metacello, git, scripting and things
Of metacello, git, scripting and things
 
Painting with Roassal2
Painting with Roassal2Painting with Roassal2
Painting with Roassal2
 
The STEPS Project recap and more
The STEPS Project recap and moreThe STEPS Project recap and more
The STEPS Project recap and more
 
Towards cross-platfrom application development
Towards cross-platfrom application developmentTowards cross-platfrom application development
Towards cross-platfrom application development
 
Scratching the itch, making Scratch for the Raspberry Pie
Scratching the itch, making Scratch for the Raspberry PieScratching the itch, making Scratch for the Raspberry Pie
Scratching the itch, making Scratch for the Raspberry Pie
 

Semelhante a Reducing Waste in Expandable Collections

111647298 heritage-dolls-case-study-analysis-calc
111647298 heritage-dolls-case-study-analysis-calc111647298 heritage-dolls-case-study-analysis-calc
111647298 heritage-dolls-case-study-analysis-calcFaheem Mukhtar
 
เทศบัญญัติงบประมาณรายจ่ายประจำปีงบประมาณ พ.ศ.2558
เทศบัญญัติงบประมาณรายจ่ายประจำปีงบประมาณ พ.ศ.2558เทศบัญญัติงบประมาณรายจ่ายประจำปีงบประมาณ พ.ศ.2558
เทศบัญญัติงบประมาณรายจ่ายประจำปีงบประมาณ พ.ศ.2558Kanjana thong
 
Avance de Crédito Infonavit al 08 julio 2012
Avance de Crédito Infonavit al 08 julio 2012Avance de Crédito Infonavit al 08 julio 2012
Avance de Crédito Infonavit al 08 julio 2012Sergio Velazco
 
Método de Mínimos Cuadrados (ejemplo)
Método de Mínimos Cuadrados (ejemplo)Método de Mínimos Cuadrados (ejemplo)
Método de Mínimos Cuadrados (ejemplo)José Luis Castro Soto
 
Avance crediticio al 22 julio 2012
Avance crediticio al 22 julio 2012Avance crediticio al 22 julio 2012
Avance crediticio al 22 julio 2012Sergio Velazco
 
Automated Trading Algorithm
Automated Trading AlgorithmAutomated Trading Algorithm
Automated Trading AlgorithmPiyush Chaudhry
 
Avance crediticio al 03 jun 12
Avance crediticio al 03 jun 12Avance crediticio al 03 jun 12
Avance crediticio al 03 jun 12Sergio Velazco
 
Lead carbon-gen-brochure-en-1411-final
Lead carbon-gen-brochure-en-1411-finalLead carbon-gen-brochure-en-1411-final
Lead carbon-gen-brochure-en-1411-finalNav Ahmed
 
Lead carbon-gen-brochure-en-1411-final
Lead carbon-gen-brochure-en-1411-finalLead carbon-gen-brochure-en-1411-final
Lead carbon-gen-brochure-en-1411-finalNaveed Ahmed
 
Indicateurs de performance
Indicateurs de performanceIndicateurs de performance
Indicateurs de performanceAbdelbari MAMIN
 
PBC-Series-Standard Range-Update
PBC-Series-Standard Range-UpdatePBC-Series-Standard Range-Update
PBC-Series-Standard Range-UpdateIgnatius Gunawan
 
Avance de Crédito Infonavit al 27 may 12
Avance de Crédito Infonavit al 27 may 12Avance de Crédito Infonavit al 27 may 12
Avance de Crédito Infonavit al 27 may 12Sergio Velazco
 
Balance de flotacion por el metodo computacional
Balance de flotacion por el metodo computacionalBalance de flotacion por el metodo computacional
Balance de flotacion por el metodo computacionalJavier Garcia Rodriguez
 
Gravity water supply design illustration using SW software
Gravity water supply design illustration using SW softwareGravity water supply design illustration using SW software
Gravity water supply design illustration using SW softwarePratap Bikram Shahi
 
WRI Operating Statement Detail
WRI Operating Statement DetailWRI Operating Statement Detail
WRI Operating Statement DetailScott Pickering
 

Semelhante a Reducing Waste in Expandable Collections (20)

111647298 heritage-dolls-case-study-analysis-calc
111647298 heritage-dolls-case-study-analysis-calc111647298 heritage-dolls-case-study-analysis-calc
111647298 heritage-dolls-case-study-analysis-calc
 
เทศบัญญัติงบประมาณรายจ่ายประจำปีงบประมาณ พ.ศ.2558
เทศบัญญัติงบประมาณรายจ่ายประจำปีงบประมาณ พ.ศ.2558เทศบัญญัติงบประมาณรายจ่ายประจำปีงบประมาณ พ.ศ.2558
เทศบัญญัติงบประมาณรายจ่ายประจำปีงบประมาณ พ.ศ.2558
 
Avance de Crédito Infonavit al 08 julio 2012
Avance de Crédito Infonavit al 08 julio 2012Avance de Crédito Infonavit al 08 julio 2012
Avance de Crédito Infonavit al 08 julio 2012
 
Active quotas spring2011
Active quotas spring2011Active quotas spring2011
Active quotas spring2011
 
Active duty quotas 2011
Active duty quotas 2011Active duty quotas 2011
Active duty quotas 2011
 
Método de Mínimos Cuadrados (ejemplo)
Método de Mínimos Cuadrados (ejemplo)Método de Mínimos Cuadrados (ejemplo)
Método de Mínimos Cuadrados (ejemplo)
 
Avance crediticio al 22 julio 2012
Avance crediticio al 22 julio 2012Avance crediticio al 22 julio 2012
Avance crediticio al 22 julio 2012
 
Automated Trading Algorithm
Automated Trading AlgorithmAutomated Trading Algorithm
Automated Trading Algorithm
 
Avance crediticio al 03 jun 12
Avance crediticio al 03 jun 12Avance crediticio al 03 jun 12
Avance crediticio al 03 jun 12
 
Lead carbon-gen-brochure-en-1411-final
Lead carbon-gen-brochure-en-1411-finalLead carbon-gen-brochure-en-1411-final
Lead carbon-gen-brochure-en-1411-final
 
Lead carbon-gen-brochure-en-1411-final
Lead carbon-gen-brochure-en-1411-finalLead carbon-gen-brochure-en-1411-final
Lead carbon-gen-brochure-en-1411-final
 
earnedvalue
earnedvalueearnedvalue
earnedvalue
 
Indicateurs de performance
Indicateurs de performanceIndicateurs de performance
Indicateurs de performance
 
PBC-Series-Standard Range-Update
PBC-Series-Standard Range-UpdatePBC-Series-Standard Range-Update
PBC-Series-Standard Range-Update
 
Avance de Crédito Infonavit al 27 may 12
Avance de Crédito Infonavit al 27 may 12Avance de Crédito Infonavit al 27 may 12
Avance de Crédito Infonavit al 27 may 12
 
Balance de flotacion por el metodo computacional
Balance de flotacion por el metodo computacionalBalance de flotacion por el metodo computacional
Balance de flotacion por el metodo computacional
 
Gravity water supply design illustration using SW software
Gravity water supply design illustration using SW softwareGravity water supply design illustration using SW software
Gravity water supply design illustration using SW software
 
WRI Operating Statement Detail
WRI Operating Statement DetailWRI Operating Statement Detail
WRI Operating Statement Detail
 
Meus exemplos
Meus exemplosMeus exemplos
Meus exemplos
 
12 v 200ah agm deep cycle(56.33kg)
12 v 200ah agm deep cycle(56.33kg)12 v 200ah agm deep cycle(56.33kg)
12 v 200ah agm deep cycle(56.33kg)
 

Mais de ESUG

Workshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programmingWorkshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programmingESUG
 
Technical documentation support in Pharo
Technical documentation support in PharoTechnical documentation support in Pharo
Technical documentation support in PharoESUG
 
The Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and RoadmapThe Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and RoadmapESUG
 
Sequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in PharoSequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in PharoESUG
 
Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...ESUG
 
Analyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early resultsAnalyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early resultsESUG
 
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6ESUG
 
A Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test GenerationA Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test GenerationESUG
 
Creating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic ProgrammingCreating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic ProgrammingESUG
 
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution ModesThreaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution ModesESUG
 
Exploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience ReportExploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience ReportESUG
 
Pharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIsPharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIsESUG
 
Garbage Collector Tuning
Garbage Collector TuningGarbage Collector Tuning
Garbage Collector TuningESUG
 
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame CaseImproving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame CaseESUG
 
Pharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and FuturePharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and FutureESUG
 
thisContext in the Debugger
thisContext in the DebuggerthisContext in the Debugger
thisContext in the DebuggerESUG
 
Websockets for Fencing Score
Websockets for Fencing ScoreWebsockets for Fencing Score
Websockets for Fencing ScoreESUG
 
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScriptShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScriptESUG
 
Advanced Object- Oriented Design Mooc
Advanced Object- Oriented Design MoocAdvanced Object- Oriented Design Mooc
Advanced Object- Oriented Design MoocESUG
 
A New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and TransformationsA New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and TransformationsESUG
 

Mais de ESUG (20)

Workshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programmingWorkshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programming
 
Technical documentation support in Pharo
Technical documentation support in PharoTechnical documentation support in Pharo
Technical documentation support in Pharo
 
The Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and RoadmapThe Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and Roadmap
 
Sequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in PharoSequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in Pharo
 
Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...
 
Analyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early resultsAnalyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early results
 
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
 
A Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test GenerationA Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test Generation
 
Creating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic ProgrammingCreating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic Programming
 
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution ModesThreaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
 
Exploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience ReportExploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience Report
 
Pharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIsPharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIs
 
Garbage Collector Tuning
Garbage Collector TuningGarbage Collector Tuning
Garbage Collector Tuning
 
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame CaseImproving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
 
Pharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and FuturePharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and Future
 
thisContext in the Debugger
thisContext in the DebuggerthisContext in the Debugger
thisContext in the Debugger
 
Websockets for Fencing Score
Websockets for Fencing ScoreWebsockets for Fencing Score
Websockets for Fencing Score
 
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScriptShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
 
Advanced Object- Oriented Design Mooc
Advanced Object- Oriented Design MoocAdvanced Object- Oriented Design Mooc
Advanced Object- Oriented Design Mooc
 
A New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and TransformationsA New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and Transformations
 

Último

introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfVishalKumarJha10
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnAmarnathKambale
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdfPearlKirahMaeRagusta1
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...kalichargn70th171
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesVictorSzoltysek
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionOnePlan Solutions
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfproinshot.com
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...software pro Development
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 

Último (20)

introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 

Reducing Waste in Expandable Collections

  • 1. Reducing Waste in Expandable Collections: The Pharo Case Alexandre Bergel, Alejandro Infante, Juan Pablo Sandoval Alcocer ! University of Chile
  • 2. c array! size = 0 c := OrderedCollection new.
  • 3. c array! size = 0 capacity = 10 c := OrderedCollection new.
  • 4. c array! size = 0 capacity = 10 c := OrderedCollection new.! 11 timesRepeat: [ c add: 42 ].
  • 5. c array! size = 1 42 capacity = 10 c := OrderedCollection new.! 11 timesRepeat: [ c add: 42 ].
  • 6. c array! size = 2 42 42 capacity = 10 c := new OrderedCollection.! 11 timesRepeat: [ c add: 42 ].
  • 7. c array! size = 3 42 42 42 capacity = 10 c := OrderedCollection new.! 11 timesRepeat: [ c add: 42 ].
  • 8. c array! size = 10 capacity = 10 42 42 42 42 42 42 42 42 42 42 c := OrderedCollection new.! 11 timesRepeat: [ c add: 42 ].
  • 9. c array! size = 10 capacity = 10 42 42 42 42 42 42 42 42 42 42 c := OrderedCollection new.! 11 timesRepeat: [ c add: 42 ].
  • 10. c array! size = 10 capacity = 10 42 42 42 42 42 42 42 42 42 42 42 c := OrderedCollection new.! 11 timesRepeat: [ c add: 42 ].
  • 11. c array! size = 10 capacity = 10 42 42 42 42 42 42 42 42 42 42 42 42 c := OrderedCollection new.! 11 timesRepeat: [ c add: 42 ].
  • 12. c array! size = 10 capacity = 10 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 c := OrderedCollection new.! 11 timesRepeat: [ c add: 42 ].
  • 13. c array! size = 11 capacity = 20 42 42 42 42 42 42 42 42 42 42 42 c := OrderedCollection new.! 11 timesRepeat: [ c add: 42 ].
  • 14. c := OrderedCollection new. [ 30000000 timesRepeat: [ c add: 42 ] ] timeToRun! => 3375 milliseconds!
  • 15. c := OrderedCollection new. [ 30000000 timesRepeat: [ c add: 42 ] ] timeToRun! => 3375 milliseconds! 22 expansions, 164 Mb copied
  • 16. c := OrderedCollection new. [ 30000000 timesRepeat: [ c add: 42 ] ] timeToRun! => 3375 milliseconds! 22 expansions, 164 Mb copied c := OrderedCollection new: 30000000. [ 30000000 timesRepeat: [ c add: 42 ] ] timeToRun! => 1356 milliseconds! 0 expansion, 0 Mb copied
  • 17. Our Paper Characterize the use of expandable collections ! Measure the overhead associated with expandable collections ! Reducing the overhead associated with expandable collections
  • 18. index Application LOC #Ref *1 AST 8,091 57 2 Arki 627 6 3 Glamour 17,525 105 4 GraphET 2,757 10 5 Magritte 5,884 29 6 Manifest 2,864 11 7 NECompletion 3,446 33 *8 Nautilus 1,566 9 *9 Petit 14,919 95 10 Refactoring 21,328 125 *11 Regex 5,055 16 12 Ring 3,378 50 *13 Roassal 19,844 133 14 RoelTyper 2,003 85 15 Shout 3,290 10 16 SmallDude 3,805 66 17 Spec 10,212 37 Table 2: Description of the benchmark (the #Ref column indicates the number of references to expandable collection in source code)
  • 19. bench. NC NNEC NEC NCE NCB NAC NOSM NSM NAB NUB 1 643,603 151,665(23%) 491,938(76%) 2,636 35,940 646,239 112,308(17%) 112,439(17%) 18,819,920 17,907,204 2 13 12(92%) 1(7%) 0 0 13 1(7%) 1(7%) 468 392 3 78,976 34,912(44%) 44,064(55%) 322 2,272 79,298 10,604(13%) 10,681(13%) 2,374,464 2,213,384 4 1,690 512(30%) 1,178(69%) 30 1,720 1,720 245(14%) 245(14%) 65,760 55,420 5 3,191 2,009(62%) 1,182(37%) 30 1,208 3,193 200(6%) 251(7%) 77,808 67,724 6 96 44(45%) 52(54%) 0 0 96 40(41%) 40(41%) 3,740 3,464 7 612 218(35%) 394(64%) 614 2,257,960 1,231 48(7%) 48(7%) 4,657,696 837,948 8 2 0(0%) 2(100%) 0 0 2 0(0%) 0(0%) 40 40 9 158,589 58,371(36%) 100,218(63%) 5,663 280,876 164,252 57,644(36%) 57,728(36%) 6,833,532 5,534,280 10 1,432,306 14,891(1%) 1,417,415(98%) 6,074 12,258,424 1,438,380 8,248(0%) 8,344(0%) 46,958,632 34,241,204 11 6,839 2,058(30%) 4,781(69%) 1,280 78,712 6,967 471(6%) 480(7%) 291,052 256,852 12 8,363 3,530(42%) 4,833(57%) 1,103 47,852 9,466 73(0%) 73(0%) 279,236 165,460 13 108,571 57,590(53%) 50,981(46%) 1,739 369,336 109,990 8,151(7%) 8,810(8%) 5,778,016 4,845,764 14 10,305 586(5%) 9,719(94%) 145 14,044 10,448 82(0%) 110(1%) 443,828 420,352 15 20,815 14,886(71%) 5,929(28%) 255 125,900 21,070 5,736(27%) 5,740(27%) 2,692,404 1,984,240 16 766 172(22%) 594(77%) 17 496 783 123(16%) 123(16%) 126,368 122,532 17 1,203 880(73%) 323(26%) 1,512 48,384 2,715 764(63%) 764(63%) 127,356 35,988 total 2,475,940 342,336(13%) 2,133,604(86%) 21,420 15,523,124 2,495,863 204,738(8%) 205,877(8%) 89,530,320 68,692,248 bAST1 210,000 38,000(18%) 172,000(81%) 0 0 210,000 38,000(18%) 38,000(18%) 6,752,000 6,468,000 bAST2 179,000 47,000(26%) 132,000(73%) 4,000 24,000 183,000 41,000(22%) 41,000(22%) 5,928,000 5,580,000 bAST3 428,550 103,830(24%) 324,720(75%) 2,670 28,200 431,220 87,570(20%) 87,570(20%) 13,795,440 13,212,720 bN1 150 0(0%) 150(100%) 0 0 150 0(0%) 0(0%) 3,000 3,000 bN2 180 150(83%) 30(16%) 60 9,000 240 120(66%) 120(66%) 22,440 7,680 bN3 240 240(100%) 0(0%) 60 9,000 300 180(75%) 180(75%) 22,680 7,560 bPP1 90,600 46,200(50%) 44,400(49%) 5,600 436,800 96,200 46,200(50%) 46,200(50%) 4,214,400 3,033,600 bPP2 78,000 44,800(57%) 33,200(42%) 6,600 476,800 84,600 44,800(57%) 44,800(57%) 3,790,400 2,571,200 bPP3 546,710 398,420(72%) 148,290(27%) 52,860 6,475,120 599,570 398,420(72%) 398,420(72%) 29,103,720 17,192,120 bReg1 1,000 200(20%) 800(80%) 0 0 1,000 100(10%) 100(10%) 34,400 33,600 bReg2 2,162,830 427,970(19%) 1,734,860(80%) 427,950 17,118,080 2,162,860 10(0%) 10(0%) 86,513,920 84,799,800 bReg3 1,949,950 476,010(24%) 1,473,940(75%) 476,020 19,042,680 1,950,010 10(0%) 10(0%) 78,001,720 76,093,720 bR1 400,011 7(0%) 400,004(99%) 46 2,631,600 400,055 0(0%) 3(0%) 17,263,480 13,023,236 bR2 2,530 1,583(62%) 947(37%) 117 15,608 2,642 289(11%) 299(11%) 141,056 99,404 bR3 79,456 53,259(67%) 26,197(32%) 4,809 686,196 84,073 13,365(16%) 13,454(16%) 7,701,916 6,045,808 total 6,129,207 1,637,669(26%) 4,491,538(73%) 980,792 46,953,084 6,205,920 670,064(10%) 670,166(10%) 253,288,572 228,171,448 Total 8,605,147 1,980,005(23%) 6,625,142(76%) 1,002,212 62,476,208 8,701,783 874,802(10%) 876,043(10%) 342,818,892 296,863,696 Table 3: Original benchmark (baseline for all the other measurements)
  • 20. Lazy Array creation c array! size = 0 nil c := OrderedCollection new.
  • 21. Lazy Array creation c array! size = 0 42 c := OrderedCollection new.! c add: 42
  • 22. bench. NC NNEC NEC NCE NCB NAC NOSM NSM NAB NUB 1 643,603 151,665(23%) 491,938(76%) 2,636 35,940 229,379 112,308(17%) 112,439(17%) 3,956,792 3,044,076 2 13 12(92%) 1(7%) 0 0 13 1(7%) 1(7%) 468 392 3 79,035 34,970(44%) 44,065(55%) 45 2,272 44,294 10,612(13%) 10,689(13%) 1,397,668 1,236,260 4 1,690 512(30%) 1,178(69%) 30 1,720 905 245(14%) 245(14%) 33,160 22,820 5 3,551 2,009(56%) 1,542(43%) 30 1,208 2,685 200(5%) 251(7%) 65,208 55,124 6 96 44(45%) 52(54%) 0 0 91 40(41%) 40(41%) 3,560 3,284 7 644 218(33%) 426(66%) 614 2,257,960 927 48(7%) 48(7%) 4,509,216 689,468 8 2 0(0%) 2(100%) 0 0 0 0(0%) 0(0%) 0 0 9 158,395 58,331(36%) 100,064(63%) 5,663 280,876 123,703 57,637(36%) 57,718(36%) 5,220,152 3,921,204 10 1,432,306 14,891(1%) 1,417,415(98%) 6,074 12,258,424 68,132 8,248(0%) 8,344(0%) 19,547,672 6,830,248 11 6,839 2,058(30%) 4,781(69%) 1,280 78,712 2,186 471(6%) 480(7%) 109,212 75,012 12 7,870 3,472(44%) 4,398(55%) 1,094 44,384 5,253 20(0%) 20(0%) 194,732 84,716 13 108,571 57,590(53%) 50,981(46%) 1,739 369,336 62,510 8,151(7%) 8,810(8%) 4,218,656 3,286,404 14 10,305 586(5%) 9,719(94%) 145 14,044 963 82(0%) 110(1%) 136,008 112,532 15 20,815 14,886(71%) 5,929(28%) 255 125,900 18,489 5,736(27%) 5,740(27%) 2,640,784 1,932,632 16 766 172(22%) 594(77%) 17 496 221 123(16%) 123(16%) 14,288 10,452 17 1,203 880(73%) 323(26%) 1,512 48,384 2,392 764(63%) 764(63%) 120,856 29,488 total 2,475,704 342,296(13%) 2,133,408(86%) 21,134 15,519,656 562,143 204,686(8%) 205,822(8%) 42,168,432 21,334,112 bAST1 210,000 38,000(18%) 172,000(81%) 0 0 47,000 38,000(18%) 38,000(18%) 820,000 536,000 bAST2 179,000 47,000(26%) 132,000(73%) 4,000 24,000 53,000 41,000(22%) 41,000(22%) 1,016,000 668,000 bAST3 428,550 103,830(24%) 324,720(75%) 2,670 28,200 113,040 87,570(20%) 87,570(20%) 2,389,680 1,806,960 bN1 150 0(0%) 150(100%) 0 0 0 0(0%) 0(0%) 0 0 bN2 180 150(83%) 30(16%) 60 9,000 210 120(66%) 120(66%) 21,840 7,080 bN3 240 240(100%) 0(0%) 60 9,000 300 180(75%) 180(75%) 22,680 7,560 bPP1 90,600 46,200(50%) 44,400(49%) 5,600 436,800 78,000 46,200(50%) 46,200(50%) 3,490,400 2,309,600 bPP2 78,000 44,800(57%) 33,200(42%) 6,600 476,800 70,200 44,800(57%) 44,800(57%) 3,218,400 1,999,200 bPP3 546,710 398,420(72%) 148,290(27%) 52,860 6,475,120 543,770 398,420(72%) 398,420(72%) 26,952,320 15,040,720 bReg1 1,000 200(20%) 800(80%) 0 0 200 100(10%) 100(10%) 7,200 6,400 bReg2 2,162,830 427,970(19%) 1,734,860(80%) 427,950 17,118,080 428,000 10(0%) 10(0%) 17,120,000 15,405,880 bReg3 1,949,950 476,010(24%) 1,473,940(75%) 476,020 19,042,680 476,070 10(0%) 10(0%) 19,044,600 17,136,600 bR1 400,011 7(0%) 400,004(99%) 46 2,631,600 52 0(0%) 3(0%) 5,263,360 1,223,116 bR2 2,422 1,583(65%) 839(34%) 117 15,608 1,698 289(11%) 299(12%) 109,356 67,704 bR3 78,145 53,259(68%) 24,886(31%) 4,809 686,196 63,400 13,365(17%) 13,454(17%) 7,034,296 5,378,188 total 6,127,788 1,637,669(26%) 4,490,119(73%) 980,792 46,953,084 1,874,940 670,064(10%) 670,166(10%) 86,510,132 61,393,008 Total 8,603,492 1,979,965(23%) 6,623,527(76%) 1,001,926 62,472,740 2,437,083 874,750(10%) 875,988(10%) 128,678,564 82,727,120 Table 4: Lazy internal array creation
  • 23. bench. NC NNEC NEC NCE NCB NAC NOSM NSM NAB NUB 1 643,603 151,665(23%) 491,938(76%) 2,636 35,940 229,379 112,308(17%) 112,439(17%) 3,956,792 3,044,076 2 13 12(92%) 1(7%) 0 0 13 1(7%) 1(7%) 468 392 3 79,035 34,970(44%) 44,065(55%) 45 2,272 44,294 10,612(13%) 10,689(13%) 1,397,668 1,236,260 4 1,690 512(30%) 1,178(69%) 30 1,720 905 245(14%) 245(14%) 33,160 22,820 5 3,551 2,009(56%) 1,542(43%) 30 1,208 2,685 200(5%) 251(7%) 65,208 55,124 6 96 44(45%) 52(54%) 0 0 91 40(41%) 40(41%) 3,560 3,284 7 644 218(33%) 426(66%) 614 2,257,960 927 48(7%) 48(7%) 4,509,216 689,468 8 2 0(0%) 2(100%) 0 0 0 0(0%) 0(0%) 0 0 9 158,395 58,331(36%) 100,064(63%) 5,663 280,876 123,703 57,637(36%) 57,718(36%) 5,220,152 3,921,204 10 1,432,306 14,891(1%) 1,417,415(98%) 6,074 12,258,424 68,132 8,248(0%) 8,344(0%) 19,547,672 6,830,248 11 6,839 2,058(30%) 4,781(69%) 1,280 78,712 2,186 471(6%) 480(7%) 109,212 75,012 12 7,870 3,472(44%) 4,398(55%) 1,094 44,384 5,253 20(0%) 20(0%) 194,732 84,716 13 108,571 57,590(53%) 50,981(46%) 1,739 369,336 62,510 8,151(7%) 8,810(8%) 4,218,656 3,286,404 14 10,305 586(5%) 9,719(94%) 145 14,044 963 82(0%) 110(1%) 136,008 112,532 15 20,815 14,886(71%) 5,929(28%) 255 125,900 18,489 5,736(27%) 5,740(27%) 2,640,784 1,932,632 16 766 172(22%) 594(77%) 17 496 221 123(16%) 123(16%) 14,288 10,452 17 1,203 880(73%) 323(26%) 1,512 48,384 2,392 764(63%) 764(63%) 120,856 29,488 total 2,475,704 342,296(13%) 2,133,408(86%) 21,134 15,519,656 562,143 204,686(8%) 205,822(8%) 42,168,432 21,334,112 bAST1 210,000 38,000(18%) 172,000(81%) 0 0 47,000 38,000(18%) 38,000(18%) 820,000 536,000 bAST2 179,000 47,000(26%) 132,000(73%) 4,000 24,000 53,000 41,000(22%) 41,000(22%) 1,016,000 668,000 bAST3 428,550 103,830(24%) 324,720(75%) 2,670 28,200 113,040 87,570(20%) 87,570(20%) 2,389,680 1,806,960 bN1 150 0(0%) 150(100%) 0 0 0 0(0%) 0(0%) 0 0 bN2 180 150(83%) 30(16%) 60 9,000 210 120(66%) 120(66%) 21,840 7,080 bN3 240 240(100%) 0(0%) 60 9,000 300 180(75%) 180(75%) 22,680 7,560 bPP1 90,600 46,200(50%) 44,400(49%) 5,600 436,800 78,000 46,200(50%) 46,200(50%) 3,490,400 2,309,600 bPP2 78,000 44,800(57%) 33,200(42%) 6,600 476,800 70,200 44,800(57%) 44,800(57%) 3,218,400 1,999,200 bPP3 546,710 398,420(72%) 148,290(27%) 52,860 6,475,120 543,770 398,420(72%) 398,420(72%) 26,952,320 15,040,720 bReg1 1,000 200(20%) 800(80%) 0 0 200 100(10%) 100(10%) 7,200 6,400 bReg2 2,162,830 427,970(19%) 1,734,860(80%) 427,950 17,118,080 428,000 10(0%) 10(0%) 17,120,000 15,405,880 bReg3 1,949,950 476,010(24%) 1,473,940(75%) 476,020 19,042,680 476,070 10(0%) 10(0%) 19,044,600 17,136,600 bR1 400,011 7(0%) 400,004(99%) 46 2,631,600 52 0(0%) 3(0%) 5,263,360 1,223,116 bR2 2,422 1,583(65%) 839(34%) 117 15,608 1,698 289(11%) 299(12%) 109,356 67,704 bR3 78,145 53,259(68%) 24,886(31%) 4,809 686,196 63,400 13,365(17%) 13,454(17%) 7,034,296 5,378,188 total 6,127,788 1,637,669(26%) 4,490,119(73%) 980,792 46,953,084 1,874,940 670,064(10%) 670,166(10%) 86,510,132 61,393,008 Total 8,603,492 1,979,965(23%) 6,623,527(76%) 1,001,926 62,472,740 2,437,083 874,750(10%) 875,988(10%) 128,678,564 82,727,120 Table 4: Lazy internal array creation -69% -73% -72% -77% -70% -73%
  • 24. When adding the 11th element c array! size = 10 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 c := OrderedCollection new.! 11 timesRepeat: [ c add: 42 ].
  • 25. When adding the 11th element c array! size = 10 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 c := OrderedCollection new.! 11 timesRepeat: [ c add: 42 ].
  • 26. Recycling the array … 42 42 42 42 42 42 42 42 42 42
  • 28. Inserting the array in a pool Global Pool
  • 29. Inserting the array in a pool Global Pool OrderedCollection new
  • 30. bench. NC NNEC NEC NCE NCB NAC NOSM NSM NAB NUB 1 643,603 151,665(23%) 491,938(76%) 2,636 35,940 226,736 112,308(17%) 112,439(17%) 3,921,136 3,044,076 2 13 12(92%) 1(7%) 0 0 13 1(7%) 1(7%) 468 392 3 78,977 34,912(44%) 44,065(55%) 45 2,272 44,193 10,604(13%) 10,681(13%) 1,393,396 1,234,432 4 1,690 512(30%) 1,178(69%) 30 1,720 873 245(14%) 245(14%) 31,200 22,820 5 3,551 2,009(56%) 1,542(43%) 30 1,208 2,683 200(5%) 251(7%) 65,168 55,124 6 96 44(45%) 52(54%) 0 0 91 40(41%) 40(41%) 3,560 3,284 7 644 218(33%) 426(66%) 614 2,257,960 235 48(7%) 48(7%) 2,372,616 689,468 8 2 0(0%) 2(100%) 0 0 0 0(0%) 0(0%) 0 0 9 158,399 58,333(36%) 100,066(63%) 5,663 280,876 118,044 57,639(36%) 57,720(36%) 4,938,224 3,921,356 10 1,432,306 14,891(1%) 1,417,415(98%) 6,074 12,258,424 62,065 8,248(0%) 8,344(0%) 11,877,480 6,830,244 11 6,839 2,058(30%) 4,781(69%) 1,280 78,712 2,056 471(6%) 480(7%) 91,804 75,012 12 7,870 3,472(44%) 4,398(55%) 1,094 44,384 4,163 20(0%) 20(0%) 144,144 84,716 13 108,571 57,590(53%) 50,981(46%) 1,739 369,336 61,326 8,151(7%) 8,810(8%) 3,907,184 3,286,404 14 10,305 586(5%) 9,719(94%) 145 14,044 817 82(0%) 110(1%) 119,512 112,532 15 20,815 14,886(71%) 5,929(28%) 255 125,900 18,233 5,736(27%) 5,740(27%) 2,514,840 1,932,620 16 766 172(22%) 594(77%) 17 496 203 123(16%) 123(16%) 13,700 10,452 17 1,203 880(73%) 323(26%) 1,512 48,384 882 764(63%) 764(63%) 72,536 29,488 total 2,475,650 342,240(13%) 2,133,410(86%) 21,134 15,519,656 542,613 204,680(8%) 205,816(8%) 31,466,968 21,332,420 bAST1 210,000 38,000(18%) 172,000(81%) 0 0 47,000 38,000(18%) 38,000(18%) 820,000 536,000 bAST2 179,000 47,000(26%) 132,000(73%) 4,000 24,000 49,002 41,000(22%) 41,000(22%) 992,012 668,000 bAST3 428,550 103,830(24%) 324,720(75%) 2,670 28,200 110,370 87,570(20%) 87,570(20%) 2,361,480 1,806,960 bN1 150 0(0%) 150(100%) 0 0 0 0(0%) 0(0%) 0 0 bN2 180 150(83%) 30(16%) 60 9,000 153 120(66%) 120(66%) 13,400 7,080 bN3 240 240(100%) 0(0%) 60 9,000 243 180(75%) 180(75%) 14,240 7,560 bPP1 91,000 46,400(50%) 44,600(49%) 5,600 437,600 72,603 46,400(50%) 46,400(50%) 3,058,196 2,312,800 bPP2 78,000 44,800(57%) 33,200(42%) 6,600 476,800 63,604 44,800(57%) 44,800(57%) 2,743,088 2,000,000 bPP3 546,710 398,420(72%) 148,290(27%) 52,170 6,449,480 490,915 398,420(72%) 398,420(72%) 20,488,808 15,051,560 bReg1 1,000 200(20%) 800(80%) 0 0 200 100(10%) 100(10%) 7,200 6,400 bReg2 2,162,830 427,970(19%) 1,734,860(80%) 427,950 17,118,080 427,970 10(0%) 10(0%) 17,119,200 15,405,880 bReg3 1,949,950 476,010(24%) 1,473,940(75%) 476,020 19,042,720 476,011 10(0%) 10(0%) 19,042,492 17,136,640 bR1 400,011 7(0%) 400,004(99%) 46 2,631,600 38 0(0%) 3(0%) 5,243,040 1,023,116 bR2 2,422 1,583(65%) 839(34%) 117 15,608 1,597 289(11%) 299(12%) 94,656 67,712 bR3 78,145 53,259(68%) 24,886(31%) 4,872 699,036 58,872 13,365(17%) 13,454(17%) 6,375,776 5,390,776 total 6,128,188 1,637,869(26%) 4,490,319(73%) 980,165 46,941,124 1,798,578 670,264(10%) 670,366(10%) 78,373,588 61,420,484 Total 8,603,838 1,980,109(13%) 6,623,729(86%) 1,001,299 62,460,780 2,341,191 874,944(8%) 876,182(8%) 109,840,556 82,752,904 Table 5: Lazy internal array creation + reuse of array
  • 31. bench. NC NNEC NEC NCE NCB NAC NOSM NSM NAB NUB 1 643,603 151,665(23%) 491,938(76%) 2,636 35,940 226,736 112,308(17%) 112,439(17%) 3,921,136 3,044,076 2 13 12(92%) 1(7%) 0 0 13 1(7%) 1(7%) 468 392 3 78,977 34,912(44%) 44,065(55%) 45 2,272 44,193 10,604(13%) 10,681(13%) 1,393,396 1,234,432 4 1,690 512(30%) 1,178(69%) 30 1,720 873 245(14%) 245(14%) 31,200 22,820 5 3,551 2,009(56%) 1,542(43%) 30 1,208 2,683 200(5%) 251(7%) 65,168 55,124 6 96 44(45%) 52(54%) 0 0 91 40(41%) 40(41%) 3,560 3,284 7 644 218(33%) 426(66%) 614 2,257,960 235 48(7%) 48(7%) 2,372,616 689,468 8 2 0(0%) 2(100%) 0 0 0 0(0%) 0(0%) 0 0 9 158,399 58,333(36%) 100,066(63%) 5,663 280,876 118,044 57,639(36%) 57,720(36%) 4,938,224 3,921,356 10 1,432,306 14,891(1%) 1,417,415(98%) 6,074 12,258,424 62,065 8,248(0%) 8,344(0%) 11,877,480 6,830,244 11 6,839 2,058(30%) 4,781(69%) 1,280 78,712 2,056 471(6%) 480(7%) 91,804 75,012 12 7,870 3,472(44%) 4,398(55%) 1,094 44,384 4,163 20(0%) 20(0%) 144,144 84,716 13 108,571 57,590(53%) 50,981(46%) 1,739 369,336 61,326 8,151(7%) 8,810(8%) 3,907,184 3,286,404 14 10,305 586(5%) 9,719(94%) 145 14,044 817 82(0%) 110(1%) 119,512 112,532 15 20,815 14,886(71%) 5,929(28%) 255 125,900 18,233 5,736(27%) 5,740(27%) 2,514,840 1,932,620 16 766 172(22%) 594(77%) 17 496 203 123(16%) 123(16%) 13,700 10,452 17 1,203 880(73%) 323(26%) 1,512 48,384 882 764(63%) 764(63%) 72,536 29,488 total 2,475,650 342,240(13%) 2,133,410(86%) 21,134 15,519,656 542,613 204,680(8%) 205,816(8%) 31,466,968 21,332,420 bAST1 210,000 38,000(18%) 172,000(81%) 0 0 47,000 38,000(18%) 38,000(18%) 820,000 536,000 bAST2 179,000 47,000(26%) 132,000(73%) 4,000 24,000 49,002 41,000(22%) 41,000(22%) 992,012 668,000 bAST3 428,550 103,830(24%) 324,720(75%) 2,670 28,200 110,370 87,570(20%) 87,570(20%) 2,361,480 1,806,960 bN1 150 0(0%) 150(100%) 0 0 0 0(0%) 0(0%) 0 0 bN2 180 150(83%) 30(16%) 60 9,000 153 120(66%) 120(66%) 13,400 7,080 bN3 240 240(100%) 0(0%) 60 9,000 243 180(75%) 180(75%) 14,240 7,560 bPP1 91,000 46,400(50%) 44,600(49%) 5,600 437,600 72,603 46,400(50%) 46,400(50%) 3,058,196 2,312,800 bPP2 78,000 44,800(57%) 33,200(42%) 6,600 476,800 63,604 44,800(57%) 44,800(57%) 2,743,088 2,000,000 bPP3 546,710 398,420(72%) 148,290(27%) 52,170 6,449,480 490,915 398,420(72%) 398,420(72%) 20,488,808 15,051,560 bReg1 1,000 200(20%) 800(80%) 0 0 200 100(10%) 100(10%) 7,200 6,400 bReg2 2,162,830 427,970(19%) 1,734,860(80%) 427,950 17,118,080 427,970 10(0%) 10(0%) 17,119,200 15,405,880 bReg3 1,949,950 476,010(24%) 1,473,940(75%) 476,020 19,042,720 476,011 10(0%) 10(0%) 19,042,492 17,136,640 bR1 400,011 7(0%) 400,004(99%) 46 2,631,600 38 0(0%) 3(0%) 5,243,040 1,023,116 bR2 2,422 1,583(65%) 839(34%) 117 15,608 1,597 289(11%) 299(12%) 94,656 67,712 bR3 78,145 53,259(68%) 24,886(31%) 4,872 699,036 58,872 13,365(17%) 13,454(17%) 6,375,776 5,390,776 total 6,128,188 1,637,869(26%) 4,490,319(73%) 980,165 46,941,124 1,798,578 670,264(10%) 670,366(10%) 78,373,588 61,420,484 Total 8,603,838 1,980,109(13%) 6,623,729(86%) 1,001,299 62,460,780 2,341,191 874,944(8%) 876,182(8%) 109,840,556 82,752,904 Table 5: Lazy internal array creation + reuse of array -0.0005% +0.0004% 0% -0.03% -0.04% -0.00003%
  • 32. ROView>>elementsToRender! | answer | answer := OrderedCollection new.! self elementsToRenderDo: ! [ :el | answer add: el ]. ! ˆ answer! ROView>>elementsToRender! | answer | answer := OrderedCollection new: ! (self elements size).! ! self elementsToRenderDo: ! [ :el | answer add: el ]. ! ˆ answer!
  • 33. bench. NC NNEC NEC NCE NCB NAC NOSM NSM NAB NUB 1 643,626 151,687(23%) 491,939(76%) 2,648 35,956 226,964 112,329(17%) 112,460(17%) 3,906,608 3,029,456 2 13 12(92%) 1(7%) 0 0 13 1(7%) 1(7%) 468 392 3 79,043 34,974(44%) 44,069(55%) 65 2,108 44,259 10,616(13%) 10,693(13%) 1,384,428 1,225,288 4 1,691 513(30%) 1,178(69%) 30 1,760 874 246(14%) 246(14%) 30,952 22,532 5 3,551 2,009(56%) 1,542(43%) 28 1,120 2,683 200(5%) 251(7%) 65,352 55,308 6 96 44(45%) 52(54%) 0 0 91 40(41%) 40(41%) 3,560 3,284 7 644 218(33%) 426(66%) 614 2,257,960 235 48(7%) 48(7%) 2,372,608 689,492 8 2 0(0%) 2(100%) 0 0 0 0(0%) 0(0%) 0 0 9 158,399 58,333(36%) 100,066(63%) 5,651 280,636 118,043 57,639(36%) 57,720(36%) 4,938,340 3,921,516 10 1,432,306 14,891(1%) 1,417,415(98%) 6,069 12,280,124 62,070 8,248(0%) 8,344(0%) 11,852,428 6,828,504 11 6,839 2,058(30%) 4,781(69%) 1,280 78,760 2,055 471(6%) 480(7%) 91,812 75,064 12 7,870 3,472(44%) 4,398(55%) 1,095 46,236 4,163 20(0%) 20(0%) 145,360 86,528 13 108,571 57,589(53%) 50,982(46%) 1,683 367,164 61,330 8,150(7%) 8,809(8%) 3,865,908 3,245,964 14 10,305 586(5%) 9,719(94%) 145 14,044 819 82(0%) 110(1%) 120,872 112,660 15 20,815 14,886(71%) 5,929(28%) 255 125,900 18,233 5,736(27%) 5,740(27%) 2,514,084 1,932,656 16 766 172(22%) 594(77%) 14 376 202 123(16%) 123(16%) 12,488 9,428 17 1,203 880(73%) 323(26%) 0 0 880 764(63%) 764(63%) 72,472 29,488 total 2,475,740 342,324(13%) 2,133,416(86%) 19,577 15,492,144 542,914 204,713(8%) 205,849(8%) 31,377,740 21,267,560 bAST1 210,000 38,000(18%) 172,000(81%) 0 0 47,000 38,000(18%) 38,000(18%) 820,000 536,000 bAST2 179,000 47,000(26%) 132,000(73%) 4,000 24,000 49,002 41,000(22%) 41,000(22%) 992,012 668,000 bAST3 428,550 103,830(24%) 324,720(75%) 2,670 28,200 110,370 87,570(20%) 87,570(20%) 2,329,080 1,774,560 bN1 150 0(0%) 150(100%) 0 0 0 0(0%) 0(0%) 0 0 bN2 180 150(83%) 30(16%) 60 9,000 154 120(66%) 120(66%) 11,280 4,920 bN3 240 240(100%) 0(0%) 60 9,000 244 180(75%) 180(75%) 12,120 5,400 bPP1 90,600 46,200(50%) 44,400(49%) 5,600 437,600 72,403 46,200(50%) 46,200(50%) 3,057,396 2,312,800 bPP2 78,000 44,800(57%) 33,200(42%) 6,600 476,800 63,604 44,800(57%) 44,800(57%) 2,743,088 2,000,000 bPP3 546,710 398,420(72%) 148,290(27%) 52,170 6,449,480 490,915 398,420(72%) 398,420(72%) 20,488,808 15,051,560 bReg1 1,000 200(20%) 800(80%) 0 0 200 100(10%) 100(10%) 7,200 6,400 bReg2 2,162,830 427,970(19%) 1,734,860(80%) 427,950 17,118,080 427,970 10(0%) 10(0%) 17,119,200 15,405,880 bReg3 1,949,950 476,010(24%) 1,473,940(75%) 476,020 19,042,720 476,011 10(0%) 10(0%) 19,042,492 17,136,640 bR1 400,011 7(0%) 400,004(99%) 46 2,631,600 38 0(0%) 3(0%) 5,243,040 1,023,116 bR2 2,422 1,583(65%) 839(34%) 117 15,608 1,597 289(11%) 299(12%) 94,616 67,672 bR3 78,145 53,259(68%) 24,886(31%) 4,872 699,036 58,872 13,365(17%) 13,454(17%) 6,375,736 5,390,736 total 6,127,788 1,637,669(26%) 4,490,119(73%) 980,165 46,941,124 1,798,380 670,064(10%) 670,166(10%) 78,336,068 61,383,684 Total 8,603,528 1,979,993(23%) 6,623,535(76%) 999,742 62,433,268 2,341,294 874,777(10%) 876,015(10%) 109,713,808 82,651,244 Table 6: Lazy internal array creation + reuse of array + code refactoring
  • 34. bench. NC NNEC NEC NCE NCB NAC NOSM NSM NAB NUB 1 643,626 151,687(23%) 491,939(76%) 2,648 35,956 226,964 112,329(17%) 112,460(17%) 3,906,608 3,029,456 2 13 12(92%) 1(7%) 0 0 13 1(7%) 1(7%) 468 392 3 79,043 34,974(44%) 44,069(55%) 65 2,108 44,259 10,616(13%) 10,693(13%) 1,384,428 1,225,288 4 1,691 513(30%) 1,178(69%) 30 1,760 874 246(14%) 246(14%) 30,952 22,532 5 3,551 2,009(56%) 1,542(43%) 28 1,120 2,683 200(5%) 251(7%) 65,352 55,308 6 96 44(45%) 52(54%) 0 0 91 40(41%) 40(41%) 3,560 3,284 7 644 218(33%) 426(66%) 614 2,257,960 235 48(7%) 48(7%) 2,372,608 689,492 8 2 0(0%) 2(100%) 0 0 0 0(0%) 0(0%) 0 0 9 158,399 58,333(36%) 100,066(63%) 5,651 280,636 118,043 57,639(36%) 57,720(36%) 4,938,340 3,921,516 10 1,432,306 14,891(1%) 1,417,415(98%) 6,069 12,280,124 62,070 8,248(0%) 8,344(0%) 11,852,428 6,828,504 11 6,839 2,058(30%) 4,781(69%) 1,280 78,760 2,055 471(6%) 480(7%) 91,812 75,064 12 7,870 3,472(44%) 4,398(55%) 1,095 46,236 4,163 20(0%) 20(0%) 145,360 86,528 13 108,571 57,589(53%) 50,982(46%) 1,683 367,164 61,330 8,150(7%) 8,809(8%) 3,865,908 3,245,964 14 10,305 586(5%) 9,719(94%) 145 14,044 819 82(0%) 110(1%) 120,872 112,660 15 20,815 14,886(71%) 5,929(28%) 255 125,900 18,233 5,736(27%) 5,740(27%) 2,514,084 1,932,656 16 766 172(22%) 594(77%) 14 376 202 123(16%) 123(16%) 12,488 9,428 17 1,203 880(73%) 323(26%) 0 0 880 764(63%) 764(63%) 72,472 29,488 total 2,475,740 342,324(13%) 2,133,416(86%) 19,577 15,492,144 542,914 204,713(8%) 205,849(8%) 31,377,740 21,267,560 bAST1 210,000 38,000(18%) 172,000(81%) 0 0 47,000 38,000(18%) 38,000(18%) 820,000 536,000 bAST2 179,000 47,000(26%) 132,000(73%) 4,000 24,000 49,002 41,000(22%) 41,000(22%) 992,012 668,000 bAST3 428,550 103,830(24%) 324,720(75%) 2,670 28,200 110,370 87,570(20%) 87,570(20%) 2,329,080 1,774,560 bN1 150 0(0%) 150(100%) 0 0 0 0(0%) 0(0%) 0 0 bN2 180 150(83%) 30(16%) 60 9,000 154 120(66%) 120(66%) 11,280 4,920 bN3 240 240(100%) 0(0%) 60 9,000 244 180(75%) 180(75%) 12,120 5,400 bPP1 90,600 46,200(50%) 44,400(49%) 5,600 437,600 72,403 46,200(50%) 46,200(50%) 3,057,396 2,312,800 bPP2 78,000 44,800(57%) 33,200(42%) 6,600 476,800 63,604 44,800(57%) 44,800(57%) 2,743,088 2,000,000 bPP3 546,710 398,420(72%) 148,290(27%) 52,170 6,449,480 490,915 398,420(72%) 398,420(72%) 20,488,808 15,051,560 bReg1 1,000 200(20%) 800(80%) 0 0 200 100(10%) 100(10%) 7,200 6,400 bReg2 2,162,830 427,970(19%) 1,734,860(80%) 427,950 17,118,080 427,970 10(0%) 10(0%) 17,119,200 15,405,880 bReg3 1,949,950 476,010(24%) 1,473,940(75%) 476,020 19,042,720 476,011 10(0%) 10(0%) 19,042,492 17,136,640 bR1 400,011 7(0%) 400,004(99%) 46 2,631,600 38 0(0%) 3(0%) 5,243,040 1,023,116 bR2 2,422 1,583(65%) 839(34%) 117 15,608 1,597 289(11%) 299(12%) 94,616 67,672 bR3 78,145 53,259(68%) 24,886(31%) 4,872 699,036 58,872 13,365(17%) 13,454(17%) 6,375,736 5,390,736 total 6,127,788 1,637,669(26%) 4,490,119(73%) 980,165 46,941,124 1,798,380 670,064(10%) 670,166(10%) 78,336,068 61,383,684 Total 8,603,528 1,979,993(23%) 6,623,535(76%) 999,742 62,433,268 2,341,294 874,777(10%) 876,015(10%) 109,713,808 82,651,244 Table 6: Lazy internal array creation + reuse of array + code refactoring -0.003% -0.001% -0.001% +0.0005% -0.0001% -0.03%
  • 35. Conclusion Expandable collections are an important piece of the runtime 3 optimizations Lazy array initialization Recycling arrays Refactoring applications
  • 36. Conclusion reduced the number of created intermediary internal array storage by 73% reduced the number of allocated bytes by 67% reduced the number of unused bytes by 72% ! Lazy array creation should be put in the main release