Commit Graph

71 Commits (a0028cbd0de2eb3c332aefff381bc7a852abb62c)

Author SHA1 Message Date
Jack Christensen 0e04d8187e Add raw benchmark 2020-06-01 08:53:45 -05:00
Jack Christensen bcdbb9f657 Tweak benchmarks to account for slow binary formats
See https://www.postgresql.org/message-id/CAMovtNoHFod2jMAKQjjxv209PCTJx5Kc66anwWvX0mEiaXwgmA%40mail.gmail.com
2020-05-25 11:18:11 -05:00
Jack Christensen 8faa1f5096 Fix off by one error with number of rows benchmark 2020-05-16 18:43:22 -05:00
Jack Christensen dea915e605 Compare binary and text format through pgx
Make ID field bigger -- otherwise all ints are less than 4 digits and
get a bit too much of an advantage in text vs. binary
2020-05-07 22:28:46 -05:00
Jack Christensen e439372d2a Add multi-row select benchmarks 2020-05-07 22:28:46 -05:00
Jack Christensen f9ce8af5c9 Add explicit enum support 2020-05-07 22:28:46 -05:00
Jack Christensen 3b8cd87875 Remove QueryArgs
An external SQL builder like github.com/jackc/pgsql should be used
instead.
2019-09-02 09:58:11 -05:00
Jack Christensen d5a6a5e7e0 Remove Results suffix from BatchResults methods 2019-08-24 23:41:28 -05:00
Jack Christensen 64b07f0d66 Batch uses statement cache.
This streamlines Queue's interface as well.
2019-08-24 23:40:21 -05:00
Jack Christensen 6508934508 Rename PreparedStatementCache to StatementCache 2019-08-24 22:19:29 -05:00
Jack Christensen 7f5e702d1a Fix benchmarks 2019-08-24 21:04:40 -05:00
Jack Christensen 12c1167147 Fix benchmarks now that date is UTC time 2019-08-24 20:57:15 -05:00
Jack Christensen 0c3e59b07a Add automatic statement cache 2019-08-24 20:29:54 -05:00
Jack Christensen c3e41872a8 Resplit Begin and BeginEx
This is in preparation for a Begin / Tx interface that will similate
nested transactions with savepoints.

In addition, this passes the TxOptions struct by value and thereby
removes an allocation.
2019-08-17 15:53:55 -05:00
Jack Christensen f3c703a102 Remove Conn SetLogger and SetLogLevel
Simplifying interface
2019-08-17 15:34:29 -05:00
Jack Christensen 3028821487 Add context.Context to Logger interface
This allows custom logger adapters to add additional fields to log
messages. For example, a HTTP server may with to log the request ID.

fixes #428
2019-08-03 16:16:21 -05:00
Jack Christensen f572b336b1 Improve pool Acquire / Release performance
Release was using a goroutine every time. Now it only starts a goroutine
when doing something that may take a while. (Destroy and afterRelease)
2019-05-04 17:36:08 -05:00
Jack Christensen 85ddbfeeee Remove 2 mallocs from query path 2019-05-04 08:55:05 -05:00
Jack Christensen aed6b822d9 Split batch command and result 2019-04-24 16:39:06 -05:00
Jack Christensen 2263521f70 Only have a single Begin transaction method 2019-04-24 13:35:27 -05:00
Jack Christensen 1b8f0016e9 Split pgtype into own repo 2019-04-20 19:20:00 -05:00
Jack Christensen efb333df6b Fix go modules
Wow. This is fun. Sure is easy to get modules wrong when upgrading a v2+
project.
2019-04-20 17:41:08 -05:00
Jack Christensen 66625e6489 Prepare takes context
Also remove PrepareEx. It's primary usage was for context. Supplying
parameter OIDs is unnecessary when you can type cast in the query SQL.
If it does become necessary or desirable to add options back it can be
added in a backwards compatible way by adding a varargs as last
argument.
2019-04-20 11:47:16 -05:00
Jack Christensen dc699cefc7 Conn.CopyFrom takes context 2019-04-20 11:38:23 -05:00
Jack Christensen 54c6ddc2f0 Commit and Rollback take context
Remove Ex versions.
2019-04-10 12:22:12 -05:00
Jack Christensen 7718ee6207 Remove Ex versions of Query and QueryRow
Always require context and prepend options to arguments if necessary.
2019-04-10 12:12:22 -05:00
Jack Christensen 77a2da2b46 Replace connection pool 2019-04-10 11:09:42 -05:00
Jack Christensen d3a2c1c107 Partial conversion of pgx to use pgconn 2019-01-26 16:46:30 -06:00
Jack Christensen 89c3d8af5d Remove ExecEx 2019-01-02 12:52:37 -06:00
Jack Christensen c672c0d595 Use environment variables for test configuration 2018-12-30 21:52:33 -06:00
Jack Christensen 73f496d7de Finish core batch operations 2017-06-03 11:49:27 -05:00
Jack Christensen 280bce7078 Added log adapter for logrus
Also changed standard logger interface to take a map instead of varargs for
extra data.
2017-04-29 21:28:38 -05:00
Jack Christensen 855b735eae Add log adapters for testing and log15
Make LogLevel a type for Stringer interface.
2017-04-29 20:33:52 -05:00
Jack Christensen 94749e580f Remove CopyTo 2017-03-17 14:18:25 -05:00
Jack Christensen 26d57356f7 Remove old Scanner and Encoder system 2017-03-12 17:22:04 -05:00
Jack Christensen 93e5c68f69 Merge branch 'master' into v3-experimental 2016-12-10 12:21:08 -06:00
Jack Christensen 5f7d01778e Add CopyTo to support PostgreSQL copy protocol
fixes #102
2016-08-10 16:27:44 -05:00
Jack Christensen 390f75c0e1 Reduce Logger interface to Log method 2016-08-02 14:42:31 -05:00
Jack Christensen 06c803253c Add basic benchmark for ConnPoolQueryRow 2016-02-13 13:12:21 -06:00
Jack Christensen 23c48c2f87 Add trace logging 2015-09-16 08:40:01 -05:00
Jack Christensen a2e078597b Add logging to rxMsg
Also benchmark what a log call costs
2015-09-14 10:25:48 -05:00
Jack Christensen 057da9f8e7 Add benchmarks for logging 2015-09-14 10:01:05 -05:00
Jack Christensen 73135865e7 Add benchmarks for NullX vs pointer to pointer 2015-09-08 12:08:20 -05:00
Jack Christensen 43dcd47a92 Move to Scan interface
Remove SelectValue
2014-07-05 18:23:19 -05:00
Jack Christensen 5b345e80e1 Remove SelectValueTo
Benchmarks revealed that it is no longer performant enough to pull
its own wait. Using go_db_bench to copy JSON results to HTTP responses
it was ~20% *slower* for ~4BK responses and less than 10% faster for
+1MB responses.

The the performance problem was in io.CopyN / io.Copy. io.Copy
allocates a 32KB buffer if it doesn't have io.WriterTo or io.ReaderFrom
available. This extra alloc on every request was more expensive than
just reading the result into a string and writing it out to the response
body.

Tests indicated that if MsgReader implemented a custom Copy that used a
shared buffer it might have a few percent performance advantage. But the
additional complexity is not worth the performance gain.
2014-07-05 09:32:47 -05:00
Jack Christensen d30ef1b8b9 Replace SelectFunc with Query as core 2014-06-28 17:07:31 -05:00
Jack Christensen b6ac3ef2b0 Rename Execute to Exec 2014-06-27 14:56:27 -05:00
Jack Christensen b2c1a14fcc Update github.com/JackC to github.com/jackc 2014-06-21 08:36:20 -05:00
Jack Christensen 73b5c73c1c Do not share database connections between tests 2014-06-20 15:18:55 -05:00
Jack Christensen 6d6fb4561a ConnPoolConfig embeds ConnConfig 2014-05-19 07:59:51 -05:00