Instantiation of recursive generic types slows down exponentially the deeper they are nested. Why?

后端 未结 4 735
独厮守ぢ
独厮守ぢ 2020-12-13 04:11

Note: I may have chosen the wrong word in the title; perhaps I\'m really talking about polynomial growth here. See the benchmark

4条回答
  •  难免孤独
    2020-12-13 04:48

    In Java, computation time appears to be a little more than linear and far more efficient than you're reporting in .net. Using the testRandomPopper method from my answer, it takes ~4 seconds to run with N=10,000,000 and ~10 seconds to run with N=20,000,000

提交回复
热议问题