[Podofo-users] Data type of variants
A PDF parsing, modification and creation library.
Brought to you by:
domseichter
From: Craig R. <cr...@po...> - 2007-02-14 05:32:05
|
Hi PdfVariant::IsDictionary() etc trigger a delayed load via a call to PdfVariant::GetDataType() . Since these can get called a _lot_ by an application, I'm wondering if we can eliminate the necessity for that delayed load call. Do you think it's reasonable to require that a variant set a correct data type on construction, whether or not it's delay-loaded? As far as I can tell determining the type should involve the inspection of a couple of bytes of the input if delayed loading is on - not exactly expensive - and can be done quite conclusively from those bytes. That'd let us avoid calling DelayedLoad() from PdfVariant::GetDataType() and handily permit the IsBlah() methods to be annotated nothrow() . DelayedLoad() is pretty cheap, but it's still a branch and potential virtual function call where we could be just unconditionally returning a data member. Sound OK? Seem possible - or am I missing something here? -- Craig Ringer |