0
我有DateTime
對象每秒創建成千上萬喬達的應用:創建大量Joda DateTime有多貴?
public void handleHighVolumeRequest(Foo foo) {
DateTime dt = new DateTime().withZone(DateTimeZone.UTC).withTimeAtStartOfDay();
foo.setDateTime(dt);
// do other stuff with 'foo' and 'dt'
}
我使用的是默認JDK6垃圾收集(PS清除和PS MarkSweep)。非默認的內存設置是-Xmx768M
。
創建所有這些DateTime
對象的短期(100毫秒)請求是否有不平凡的成本?
看看這個:http://joda-time.sourceforge.net/faq.html#performance 它似乎表現不錯。 –