Unfortunately, these files seem untested by CI here, but they are used
by Azure pipelines for DMD, so one can easily break DMD CI by a
seemingly fine Phobos change (#7142 in this case, which requires
DIP1000).
std.datetime.package has StopWatch, benchmark, comparingBenchmark, and
measureTime, all of which use TickDuration (which would be deprecated,
but it can't be deprecated as long as those functions in std.datetime
are deprecated). This commit introduces
std.datetime.stopwatch to replace those functions in std.datetime. In
order to avoid symbol conflicts, std.datetime.stopwatch will not be
publicly import in std.datetime.package until the old symbols have been
removed.
std.datetime.experimental.stopwatch contains StopWatch and benchmark
which have essentially the same APIs as the ones in
std.datetime.package, but they use MonoTime and Duration.
comparingBenchmark has not been ported to MonoTime and Duration, because
it is simply a wrapper around benchmark.
measureTime has not been ported to MonoTime and Duration, because it is
equivalent to using StopWatch with a scope(exit) statement.
The old functionality will be deprecated the major release after the new
symbols have been introduced.
- add EncodingScheme.register overload that references the registered class
- just adding the FQN name of a class does not reference that class, so
it must not end up in the binary and subsequently EncodingScheme.create failed
- This used to work by chance b/c all the EncodingScheme implementations
were in a module w/ static ctor. Any user of std.encoding did drag in
that ModuleInfo, which in turn referenced all classes of std.encoding.
Since moving the static ctor to std.internal.phobosinit to break a
cycle, the classes were no longer referenced by a ModuleInfo w/ shared
ctor, so they wouldn't end up in the binary unless explicitly
referenced elsewhere.
- deprecate the old EncodingScheme.register(string fqn) b/c relying on
Object.factory is slow, error prone (linkage), and really unnecessary
- import encodinginit in std.encoding so that the
std_encoding_shared_static_this callback actually gets run