using p4.net in Reporting Services 2008 R2
I am using MS SQL Server Reporting Services 2008 R2 to produce reports.
I have Perforce database where I query Changesets data and put into report. I needed to get code statistics from Perforce database but Perforce database does not have this information.
Therefore, I have written a custom DLL to get the number of codes changed in a particular changeset. Then I have created a Calculated field and called the method which calculates the number of changed code lines and passed the changeset number.
it works... however it is stupidly slow... I could not way to figure out why it is slow this much as the code calculation on the custom dll using p4.net is faily cheap job from the performance point of view.
I know it is very specific situation, but could you guys g开发者_开发技巧ive me some idea how to find what causes the slowness?
Many thanks for your help, please ask any question for clarification.
Cheers
AnarchistGeek
Are you able to determine if the time is mostly spent on the describe
command or the diff2
command? The describe
portion could be optimized by reading the data from a relational database, if you replicate the metadata using P4toDb.
A suggestion I have is to pre-calculate the change size and store them in an attribute on the file revision. You can use the undocumented p4 attribute
command.
PS> p4 help undoc
attribute -- Set per-revision attributes on revisions (unsupported)
p4 attribute [ -e -f -p ] -n name [ -v value ] files...
Sets a user-managed attribute 'name' to 'value' on opened files.
If -v isn't given the attribute is cleared (if set).
Attributes can only be viewed with 'p4 fstat'.
The -e flag indicates the 'value' is in hex.
The -f flag sets the attribute on submitted files.
The -p flag creates an attribute whose value will be propagated
when the file is opened with 'p4 add', 'p4 edit', or 'p4 delete'.
PS> p4 help undoc
Unsupported or obsolete Perforce commands and options:
...
p4 fstat [ -Oacedhiz ] [ -A pattern ]
The -Oa flag shows attributes set by 'p4 attribute'. The -Oae flag
shows the attribute values encoded as hex. The -Od flag outputs the
digest of the attribute. The -Oc flag outputs the path, revision and
type of the server archive file (requires 'admin' privilege). The
-Oz flag outputs the path and revision of any lazy copies (requires
'admin' privilege). The -Oh flag outputs the size, digest and any
selected attributes of the synced revision rather than the head
revision. The -Oi flag outputs extra (debugging) information about
the attributes. The -A pattern flag restricts attributes to those
matching 'pattern'.
精彩评论