将表达式重构为函数会对性能产生影响吗?(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 UI报告(SOAP UI Reporting)

如果要保存简单的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(soapR...

如何在免费版的Soap UI中从datebase获取值?(How to get values from datebase in free version of Soap UI?)

专业版soapUI中的JDBC配置面板与您的屏幕截图几乎完全相同,而连接字符串仅仅是一个标准的JDBC连接字符串,您已拥有该字符串。 如果需要替换字符串中的属性,请尝试: jdbc:mysql://localhost:3306/SID?user=${#Project#databaseUsername}&password=${#Project#databasePassword} 在这种情况下, databaseUsername和databasePassword是项目级别属性。 有关语法的更多信息,请...

REST服务测试 - SOAP UI(REST Service testing - SOAP UI)

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 beca...

在测试Web服务时在SOAP UI中进行身份验证(Authentication in SOAP UI while testing web services)

它还取决于WSS-PasswordType 也验证。 It also depends on the WSS-PasswordType verify that also.

SOAP UI响应(SOAP UI response)

抛出异常? 如果是,框架如何处理异常? 你的方法没有返回任何东西 - 见这里 。 基于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...

通过使用groovy脚本,不会在SOAP UI中更新本地属性值(By using groovy scripts local property value is not updated in SOAP UI)

我在下面找到了解决这个问题的方法:因为我想在Properties测试步骤中修改属性: 我需要修改下面现有的代码行: testRunner.testCase.setPropertyValue(“Pro_Response”,testString) 如下所示: testRunner.testCase.testSteps [“Properties_2”]。setPropertyValue(“Pro_Response”,testString) I have found below solution for ...

如何在SOAP UI中设置no请求?(How to set no of request in SOAP UI?)

简而言之,是的,可以通过使用负载测试来实现。 我相信你已经创建了一个测试用例 。 只需右键单击测试用例,选择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 cas...

SOAP UI Pro中的报告选项卡为空白(Reporting Tab is blank in SOAP UI Pro)

这可能是解决方案。 如果有效,请告诉我 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)

这是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 tes...

Groovy脚本 - 自动请求并保存SOAP UI的响应(Groovy Script - Automatic Request and saving response from SOAP UI)

这是实现您所需要的方法。 测试用例包含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.e...

相关文章

更多

Becoming a data scientist

Data Week: Becoming a data scientist Data Pointed, ...

Supra Skytop Shoes All White Gunny are a top performance

The Skytop “Crimson” is an all white leather affair ...

两种js function 声明方式

http://helephant.com/2012/07/14/javascript-function ...

A Great List of Windows Tools

Windowsis an extremely effective and a an efficient ...

Solr Performance Factors(Solr 性能因素)

Schema Design Considerations(数据模型方面考虑) indexed fiel ...

Python内建函数(A)

abs(x) 说明:abs(x)返回x的绝对值,如果参数是复数,则返回复数的模; 参数x:整 ...

Spark - A Fault-Tolerant Abstraction for In-Memory Cluster Computing

http://spark-project.org/ 项目首页 http://shark.cs.berk ...

Drupal Forums instead of phpBB or vBulletin: A casestudy

5th Jan, 10 Drupal drupal advanced forum drupa ...

jQuery EasyUI 如何获取当前单击标签(如<a>)所在行了数据

查看jQuery EasyUI的帮助说明,getSelected是获取选中行的数据,但当我没有选中当前 ...

[转]So You Want To Be A Producer

pro-du-cer n. 1. Someone from a game publisher who ...

最新问答

更多

获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)

我用Google搜索了一个解决方案。 “EnumDisplayModeProvider”是我自己设置网站的各种模式的枚举。 public EnumDisplayModeProvider GetDisplayModeId() { foreach (var mode in DisplayModeProvider.Instance.Modes) if (mode.CanHandleContext(HttpContext)) {

如何通过引用返回对象?(How is returning an object by reference possible?)

这相对简单:在类的构造函数中,您可以分配内存,例如使用new 。 如果你制作一个对象的副本,你不是每次都分配新的内存,而是只复制指向原始内存块的指针,同时递增一个也存储在内存中的引用计数器,使得每个副本都是对象可以访问它。 如果引用计数降至零,则销毁对象将减少引用计数并仅释放分配的内存。 您只需要一个自定义复制构造函数和赋值运算符。 这基本上是共享指针的工作方式。 This is relatively easy: In the class' constructor, you allocate m

矩阵如何存储在内存中?(How are matrices stored in memory?)

正如它在“熵编码”中所说的那样,使用Z字形图案,与RLE一起使用,在许多情况下,RLE已经减小了尺寸。 但是,据我所知,DCT本身并没有给出稀疏矩阵。 但它通常会增强矩阵的熵。 这是compressen变得有损的点:输入矩阵用DCT传输,然后量化量化然后使用霍夫曼编码。 As it says in "Entropy coding" a zig-zag pattern is used, together with RLE which will already reduce size for man

每个请求的Java新会话?(Java New Session For Each Request?)

你是如何进行重定向的? 您是否事先调用了HttpServletResponse.encodeRedirectURL()? 在这里阅读javadoc 您可以使用它像response.sendRedirect(response.encodeRedirectURL(path)); The issue was with the path in the JSESSIONID cookie. I still can't figure out why it was being set to the tomca

css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)

我认为word-break ,如果你想在一个单词中打破行,你可以指定它,这样做可以解决问题: .column { word-break:break-all; } jsFiddle演示。 您可以在此处阅读有关word-break属性的更多信息。 I think word-break, with which you can specify if you want to break line within a word, will do the trick: .column { word-break

无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)

我认为您忘记在分类时间内缩放输入图像,如train_test.prototxt文件的第11行所示。 您可能应该在C ++代码中的某个位置乘以该因子,或者使用Caffe图层来缩放输入(请查看ELTWISE或POWER图层)。 编辑: 在评论中进行了一次对话之后,结果发现在classification.cpp文件中错误地删除了图像均值,而在原始训练/测试管道中没有减去图像均值。 I think you have forgotten to scale the input image during cl

xcode语法颜色编码解释?(xcode syntax color coding explained?)

转到: Xcode => Preferences => Fonts & Colors 您将看到每个语法高亮颜色旁边都有一个简短的解释。 Go to: Xcode => Preferences => Fonts & Colors You'll see that each syntax highlighting colour has a brief explanation next to it.

在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)

你考虑过第三方拼写检查吗? 您可以将在C#中开发的自定义WinForms控件插入访问数据库吗? VB6控件怎么样? 如果你能找到一个使用第三方库进行拼写检查的控件,那可能会有效。 Have you considered a third party spell checker? Can you insert a custom WinForms controls developed in C# into an access database? What about a VB6 control? If

从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)

我有同样的问题,因为我在远程服务器上有两个图像,我需要在每天的预定义时间复制到我的本地服务器,这是我能够提出的代码... try { if(@copy('url/to/source/image.ext', 'local/absolute/path/on/server/' . date("d-m-Y") . ".gif")) { } else { $errors = error_get_last(); throw new Exception($err

从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))

我不确定我完全明白你在说什么。 你能编辑你的帖子并包含你正在做的Subversion命令/操作的特定顺序吗? 最好使用命令行svn客户端,以便容易为其他人重现问题。 如果您只是想获取文件的旧副本(即使该文件不再存在),您可以使用如下命令: svn copy ${repo}/trunk/moduleA/file1@${rev} ${repo}/trunk/moduleB/file1 其中${repo}是您的存储库的URL, ${rev}是您想要的文件的版本。 这将恢复该文件的旧版本,包括最高版本