[CONJ-866] long binary parsing improvement Created: 2021-03-22  Updated: 2021-05-11  Resolved: 2021-05-11

Status: Closed
Project: MariaDB Connector/J
Component/s: performance
Affects Version/s: None
Fix Version/s: 2.7.3

Type: Task Priority: Major
Reporter: Diego Dupin Assignee: Diego Dupin
Resolution: Fixed Votes: 0
Labels: None


 Description   

report from https://github.com/mariadb-corporation/mariadb-connector-j/pull/168:

Now while getting long value from unsigned BIGINT column, method getInternalLong, unnecessary objects will be created: two BigInteger and one String. Also, redundant conversion from byte array to long and back from long to byte array will be performed. The same can be partly applied to getInternalFloat, getInternalDouble, and getInternalBigDecimal.

There is a more straightforward way to check that a value is in Long range that doesn't require additional objects creation.
Also, if a column is unsigned, there is no need to convert an array of bytes to long just to convert that value back to bytes to create BigInteger.
BigDecimal can be created directly from BigInteger - no need to convert BigInteger to a string.



 Comments   
Comment by Diego Dupin [ 2021-05-11 ]

merged in 2.7.3

Generated at Thu Feb 08 03:18:53 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.