Description
@oxinabox and I were discussing some performance problems in the presence of large numbers of ZonedDateTime
objects and I noted that them not being isbits
is a problem if you put lots of them in a vector, because the GC time taken to mark such vectors will be O(number of elements)
not O(number of vectors)
. Now, arguably this is a prime use case for a partially pooled vector that just pools the TimeZone objects, but keeps the raw DateTime inline, but I'm also wondering if ZonedDateTime
itself couldn't be made to be isbits
and not have this issue in the first place. In particular, it seems like there's probably only ever gonna be a small handful of TimeZones globally in the system, so we could just globally intern them and only refer to them by small integer identifiers (reconstituting them into the full object on access). Does that sound like a feasible thing to do? I think it would dramatically increase the performance of ZonedDateTime
.