我正在使用MS SQL Server Reporting Services 2008 R2生成报告。
我有Perforce数据库,我在其中查询Changesets数据并进入报告。我需要从Perforce数据库获取代码统计信息,但Perforce数据库没有此信息。
因此,我编写了一个自定义DLL来获取特定变更集中更改的代码数。然后我创建了一个计算字段,并调用了计算已更改代码行数并传递变更集编号的方法。
它的工作原理......然而它是愚蠢的慢...我无法弄清楚为什么它这么慢,因为使用p4.net的自定义dll上的代码计算是从性能点的快速廉价的工作视图。
我知道这是非常具体的情况,但是你能不能给我一些想法如何找到导致缓慢的原因?
非常感谢您的帮助,请提出任何问题以便澄清。
干杯
AnarchistGeek
答案 0 :(得分:1)
您是否能够确定时间主要花费在describe
命令还是diff2
命令上?如果使用P4toDb复制元数据,则可以通过从关系数据库读取数据来优化describe
部分。
答案 1 :(得分:0)
我的建议是预先计算更改大小并将它们存储在文件修订版的属性中。您可以使用未记录的p4 attribute
命令。
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'.