RobotFramework 和 Jython:如何调查性能
我继承了一个使用 jython 的机器人框架装备,并在 Java 中定义了它的所有关键字。
它的运行速度我可以用“庄严”来形容。
将 yourkit 附加到节目中后,我看到了——真是令人惊讶——来自 jython 的 python 解释器。
是否有任何针对 jython 或机器人技术的分析,可以让我了解到底是什么让框架如此繁忙?
I've inherited a robot framework rig that uses jython and defines all its keywords in Java.
It runs at a pace which I might describe as, well, 'stately'.
Attaching yourkit to the show, I see -- what a surprise -- the python interpreter from jython.
Is there any profiling for jython or the robot technology that would allow me to see just what it is that is keeping the framework so busy?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以检查的一件事是您的套件/测试是否定义了不必要的超时。我们最近注意到,使用超时会导致相当多的开销(主要是因为超时在 RF 本身中实现得相当黑客化。)
除此之外,我认为还需要进行一些进一步的分析。一些建议:
Robot Framework 自己的时间报告器 [1]。使用它,您可以查看哪些套件/测试/关键字花费最多时间,也许还可以查看哪些库关键字速度慢得不合理。
您还可以尝试使用 Python 分析器 [2] 进行分析,该分析器也在 Jython 中实现。理论上,您至少应该能够看到大部分时间是花费在框架代码还是库代码上。
[1] http://robotframework.googlecode。 com/hg/tools/times2csv/doc/times2csv.html?r=2.6.3
[2] http://docs.python.org/library/profile.html
One thing you could check is whether your suites/tests define unnecessary timeouts. We've recently noticed that using timeouts causes quite a bit overhead (Mainly because timeouts are implemented quite hackishly in RF itself.)
Other that that, I think that some further profiling is needed. A couple of suggestions:
Robot Framework's own time reporter [1]. Using that, you can see which suites/tests/keywords take the most time, and perhaps also which library keywords are unreasonably slow.
You could also try profiling with the Python profiler [2], which is also implement in Jython. In theory, you should be able to see at least whether the majority of the time is spent in framework code or library code.
[1] http://robotframework.googlecode.com/hg/tools/times2csv/doc/times2csv.html?r=2.6.3
[2] http://docs.python.org/library/profile.html