본문 바로가기

Work

[Python] List에는 최대 몇 개의 요소를 넣을 수 있을까?

# max size of list with incremental integers: 59,635,723
# max size of list with constant value '0': 120,898,753
# max size of list with appending copied sub-lists filled with '0': 462,200,000 (= 4622 * 100000)
# max size of list with extending copied sub-lists filled with '0': 166,200,000 (= 1662 * 100000)
# max size of list with extending copied sub-lists filled with '0': 123,460,000 (= 12346 * 10000)
# max size of list with extending copied sub-lists filled with '0': 135,000,000 (= 135 * 1000000)
# max size of list with extending copied sub-lists filled with '0': 163,400,000 (= 817 * 200000)

val_list_temp = [0 for i in range(1, 200000)]
for n in range(0, 100000):
    print("n = ", n)
    val_list += val_list_temp
exit("Successfully finished with no overflow. list len = %d" % len(val_list))

 

시험 삼아 몇 조건을 돌려봤지만 어떤 선형관계가 나올 것처럼 보이진 않는다. (사실 위 숫자들도 정확한 건 아님. loop 숫자에 sub loop 크기를 곱한 것이라...)

 

'Work' 카테고리의 다른 글

모르고 배운 자의 최후  (0) 2020.03.06
목표 요건  (0) 2020.02.21
Pseudo code - 로그 추출 스크립트  (0) 2020.01.16
Time to boost  (0) 2020.01.05
SW 검증 아젠다  (0) 2019.12.26