MySQL Forums
Forum List  »  Connector/JDBC and Java

CancelTask performance issue
Posted by: Erdinc Taskin
Date: November 20, 2017 02:18AM

I analyse my applications that has small performance problem on jdbc connector classs that com.mysql.jdbc.StatementImpl.CancelTask constructor.

this.origConnProps = new Properties();
Properties props = StatementImpl.this.connection.getProperties();
Enumeration<?> keys = props.propertyNames();
while (keys.hasMoreElements()) {
String key = keys.nextElement().toString();
this.origConnProps.setProperty(key, props.getProperty(key));

One of the following changes is might make sense for performance improvements

this.origConnProps = new Properties(StatementImpl.this.connection.getProperties());

Another alternative
this.origConnProps = Properties();

Yes, I know first one is not deep copy and property changes will be reflected on CancelTask, but second is pretty same behave like current version.

Thanks for advance,

Options: ReplyQuote

Written By
CancelTask performance issue
November 20, 2017 02:18AM

Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.