首页
\
问答
\
将表达式重构为函数会对性能产生影响吗?(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
相关问答
更多-
SOAP UI报告(SOAP UI Reporting)[2022-06-02]
如果要保存简单的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 ... -
如何在免费版的Soap UI中从datebase获取值?(How to get values from datebase in free version of Soap UI?)[2023-06-27]
专业版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.
-
SOAP UI响应(SOAP UI response)[2022-03-07]
抛出异常? 如果是,框架如何处理异常? 你的方法没有返回任何东西 - 见这里 。 基于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 ... -
通过使用groovy脚本,不会在SOAP UI中更新本地属性值(By using groovy scripts local property value is not updated in SOAP UI)[2023-07-01]
我在下面找到了解决这个问题的方法:因为我想在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脚本中访问SOAP请求 - SOAP UI(how to access the SOAP request in the groovy script - SOAP UI)[2023-04-07]
这是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 ... -
Groovy脚本 - 自动请求并保存SOAP UI的响应(Groovy Script - Automatic Request and saving response from SOAP UI)[2022-05-27]
这是实现您所需要的方法。 测试用例包含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 ...