jmeter-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vladimir Sitnikov <>
Subject Re: Why do Functions that only have values as instance variable synchronize execute ?
Date Fri, 17 Oct 2014 08:00:06 GMT
I went through sub-classes of AbstractFunction and removed synchronization
where it is not required.
Basically, if a function does not modify state and if it accesses
thread-safe objects only, then synchronization is not required.

Please find the attached patch on top of e9228ccf / trunk@1632410.

0) The patch contains just synchronization removal + some corrections to
CV. All the tests pass except
Property File Version mismatch, ensure you update SaveService#FILEVERSION
field with revision id of

testPropfile fails without patch as well, so I did not investigate that.

1) I have no idea what to do with BeanShell function. bsh.Interpreter is
thread safe, however bshInterpreter.set("vars",...) should not be accessed
concurrently as that will just overwrite the value.
I think it makes sense to wrap bsh interpreter in a ThreadLocal, so
synchronization can be removed from BeanShell.execute

2) There are lots of cases when Thread.currentThread().getName() is used.
This method always creates new String, thus it has performance impact (see

2.1) ThreadNumber function even tries to parse thread name. It would be
great if ThreadNumber can be implemented
via JMeterContextService.getContext().getThreadNum().

2.2) Other usages of currentThread.getName() might probably be replaced
with JMeterContextService.getContext().getThread().getThreadName()

3) __time function parses regexp "/\\d+" in the execute. I guess it might
make sense to move that to setParameters.


Vladimir Sitnikov

  • Unnamed multipart/mixed (inline, None, 0 bytes)
View raw message