首页 \ 问答 \ 将表达式重构为函数会对性能产生影响吗?(Does Refactoring of expressions into a function have a performance impact?)

将表达式重构为函数会对性能产生影响吗?(Does Refactoring of expressions into a function have a performance impact?)

给出以下简单的示例代码

rawData.matches(".*[a-zA-Z\\-].*")

我有两种重构的可能性:

1)重构为变量

2)重构成一个函数

对(2)有任何性能影响吗?

AFAIK JVM内联所有函数调用,它应该没有任何影响。


given following simple example code

rawData.matches(".*[a-zA-Z\\-].*")

I have two possibilities of refactoring:

1) refactoring into a variable

2) refactoring into a function

Is there any performance impact on (2)?

AFAIK the JVM inlines all function calls and it should have no impact.


原文:
更新时间:2021-07-15 08:07

最满意答案

SoapUI报告选项卡

这可能是解决方案。 如果有效,请告诉我


SoapUI Reporting Tab

This might be the solution. Let me know if it works

相关问答

更多
  • 如果要保存简单的SOAP测试步骤响应,可以使用此代码添加groovy脚本来执行此操作: // get your response def soapResponse = context.expand('${YourSOAPRequest#Response}') // create the file def file = new File("C:/Temp/testSO/response.xml") file.mkdirs() // save the response file.write(soapRespon ...
  • 专业版soapUI中的JDBC配置面板与您的屏幕截图几乎完全相同,而连接字符串仅仅是一个标准的JDBC连接字符串,您已拥有该字符串。 如果需要替换字符串中的属性,请尝试: jdbc:mysql://localhost:3306/SID?user=${#Project#databaseUsername}&password=${#Project#databasePassword} 在这种情况下, databaseUsername和databasePassword是项目级别属性。 有关语法的更多信息,请参阅htt ...
  • HTTP GET请求不应包含有效负载。 虽然你可以这样做,但是在HTTP规范没有明确排除的范围内,我建议避免使用它只是因为人们不希望事情以这种方式工作。 HTTP GET request shouldn't contain payload. While you can do that, insofar as it isn't explicitly precluded by the HTTP specification, I would suggest avoiding it simply because p ...
  • 它还取决于WSS-PasswordType 也验证。 It also depends on the WSS-PasswordType verify that also.
  • 抛出异常? 如果是,框架如何处理异常? 你的方法没有返回任何东西 - 见这里 。 基于URL的RESTful特性,该方法似乎应返回类似AccountDetail的内容。 但是,如果你真的只想看到200然后只返回类似非空字符串的东西。 Is the exception thrown? If yes, how does the framework handle the exception? Your method doesn't return anything - see here. Based on the ...
  • 我在下面找到了解决这个问题的方法:因为我想在Properties测试步骤中修改属性: 我需要修改下面现有的代码行: testRunner.testCase.setPropertyValue(“Pro_Response”,testString) 如下所示: testRunner.testCase.testSteps [“Properties_2”]。setPropertyValue(“Pro_Response”,testString) I have found below solution for this ...
  • 简而言之,是的,可以通过使用负载测试来实现。 我相信你已经创建了一个测试用例 。 只需右键单击测试用例,选择New Load Test 。 负载测试有不同的策略。 当然,它允许您设置测试需要执行的次数。 你可以在这里找到更多细节 In short, yes, it is possible to do so by using Load Test. I believe that you have created a test case. Just right click on the test case, ch ...
  • 这可能是解决方案。 如果有效,请告诉我 This might be the solution. Let me know if it works
  • 这是Groovy Script ,它从同一测试用例的上一步获取请求 ,就像您当前有测试用例一样。 脚本 def req = context.testCase.getTestStepAt(context.currentStepIndex - 1).httpRequest.requestContent log.info req Here is the Groovy Script which gets the request from its previous step of the same test cas ...
  • 这是实现您所需要的方法。 测试用例包含3个步骤,如下所示: step1 - Groovy Script测试步骤。 这将读取数据源,通过循环执行订单步骤。 控制测试运行。 step2 - Soap Request测试步骤。 获取订单并保存响应。 step3 - Groovy Script测试步骤。 一种退出测试执行的方法。 步骤1 第1步的Groovy脚本: def data = new File('C:/Users/Groovy Test/requests/orders.txt') data.eachLi ...

相关文章

更多

最新问答

更多
  • 在ios 7中的UITableView部分周围绘制边界线(draw borderline around UITableView section in ios 7)
  • Java中的不可变类(Immutable class in Java)
  • 寻求多次出现的表达式(Seeking for more than one occurrence of an expression)
  • linux只知道文件名,不知道在哪个目录,怎么找到文件所在目录
  • Actionscript:检查字符串是否包含域或子域(Actionscript: check if string contains domain or subdomain)
  • 懒惰地初始化AutoMapper(Lazily initializing AutoMapper)
  • 使用hasclass为多个div与一个按钮问题(using hasclass for multiple divs with one button Problems)
  • Windows Phone 7:检查资源是否存在(Windows Phone 7: Check If Resource Exists)
  • EXCEL VBA 基础教程下载
  • RoR - 邮件中的动态主体(部分)(RoR - Dynamic body (part) in mailer)
  • 无法在Google Script中返回2D数组?(Can not return 2D Array in Google Script?)
  • JAVA环境变量的设置和对path , classpth ,java_home设置作用和目的?
  • mysql 关于分组查询、时间条件查询
  • 如何使用PowerShell匹配运算符(How to use the PowerShell match operator)
  • Effective C ++,第三版:重载const函数(Effective C++, Third edition: Overloading const function)
  • 如何用DELPHI动态建立MYSQL的数据库和表? 请示出源代码。谢谢!
  • 带有简单redis应用程序的Node.js抛出“未处理的错误”(Node.js with simple redis application throwing 'unhandled error')
  • 使用前端框架带来哪些好处,相对于使用jquery
  • Ruby将字符串($ 100.99)转换为float或BigDecimal(Ruby convert string ($100.99) to float or BigDecimal)
  • 高考完可以去做些什么?注意什么?
  • 如何声明放在main之后的类模板?(How do I declare a class template that is placed after the main?)
  • 如何使用XSLT基于兄弟姐妹对元素进行分组(How to group elements based on their siblings using XSLT)
  • 在wordpress中的所有页面的标志(Logo in all pages in wordpress)
  • R:使用rollapply对列组进行求和的问题(R: Problems using rollapply to sum groups of columns)
  • Allauth不会保存其他字段(Allauth will not save additional fields)
  • python中使用sys模块中sys.exit()好像不能退出?
  • 将Int拆分为3个字节并返回C语言(Splitting an Int to 3 bytes and back in C)
  • 在SD / MMC中启用DDR会导致问题吗?(Enabling DDR in SD/MMC causes problems? CMD 11 gives a response but the voltage switch wont complete)
  • sed没有按预期工作,从字符串中间删除特殊字符(sed not working as expected, removing special character from middle of string)
  • 如何将字符串转换为Elixir中的函数(how to convert a string to a function in Elixir)