pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Brett Okken <noreply@github.com>
To: pgsql-jdbc@lists.postgresql.org
Subject: [pgjdbc/pgjdbc] c84e62: Utf 8 encoding optimizations (#1444)
Date: Thu, 16 Jan 2020 08:13:26 -0800
Message-ID: <pgjdbc/pgjdbc/push/refs/heads/master/2972ad-c84e62@github.com> (raw)

  Branch: refs/heads/master
  Home:   https://github.com/pgjdbc/pgjdbc
  Commit: c84e62efa5b98323562753e45fbf0d974eaca483
      https://github.com/pgjdbc/pgjdbc/commit/c84e62efa5b98323562753e45fbf0d974eaca483
  Author: Brett Okken <brett.okken.os@gmail.com>
  Date:   2020-01-16 (Thu, 16 Jan 2020)

  Changed paths:
    A pgjdbc/src/main/java/org/postgresql/core/ByteOptimizedUTF8Encoder.java
    A pgjdbc/src/main/java/org/postgresql/core/CharOptimizedUTF8Encoder.java
    M pgjdbc/src/main/java/org/postgresql/core/Encoding.java
    A pgjdbc/src/main/java/org/postgresql/core/OptimizedUTF8Encoder.java
    R pgjdbc/src/main/java/org/postgresql/core/UTF8Encoding.java
    A pgjdbc/src/test/java/org/postgresql/core/UTF8EncodingTest.java
    M pgjdbc/src/test/java/org/postgresql/test/jdbc2/Jdbc2TestSuite.java

  Log Message:
  -----------
  Utf 8 encoding optimizations (#1444)

* fix: Correct typo weather to whether

* misc: Change internal Encoding.testAsciiNumbers(...) to be static

* perf: Enhance Encoding constructor to allow skipping of ASCII number compatibility test

Adds a two parameter constructor to Encoding to allow sub classes to specify whether their
known ASCII compatability so as to skip testing. The only usage of it is the UTF8Encoding
which is changed to use the new constructor.

* fix: limit size of char[] for utf-8 decoding

Also optimize for java 9+ byte[] backed strings

* fix: limit size of char[] for utf-8 decoding

address style issues

* fix: limit size of char[] for utf-8 decoding

address style issues

* fix: limit size of char[] for utf-8 decoding

use existing JavaVersion enum to pick implementation
add unit test string values
more consistency between byte and char based implementations

* fix: limit size of char[] for utf-8 decoding

fix backwards comparison
add more strings to unit test

* fix: limit size of char[] for utf-8 decoding

Move to using new String(byte[], int, int, Charset) rather than custom
decoding for jre newer than 1.8.

* fix: limit size of char[] for utf-8 decoding

Back to custom utf-8 decoding for performance gains while validating

* javadoc

* put test back into test suite

* avoid creating an unnecessary `char[]` when growing cached array

Co-authored-by: Sehrope Sarkuni <sehrope@jackdb.com>
Co-authored-by: Dave Cramer <davecramer@gmail.com>







Message-ID: <pgjdbc/pgjdbc/push/refs/heads/master/2972ad-c84e62@github.com>
Permalink:  ../pgjdbc%2Fpgjdbc%2Fpush%2Frefs%2Fheads%2Fmaster%2F2972ad-c84e62@github.com/
Also on:    postgresql.org/message-id/pgjdbc/pgjdbc/push/refs/heads/master/2972ad-c84e62@github.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: noreply@github.com
  Subject: Re: [pgjdbc/pgjdbc] c84e62: Utf 8 encoding optimizations (#1444)
  In-Reply-To: <pgjdbc/pgjdbc/push/refs/heads/master/2972ad-c84e62@github.com>
  References: <pgjdbc/pgjdbc/push/refs/heads/master/2972ad-c84e62@github.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox