The first commit refactors Timestamp construction, pulling the heavy-lifting validation and attribute setting logic out into
init and leaving the bare minimum in new.
The second commit calls new directly from ionc_read_timestamp and while avoiding building a dict of keyword
args.
A benchmark test I put together of all the timestamps from various "vectors" tests shows that this is about 2.7x faster
for reading timestamps. The impact to my "hkc" ion benchmark, which features a single Timestamp out of about 15 attributes per top-level-value is roughly a 25% improvement.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
The first commit refactors Timestamp construction, pulling the heavy-lifting validation and attribute setting logic out into init and leaving the bare minimum in new.
The second commit calls new directly from ionc_read_timestamp and while avoiding building a dict of keyword args.
A benchmark test I put together of all the timestamps from various "vectors" tests shows that this is about 2.7x faster for reading timestamps. The impact to my "hkc" ion benchmark, which features a single Timestamp out of about 15 attributes per top-level-value is roughly a 25% improvement.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.