the diary of a datum the diary of a datum ( modeling runtime behavior in framework-based applications) modeling runtime behavior in framework-based applications) Nick Mitchell, Gary Sevitsky, Harini Srinivasan IBM T.J. Watson Research Center Hawthorne, NY USA July 7, 2006
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
the diary of a datumthe diary of a datum
((modeling runtime behavior in framework-based applications)modeling runtime behavior in framework-based applications)
Nick Mitchell, Gary Sevitsky, Harini SrinivasanIBM T.J. Watson Research Center
Hawthorne, NY USA
July 7, 2006
the diary of a timecardthe diary of a timecard
parseXML
documentbusinessobject
MQmessage
extractcontent
store inDB2
record
copy (andrepackage)serialize serialized
Java objectDB2blob
DB2record
cost of parsestep:- 2000 calls- 300 objects
● from a deployed server application– extensively uses frameworks (large-scale applications act as integrators)
– this is par for the course for rich clients, too
● that's a lot of work for such a simple task!– what makes this silly is the large number of data transformations
hotspot-free bloathotspot-free bloat
● tuning the easy stuff may remove hot spots– bye bye bubble sort!
● but bloat remains– the runtime complexity and cost of hotspot-free programs is high
parseXML
documentbusinessobject
MQmessage
extractcontent
store inDB2
record
copy (andrepackage)serialize serialized
Java objectDB2blob
DB2record
cost of parsestep:- 2000 calls- 300 objects
the diary of a datum methodologythe diary of a datum methodology
● the analysis scenario– structure activity based on information flow
● code-agnostic classification– label forms of data, and transformations between them, according to the
purpose they serve in the scenario
● behavior signatures– quantify runtime complexity and costs of a scenario in code-agnostic terms
part I: the analysis scenariopart I: the analysis scenario
structuring computation as flows of the physical forms of logical content
information contentinformation content
● various physical representations– binary (MQ message)
– unicode XML (SOAP)
– heap object (Java)
– binary (serialized Java object)
– binary (DB2 blob)
● one a logical collection of information– timecard
● each at the same level of granularity– record (e.g. timecard)
– field (e.g. dates, serial number, manager)
– subfield (e.g. month or day of a date)
an example analysis scenarioan example analysis scenario
analysis scenariocode:
logical content:source:
sink:
Trade benchmark v.3.1 (acting as a SOAP client)
stock purchase date (field granularity)
subsequence of a SOAP message (as bytes)
a field in a Java object (used for subsequent HTML rendering)
Copy to another
version of the
business object
Calendar*(Java field)
Date*(Java field)
bytes(SOAP)
Parse, set field
in business object
Cost:- 268 calls- 70 objects
*new objects
the diary of a datethe diary of a date
code:logical content:
source:sink:
Trade benchmark v.3.1 (acting as a SOAP client)
stock purchase date (field granularity)
subsequence of a SOAP message (as bytes)
a field in a Java object (used for subsequent HTML rendering)
analysis scenario
Copy to another
version of the
business object
Calendar*(Java field)
Date*(Java field)
bytes(SOAP)
Parse, set field
in business object
Cost:- 268 calls- 70 objects
*new objects
zooming in on the SOAP parsingzooming in on the SOAP parsing((detail of just the first step of the previous slide)detail of just the first step of the previous slide)
Parse (using SOAP CalendarDeserializer)
parse using Simple-Date-
Format
String* Date*
parse time zone and
millis; reformat without them
Cost:- 11 calls- 6 objects
add in timezone and millis
Dateextract
value from SOAP tag
bytes(SOAP) String*
Cost:- 30 calls- 3 objects
getschema
info
XML andJava types
BeanPropertyDescriptor
Cost:- 10 calls- 0 objects
get de-serializer
Cost:- 51 calls- 5 objects
Deserializer*
buildCalendar
Calendar*+ 11 arrays*+ TimeZone*
set time
Cost:- 7 calls- 1 object
Cost:- 15 calls- 15 objects
Calendar
Cost:- 95 calls- 39 objects
Cost:- 4 calls- 0 objects
ParsePosition*
TimeZone*(constant)
SimpleDateFormat+ Calendar
2 longs(TZ and millis)
Set business object field via reflection
box into array
call invoke()
onsetter
Object[]*
Cost:- 6 calls- 1 object
Calendar
*new objects
zooming in on zooming in on SimpleDateFormat.parseSimpleDateFormat.parse
extract and parse subfield
set field in Calendarint
String x 6 forYY,MM, DD, ...
Calendarcompute
time
create Datefromtime
long Date*
Cost:- 4 calls- 1 object
Cost:- 14 calls- 6 objects
Cost:- 1 calls- 0 objects
Cost:- 0 calls- 1 object
boolean[]**new objects
zooming in on the subfield parsingzooming in on the subfield parsing(called for every month, day, year, ...)(called for every month, day, year, ...)