<?xml version="1.0"?>
<document>

 <properties>
  <title>Thread Benchmark (TBM)</title>
  <author email="dev@commons.apache.org">Commons Documentation Team</author>
 </properties>

 <body>

<section name="The Thread Benchmark (TBM) Component">

<p>There are two problems with the JVM implementations of the
java Data and Time related classes which can adversely impact
performance.</p>

<subsection name="Object creation and garbage collection (GC)">

<p>The JVM implemantations of the java Date and Time related
classes create a number of objects when they are instantiated.
These objects are expensive to instantiate and add significant
overhead to GC when they are subsequently removed during GC.
This can impact performance in a servlet container where you
want to reduce the amount of time the JVM spends doing GC.
</p>

</subsection>

<subsection name="Thread synchronization bottlenecks">

<p>
Date and Time related classes are frequently used within threaded
web application servers such as Tomcat. They get used for
logging; SQL TIME, DATE, and DATESTAMP fields within a JDBC
driver; and within web applications themselves.</p>

<p>The following Java classes exhibit this synchronization bottleneck.
<ul>
  <li>java.sql.Date</li>
  <li>java.sql.Time</li>
  <li>java.sql.Timestamp</li>
  <li>java.text.SimpleDateFormat</li>
  <li>java.util.Calendar</li>
  <li>java.util.Date</li>
  <li>java.util.GregorianCalendar</li>
  <li>java.util.TimeZone</li>
</ul>
Due to the design of these classes there is no simple work
around. Here is an analysis of all the <a href="analysis.html">
synchronization bottlnecks</a> in the above classses.</p>

</subsection>

</section>

</body>

</document>

