Skip to content

Commit d11d1b1

Browse files
author
Vadim Platonov
committed
clarify warm-up
1 parent 5be58fa commit d11d1b1

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

README.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,10 @@ year due to DST or governmental regulations.
106106
(offset-time 10)
107107
=> #<java.time.OffsetTime 10:00+01:00>
108108

109-
(offset-date-time 10)
109+
(offset-date-time 2015 10)
110110
=> #<java.time.OffsetDateTime 2015-10-01T10:00+01:00>
111111

112-
(zoned-date-time 10)
112+
(zoned-date-time 2015 10)
113113
=> #<java.time.ZonedDateTime 2015-10-01T10:00+01:00[Europe/London]>
114114
```
115115

@@ -155,6 +155,22 @@ represent any period of time with a granularity larger or equal to a single day.
155155
Duration, on the other hand, represents a standard duration less than or equal
156156
to a single standard (24-hour) day.
157157

158+
### Caution
159+
160+
The current incarnation of the library is quite slow while calling the 2-3
161+
arity `zoned-date-time/offset-time/offset-date-time` constructors. If you need
162+
predictable latency on the first call, please warm the constructors you are
163+
going to use by using them in a 'warm-up phase', e.g.:
164+
165+
```clj
166+
(defn warm-up []
167+
(zoned-date-time 2015 1 1)
168+
(zoned-date-time 2015 1)
169+
(zoned-date-time 2015))
170+
```
171+
172+
Only the types of the arguments matter, not the values!
173+
158174
### An appetizer
159175

160176
First, let's do a quick run through common use cases.

0 commit comments

Comments
 (0)