Skip to content

Seven releases in two weeks

The library worked. I spent two weeks rewriting large parts of it anyway, and broke compatibility on the way.

itu parses and formats RFC 3339 timestamps. I wrote it in 2017, and it had been quiet for a long time. It has served us well, and that is a good state for a library to be in.

What changed is where it runs. It is used on Android phones now. On a server, a slow parser costs a bit of CPU that nobody sees. On a phone the same work is felt by every user. So there was more to gain, and it would have real impact.

Releases of itu, 2017 to March 2022. 201720182019202020212022 1.4.0 to 1.7.0, seven releases in 13 days a long gap

Between 26 February and 10 March there were seven releases, 1.4.0 to 1.7.0.

Formatting got a massive improvement in 1.5.0, and nearly doubled again in 1.5.2. The benchmarks were rewritten in JMH, since my old loop with a timer was not something I could defend any longer. Leap seconds are now checked against the list of known ones. And lenient parsing returns a DateTime of its own, so 2017-12-06 and 2017-12-06T12:30Z can both be parsed without pretending the first one has a time.

Nanoseconds per operation for itu, the JDK and Google's DateTime. itu is between 53 and 73 ns, the JDK between 338 and 1376 ns.

The plot from the 1.7.0 README.

The part I am less proud of

1.5.0 has a breaking change in a minor version. Parsing null or an empty string used to return null. Now it throws, in line with the java.time classes. And 1.6.0 removed the methods for java.util.Date.

Both are right. A parser that answers null for nothing hides bugs, and java.util.Date should have been gone long ago. But a library that has been quiet for years is one that people have stopped watching. Then it wakes up, and a dependency bump breaks their build.

Should that have been a 2.0? Probably. I wanted the numbers out, and I did not want to wait for a major version to fix what I thought was a mistake from the start.

I would be annoyed at a library that did this to me.