agora inbox for [email protected]
help / color / mirror / Atom feedRe: Binary support for pgoutput plugin
1606+ messages / 4 participants
[nested] [flat]
* Re: Binary support for pgoutput plugin
@ 2020-02-28 23:34 Tom Lane <[email protected]>
2020-02-29 15:44 ` Re: Binary support for pgoutput plugin Dave Cramer <[email protected]>
0 siblings, 1 reply; 1606+ messages in thread
From: Tom Lane @ 2020-02-28 23:34 UTC (permalink / raw)
To: Dave Cramer <[email protected]>; +Cc: Michael Paquier <[email protected]>; Alvaro Herrera <[email protected]>; Dmitry Dolgov <[email protected]>; Thomas Munro <[email protected]>; Tomas Vondra <[email protected]>; Petr Jelinek <[email protected]>; Andres Freund <[email protected]>; pgsql-hackers
Dave Cramer <[email protected]> writes:
> Rebased against head
The cfbot's failing to apply this [1]. It looks like the reason is only
that you included a catversion bump in what you submitted. Protocol is to
*not* do that in submitted patches, but rely on the committer to add it at
the last minute --- otherwise you'll waste a lot of time rebasing the
patch, which is what it needs now.
regards, tom lane
[1] http://cfbot.cputube.org/patch_27_2152.log
^ permalink raw reply [nested|flat] 1606+ messages in thread
* Re: Binary support for pgoutput plugin
2020-02-28 23:34 Re: Binary support for pgoutput plugin Tom Lane <[email protected]>
@ 2020-02-29 15:44 ` Dave Cramer <[email protected]>
2020-03-06 16:54 ` Re: Binary support for pgoutput plugin Petr Jelinek <[email protected]>
0 siblings, 1 reply; 1606+ messages in thread
From: Dave Cramer @ 2020-02-29 15:44 UTC (permalink / raw)
To: Tom Lane <[email protected]>; +Cc: Michael Paquier <[email protected]>; Alvaro Herrera <[email protected]>; Dmitry Dolgov <[email protected]>; Thomas Munro <[email protected]>; Tomas Vondra <[email protected]>; Petr Jelinek <[email protected]>; Andres Freund <[email protected]>; pgsql-hackers
On Fri, 28 Feb 2020 at 18:34, Tom Lane <[email protected]> wrote:
> Dave Cramer <[email protected]> writes:
> > Rebased against head
>
> The cfbot's failing to apply this [1]. It looks like the reason is only
> that you included a catversion bump in what you submitted. Protocol is to
> *not* do that in submitted patches, but rely on the committer to add it at
> the last minute --- otherwise you'll waste a lot of time rebasing the
> patch, which is what it needs now.
>
> regards, tom lane
>
> [1] http://cfbot.cputube.org/patch_27_2152.log
rebased and removed the catversion bump.
Attachments:
[application/octet-stream] 0006-make-sure-the-subcription-is-marked-as-binary.patch (829B, ../../CADK3HHJ-jJ8ROhXBHyGxnZdnvExeKZaNa95xLY2pP8PPBcAniw@mail.gmail.com/3-0006-make-sure-the-subcription-is-marked-as-binary.patch)
download | inline diff:
From d28ef2cb92d852046a375601b6e78b631840f36e Mon Sep 17 00:00:00 2001
From: Dave Cramer <[email protected]>
Date: Mon, 11 Nov 2019 14:37:35 -0500
Subject: [PATCH 6/7] make sure the subcription is marked as binary
---
src/backend/catalog/pg_subscription.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/backend/catalog/pg_subscription.c b/src/backend/catalog/pg_subscription.c
index 68d88ff499..2d974f82d6 100644
--- a/src/backend/catalog/pg_subscription.c
+++ b/src/backend/catalog/pg_subscription.c
@@ -65,6 +65,7 @@ GetSubscription(Oid subid, bool missing_ok)
sub->name = pstrdup(NameStr(subform->subname));
sub->owner = subform->subowner;
sub->enabled = subform->subenabled;
+ sub->binary = subform->subbinary;
/* Get conninfo */
datum = SysCacheGetAttr(SUBSCRIPTIONOID,
--
2.20.1 (Apple Git-117)
[application/octet-stream] 0003-document-new-binary-option-for-CREATE-SUBSCRIPTION.patch (2.9K, ../../CADK3HHJ-jJ8ROhXBHyGxnZdnvExeKZaNa95xLY2pP8PPBcAniw@mail.gmail.com/4-0003-document-new-binary-option-for-CREATE-SUBSCRIPTION.patch)
download | inline diff:
From e2a7d77bf172538f654d5df9af74a4e92db2eb8b Mon Sep 17 00:00:00 2001
From: Dave Cramer <[email protected]>
Date: Mon, 17 Jun 2019 10:26:59 -0400
Subject: [PATCH 3/7] document new binary option for CREATE SUBSCRIPTION
document addition of binary column to pg_subscription
---
doc/src/sgml/catalogs.sgml | 7 +++++++
doc/src/sgml/ref/alter_subscription.sgml | 4 ++--
doc/src/sgml/ref/create_subscription.sgml | 11 +++++++++++
3 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/doc/src/sgml/catalogs.sgml b/doc/src/sgml/catalogs.sgml
index 55694c4368..a19bb11674 100644
--- a/doc/src/sgml/catalogs.sgml
+++ b/doc/src/sgml/catalogs.sgml
@@ -6763,6 +6763,13 @@ SCRAM-SHA-256$<replaceable><iteration count></replaceable>:<replaceable>&l
<entry>If true, the subscription is enabled and should be replicating.</entry>
</row>
+ <row>
+ <entry><structfield>subbinary</structfield></entry>
+ <entry><type>bool</type></entry>
+ <entry></entry>
+ <entry>If true, the subscription will request that the publisher send base types in binary format.</entry>
+ </row>
+
<row>
<entry><structfield>subsynccommit</structfield></entry>
<entry><type>text</type></entry>
diff --git a/doc/src/sgml/ref/alter_subscription.sgml b/doc/src/sgml/ref/alter_subscription.sgml
index 6dfb2e4d3e..cc2ff0363f 100644
--- a/doc/src/sgml/ref/alter_subscription.sgml
+++ b/doc/src/sgml/ref/alter_subscription.sgml
@@ -163,8 +163,8 @@ ALTER SUBSCRIPTION <replaceable class="parameter">name</replaceable> RENAME TO <
<para>
This clause alters parameters originally set by
<xref linkend="sql-createsubscription"/>. See there for more
- information. The allowed options are <literal>slot_name</literal> and
- <literal>synchronous_commit</literal>
+ information. The allowed options are <literal>slot_name</literal>,
+ <literal>synchronous_commit</literal> and <literal>binary</literal>
</para>
</listitem>
</varlistentry>
diff --git a/doc/src/sgml/ref/create_subscription.sgml b/doc/src/sgml/ref/create_subscription.sgml
index 1a90c244fb..1059370a2c 100644
--- a/doc/src/sgml/ref/create_subscription.sgml
+++ b/doc/src/sgml/ref/create_subscription.sgml
@@ -128,6 +128,17 @@ CREATE SUBSCRIPTION <replaceable class="parameter">subscription_name</replaceabl
</listitem>
</varlistentry>
+ <varlistentry>
+ <term><literal>binary</literal> (<type>boolean</type>)</term>
+ <listitem>
+ <para>
+ Specifies whether the subscription will request the publisher send
+ the base types in binary or not. The default
+ is <literal>false</literal>.
+ </para>
+ </listitem>
+ </varlistentry>
+
<varlistentry>
<term><literal>slot_name</literal> (<type>string</type>)</term>
<listitem>
--
2.20.1 (Apple Git-117)
[application/octet-stream] 0002-add-binary-column-to-pg_subscription.patch (8.6K, ../../CADK3HHJ-jJ8ROhXBHyGxnZdnvExeKZaNa95xLY2pP8PPBcAniw@mail.gmail.com/5-0002-add-binary-column-to-pg_subscription.patch)
download | inline diff:
From a5241e0024a9037c1b4fc2da602e8d77aab8742f Mon Sep 17 00:00:00 2001
From: Dave Cramer <[email protected]>
Date: Fri, 14 Jun 2019 15:39:47 -0400
Subject: [PATCH 2/7] add binary column to pg_subscription bump catversion
support create and alter subcription with binary option
---
src/backend/catalog/system_views.sql | 2 +-
src/backend/commands/subscriptioncmds.c | 39 +++++++++++++++----
.../libpqwalreceiver/libpqwalreceiver.c | 3 ++
src/backend/replication/logical/worker.c | 1 +
src/include/catalog/pg_subscription.h | 4 ++
src/include/replication/walreceiver.h | 1 +
7 files changed, 43 insertions(+), 9 deletions(-)
diff --git a/src/backend/catalog/system_views.sql b/src/backend/catalog/system_views.sql
index f7800f01a6..3096cf2e5f 100644
--- a/src/backend/catalog/system_views.sql
+++ b/src/backend/catalog/system_views.sql
@@ -1063,7 +1063,7 @@ REVOKE ALL ON pg_replication_origin_status FROM public;
-- All columns of pg_subscription except subconninfo are readable.
REVOKE ALL ON pg_subscription FROM public;
-GRANT SELECT (subdbid, subname, subowner, subenabled, subslotname, subpublications)
+GRANT SELECT (subdbid, subname, subowner, subenabled, subbinary, subslotname, subpublications)
ON pg_subscription TO public;
diff --git a/src/backend/commands/subscriptioncmds.c b/src/backend/commands/subscriptioncmds.c
index 5408edcfc2..fd5057356a 100644
--- a/src/backend/commands/subscriptioncmds.c
+++ b/src/backend/commands/subscriptioncmds.c
@@ -58,7 +58,7 @@ parse_subscription_options(List *options, bool *connect, bool *enabled_given,
bool *enabled, bool *create_slot,
bool *slot_name_given, char **slot_name,
bool *copy_data, char **synchronous_commit,
- bool *refresh)
+ bool *refresh, bool *binary_given, bool *binary)
{
ListCell *lc;
bool connect_given = false;
@@ -89,6 +89,12 @@ parse_subscription_options(List *options, bool *connect, bool *enabled_given,
*synchronous_commit = NULL;
if (refresh)
*refresh = true;
+ if (binary)
+ {
+ *binary_given = false;
+ /* not all versions of pgoutput will understand this option default to false */
+ *binary = false;
+ }
/* Parse options */
foreach(lc, options)
@@ -174,6 +180,11 @@ parse_subscription_options(List *options, bool *connect, bool *enabled_given,
refresh_given = true;
*refresh = defGetBoolean(defel);
}
+ else if (strcmp(defel->defname, "binary") == 0 && binary)
+ {
+ *binary_given = true;
+ *binary = defGetBoolean(defel);
+ }
else
ereport(ERROR,
(errcode(ERRCODE_SYNTAX_ERROR),
@@ -323,8 +334,10 @@ CreateSubscription(CreateSubscriptionStmt *stmt, bool isTopLevel)
bool slotname_given;
char originname[NAMEDATALEN];
bool create_slot;
- List *publications;
+ bool binary;
+ bool binary_given;
+ List *publications;
/*
* Parse and check options.
*
@@ -333,7 +346,7 @@ CreateSubscription(CreateSubscriptionStmt *stmt, bool isTopLevel)
parse_subscription_options(stmt->options, &connect, &enabled_given,
&enabled, &create_slot, &slotname_given,
&slotname, ©_data, &synchronous_commit,
- NULL);
+ NULL, &binary_given, &binary);
/*
* Since creating a replication slot is not transactional, rolling back
@@ -399,6 +412,7 @@ CreateSubscription(CreateSubscriptionStmt *stmt, bool isTopLevel)
DirectFunctionCall1(namein, CStringGetDatum(stmt->subname));
values[Anum_pg_subscription_subowner - 1] = ObjectIdGetDatum(owner);
values[Anum_pg_subscription_subenabled - 1] = BoolGetDatum(enabled);
+ values[Anum_pg_subscription_subbinary - 1] = BoolGetDatum(binary);
values[Anum_pg_subscription_subconninfo - 1] =
CStringGetTextDatum(conninfo);
if (slotname)
@@ -669,10 +683,13 @@ AlterSubscription(AlterSubscriptionStmt *stmt)
char *slotname;
bool slotname_given;
char *synchronous_commit;
+ bool binary_given;
+ bool binary;
parse_subscription_options(stmt->options, NULL, NULL, NULL,
NULL, &slotname_given, &slotname,
- NULL, &synchronous_commit, NULL);
+ NULL, &synchronous_commit, NULL,
+ &binary_given, &binary);
if (slotname_given)
{
@@ -697,6 +714,13 @@ AlterSubscription(AlterSubscriptionStmt *stmt)
replaces[Anum_pg_subscription_subsynccommit - 1] = true;
}
+ if (binary_given)
+ {
+ values[Anum_pg_subscription_subbinary - 1] =
+ BoolGetDatum(binary);
+ replaces[Anum_pg_subscription_subbinary - 1] = true;
+ }
+
update_tuple = true;
break;
}
@@ -708,7 +732,8 @@ AlterSubscription(AlterSubscriptionStmt *stmt)
parse_subscription_options(stmt->options, NULL,
&enabled_given, &enabled, NULL,
- NULL, NULL, NULL, NULL, NULL);
+ NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL);
Assert(enabled_given);
if (!sub->slotname && enabled)
@@ -746,7 +771,7 @@ AlterSubscription(AlterSubscriptionStmt *stmt)
parse_subscription_options(stmt->options, NULL, NULL, NULL,
NULL, NULL, NULL, ©_data,
- NULL, &refresh);
+ NULL, &refresh, NULL, NULL);
values[Anum_pg_subscription_subpublications - 1] =
publicationListToArray(stmt->publication);
@@ -783,7 +808,7 @@ AlterSubscription(AlterSubscriptionStmt *stmt)
parse_subscription_options(stmt->options, NULL, NULL, NULL,
NULL, NULL, NULL, ©_data,
- NULL, NULL);
+ NULL, NULL, NULL, NULL);
AlterSubscription_refresh(sub, copy_data);
diff --git a/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c b/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c
index 545d2fcd05..c4daea33d2 100644
--- a/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c
+++ b/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c
@@ -400,6 +400,7 @@ libpqrcv_startstreaming(WalReceiverConn *conn,
char *pubnames_str;
List *pubnames;
char *pubnames_literal;
+ bool binary;
appendStringInfoString(&cmd, " (");
@@ -421,6 +422,8 @@ libpqrcv_startstreaming(WalReceiverConn *conn,
appendStringInfo(&cmd, ", publication_names %s", pubnames_literal);
PQfreemem(pubnames_literal);
pfree(pubnames_str);
+ if (options->proto.logical.binary)
+ appendStringInfo(&cmd, ", binary 'true'");
appendStringInfoChar(&cmd, ')');
}
diff --git a/src/backend/replication/logical/worker.c b/src/backend/replication/logical/worker.c
index 9a70649134..10a776325a 100644
--- a/src/backend/replication/logical/worker.c
+++ b/src/backend/replication/logical/worker.c
@@ -1800,6 +1800,7 @@ ApplyWorkerMain(Datum main_arg)
options.slotname = myslotname;
options.proto.logical.proto_version = LOGICALREP_PROTO_VERSION_NUM;
options.proto.logical.publication_names = MySubscription->publications;
+ options.proto.logical.binary = MySubscription->binary;
/* Start normal logical streaming replication. */
walrcv_startstreaming(wrconn, &options);
diff --git a/src/include/catalog/pg_subscription.h b/src/include/catalog/pg_subscription.h
index 3cb13d897e..bb44e5e45c 100644
--- a/src/include/catalog/pg_subscription.h
+++ b/src/include/catalog/pg_subscription.h
@@ -48,6 +48,9 @@ CATALOG(pg_subscription,6100,SubscriptionRelationId) BKI_SHARED_RELATION BKI_ROW
bool subenabled; /* True if the subscription is enabled (the
* worker should be running) */
+ bool subbinary; /* True if the subscription wants the
+ * output plugin to send data in binary */
+
#ifdef CATALOG_VARLEN /* variable-length fields start here */
/* Connection string to the publisher */
text subconninfo BKI_FORCE_NOT_NULL;
@@ -73,6 +76,7 @@ typedef struct Subscription
char *name; /* Name of the subscription */
Oid owner; /* Oid of the subscription owner */
bool enabled; /* Indicates if the subscription is enabled */
+ bool binary; /* Indicates if the subscription wants data in binary format */
char *conninfo; /* Connection string to the publisher */
char *slotname; /* Name of the replication slot */
char *synccommit; /* Synchronous commit setting for worker */
diff --git a/src/include/replication/walreceiver.h b/src/include/replication/walreceiver.h
index 41714eaf0c..49ec831bc4 100644
--- a/src/include/replication/walreceiver.h
+++ b/src/include/replication/walreceiver.h
@@ -162,6 +162,7 @@ typedef struct
{
uint32 proto_version; /* Logical protocol version */
List *publication_names; /* String list of publications */
+ bool binary; /* Ask publisher output plugin to use binary */
} logical;
} proto;
} WalRcvStreamOptions;
--
2.20.1 (Apple Git-117)
[application/octet-stream] 0004-get-relid-inside-of-logical_read_insert.patch (2.5K, ../../CADK3HHJ-jJ8ROhXBHyGxnZdnvExeKZaNa95xLY2pP8PPBcAniw@mail.gmail.com/6-0004-get-relid-inside-of-logical_read_insert.patch)
download | inline diff:
From edc4ca5e121304bf11713455f77f4735e74424fd Mon Sep 17 00:00:00 2001
From: Dave Cramer <[email protected]>
Date: Wed, 30 Oct 2019 09:58:59 -0400
Subject: [PATCH 4/7] get relid inside of logical_read_insert
---
src/backend/replication/logical/proto.c | 6 ++++--
src/backend/replication/logical/worker.c | 4 ++--
src/include/replication/logicalproto.h | 2 +-
3 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/src/backend/replication/logical/proto.c b/src/backend/replication/logical/proto.c
index 8859aa8e79..9164d36edc 100644
--- a/src/backend/replication/logical/proto.c
+++ b/src/backend/replication/logical/proto.c
@@ -161,18 +161,20 @@ logicalrep_write_insert(StringInfo out, Relation rel, HeapTuple newtuple, bool b
*
* Fills the new tuple.
*/
-void
+LogicalRepRelId
logicalrep_read_insert(StringInfo in, LogicalRepTupleData *newtup)
{
char action;
+ LogicalRepRelId relid;
+ relid = pq_getmsgint(in, 4);
action = pq_getmsgbyte(in);
if (action != 'N')
elog(ERROR, "expected new tuple but got %d",
action);
logicalrep_read_tuple(in, newtup);
-
+ return relid;
}
/*
diff --git a/src/backend/replication/logical/worker.c b/src/backend/replication/logical/worker.c
index 10a776325a..93dc8117a5 100644
--- a/src/backend/replication/logical/worker.c
+++ b/src/backend/replication/logical/worker.c
@@ -642,10 +642,10 @@ apply_handle_insert(StringInfo s)
ensure_transaction();
/* read the relation id */
- relid = pq_getmsgint(s, 4);
+ relid = logicalrep_read_insert(s, &newtup);
rel = logicalrep_rel_open(relid, RowExclusiveLock);
- logicalrep_read_insert(s, &newtup);
+
if (!should_apply_changes_for_rel(rel))
{
diff --git a/src/include/replication/logicalproto.h b/src/include/replication/logicalproto.h
index 4d1b7e8c4f..b299a2c226 100644
--- a/src/include/replication/logicalproto.h
+++ b/src/include/replication/logicalproto.h
@@ -91,7 +91,7 @@ extern void logicalrep_write_origin(StringInfo out, const char *origin,
extern char *logicalrep_read_origin(StringInfo in, XLogRecPtr *origin_lsn);
extern void logicalrep_write_insert(StringInfo out, Relation rel,
HeapTuple newtuple, bool binary_basetypes);
-extern void logicalrep_read_insert(StringInfo in, LogicalRepTupleData *newtup);
+extern LogicalRepRelId logicalrep_read_insert(StringInfo in, LogicalRepTupleData *newtup);
extern void logicalrep_write_update(StringInfo out, Relation rel, HeapTuple oldtuple,
HeapTuple newtuple, bool binary_basetypes);
extern void logicalrep_read_update(StringInfo in,
--
2.20.1 (Apple Git-117)
[application/octet-stream] 0005-Remove-C99-declaration-and-code.patch (1.3K, ../../CADK3HHJ-jJ8ROhXBHyGxnZdnvExeKZaNa95xLY2pP8PPBcAniw@mail.gmail.com/7-0005-Remove-C99-declaration-and-code.patch)
download | inline diff:
From 0b3cb5e7e1ac23602254e9e085e7cc7fe67f5464 Mon Sep 17 00:00:00 2001
From: Dave Cramer <[email protected]>
Date: Tue, 5 Nov 2019 07:14:30 -0500
Subject: [PATCH 5/7] Remove C99 declaration and code
---
src/backend/replication/logical/proto.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/backend/replication/logical/proto.c b/src/backend/replication/logical/proto.c
index 9164d36edc..5081905a8d 100644
--- a/src/backend/replication/logical/proto.c
+++ b/src/backend/replication/logical/proto.c
@@ -551,10 +551,11 @@ logicalrep_read_tuple(StringInfo in, LogicalRepTupleData *tuple)
break;
case 'b': /* binary formatted value */
{
+ int len;
tuple->changed[i] = true;
tuple->binary[i] = true;
- int len = pq_getmsgint(in, 4); /* read length */
+ len = pq_getmsgint(in, 4); /* read length */
tuple->values[i].data = palloc(len + 1);
/* and data */
@@ -569,8 +570,9 @@ logicalrep_read_tuple(StringInfo in, LogicalRepTupleData *tuple)
}
case 't': /* text formatted value */
{
+ int len;
tuple->changed[i] = true;
- int len = pq_getmsgint(in, 4); /* read length */
+ len = pq_getmsgint(in, 4); /* read length */
/* and data */
tuple->values[i].data = palloc(len + 1);
--
2.20.1 (Apple Git-117)
[application/octet-stream] 0001-First-pass-at-working-code-without-subscription-opti.patch (21.3K, ../../CADK3HHJ-jJ8ROhXBHyGxnZdnvExeKZaNa95xLY2pP8PPBcAniw@mail.gmail.com/8-0001-First-pass-at-working-code-without-subscription-opti.patch)
download | inline diff:
From b5c08d34cb1ba1275d7a175cc82d86d2fef759c9 Mon Sep 17 00:00:00 2001
From: Dave Cramer <[email protected]>
Date: Tue, 11 Jun 2019 15:35:11 -0400
Subject: [PATCH 1/7] First pass at working code without subscription options
---
src/backend/replication/logical/proto.c | 108 ++++++++++-------
src/backend/replication/logical/worker.c | 124 ++++++++++++++------
src/backend/replication/pgoutput/pgoutput.c | 34 +++++-
src/include/replication/logicalproto.h | 20 ++--
src/include/replication/pgoutput.h | 1 +
5 files changed, 201 insertions(+), 86 deletions(-)
diff --git a/src/backend/replication/logical/proto.c b/src/backend/replication/logical/proto.c
index e7df47de3e..8859aa8e79 100644
--- a/src/backend/replication/logical/proto.c
+++ b/src/backend/replication/logical/proto.c
@@ -16,9 +16,11 @@
#include "catalog/pg_namespace.h"
#include "catalog/pg_type.h"
#include "libpq/pqformat.h"
+#include "replication/logicalrelation.h"
#include "replication/logicalproto.h"
#include "utils/builtins.h"
#include "utils/lsyscache.h"
+#include "utils/rel.h"
#include "utils/syscache.h"
/*
@@ -31,7 +33,7 @@
static void logicalrep_write_attrs(StringInfo out, Relation rel);
static void logicalrep_write_tuple(StringInfo out, Relation rel,
- HeapTuple tuple);
+ HeapTuple tuple, bool binary_basetypes);
static void logicalrep_read_attrs(StringInfo in, LogicalRepRelation *rel);
static void logicalrep_read_tuple(StringInfo in, LogicalRepTupleData *tuple);
@@ -139,7 +141,7 @@ logicalrep_read_origin(StringInfo in, XLogRecPtr *origin_lsn)
* Write INSERT to the output stream.
*/
void
-logicalrep_write_insert(StringInfo out, Relation rel, HeapTuple newtuple)
+logicalrep_write_insert(StringInfo out, Relation rel, HeapTuple newtuple, bool binary_basetypes)
{
pq_sendbyte(out, 'I'); /* action INSERT */
@@ -151,7 +153,7 @@ logicalrep_write_insert(StringInfo out, Relation rel, HeapTuple newtuple)
pq_sendint32(out, RelationGetRelid(rel));
pq_sendbyte(out, 'N'); /* new tuple follows */
- logicalrep_write_tuple(out, rel, newtuple);
+ logicalrep_write_tuple(out, rel, newtuple, binary_basetypes);
}
/*
@@ -159,14 +161,10 @@ logicalrep_write_insert(StringInfo out, Relation rel, HeapTuple newtuple)
*
* Fills the new tuple.
*/
-LogicalRepRelId
+void
logicalrep_read_insert(StringInfo in, LogicalRepTupleData *newtup)
{
char action;
- LogicalRepRelId relid;
-
- /* read the relation id */
- relid = pq_getmsgint(in, 4);
action = pq_getmsgbyte(in);
if (action != 'N')
@@ -175,7 +173,6 @@ logicalrep_read_insert(StringInfo in, LogicalRepTupleData *newtup)
logicalrep_read_tuple(in, newtup);
- return relid;
}
/*
@@ -183,7 +180,7 @@ logicalrep_read_insert(StringInfo in, LogicalRepTupleData *newtup)
*/
void
logicalrep_write_update(StringInfo out, Relation rel, HeapTuple oldtuple,
- HeapTuple newtuple)
+ HeapTuple newtuple, bool binary_basetypes)
{
pq_sendbyte(out, 'U'); /* action UPDATE */
@@ -200,26 +197,22 @@ logicalrep_write_update(StringInfo out, Relation rel, HeapTuple oldtuple,
pq_sendbyte(out, 'O'); /* old tuple follows */
else
pq_sendbyte(out, 'K'); /* old key follows */
- logicalrep_write_tuple(out, rel, oldtuple);
+ logicalrep_write_tuple(out, rel, oldtuple, binary_basetypes);
}
pq_sendbyte(out, 'N'); /* new tuple follows */
- logicalrep_write_tuple(out, rel, newtuple);
+ logicalrep_write_tuple(out, rel, newtuple, binary_basetypes);
}
/*
* Read UPDATE from stream.
*/
-LogicalRepRelId
+void
logicalrep_read_update(StringInfo in, bool *has_oldtuple,
LogicalRepTupleData *oldtup,
LogicalRepTupleData *newtup)
{
char action;
- LogicalRepRelId relid;
-
- /* read the relation id */
- relid = pq_getmsgint(in, 4);
/* read and verify action */
action = pq_getmsgbyte(in);
@@ -245,14 +238,13 @@ logicalrep_read_update(StringInfo in, bool *has_oldtuple,
logicalrep_read_tuple(in, newtup);
- return relid;
}
/*
* Write DELETE to the output stream.
*/
void
-logicalrep_write_delete(StringInfo out, Relation rel, HeapTuple oldtuple)
+logicalrep_write_delete(StringInfo out, Relation rel, HeapTuple oldtuple, bool binary_basetypes)
{
Assert(rel->rd_rel->relreplident == REPLICA_IDENTITY_DEFAULT ||
rel->rd_rel->relreplident == REPLICA_IDENTITY_FULL ||
@@ -268,7 +260,7 @@ logicalrep_write_delete(StringInfo out, Relation rel, HeapTuple oldtuple)
else
pq_sendbyte(out, 'K'); /* old key follows */
- logicalrep_write_tuple(out, rel, oldtuple);
+ logicalrep_write_tuple(out, rel, oldtuple, binary_basetypes);
}
/*
@@ -276,14 +268,10 @@ logicalrep_write_delete(StringInfo out, Relation rel, HeapTuple oldtuple)
*
* Fills the old tuple.
*/
-LogicalRepRelId
+void
logicalrep_read_delete(StringInfo in, LogicalRepTupleData *oldtup)
{
char action;
- LogicalRepRelId relid;
-
- /* read the relation id */
- relid = pq_getmsgint(in, 4);
/* read and verify action */
action = pq_getmsgbyte(in);
@@ -292,7 +280,6 @@ logicalrep_read_delete(StringInfo in, LogicalRepTupleData *oldtup)
logicalrep_read_tuple(in, oldtup);
- return relid;
}
/*
@@ -441,7 +428,7 @@ logicalrep_read_typ(StringInfo in, LogicalRepTyp *ltyp)
* Write a tuple to the outputstream, in the most efficient format possible.
*/
static void
-logicalrep_write_tuple(StringInfo out, Relation rel, HeapTuple tuple)
+logicalrep_write_tuple(StringInfo out, Relation rel, HeapTuple tuple, bool binary_basetypes)
{
TupleDesc desc;
Datum values[MaxTupleAttributeNumber];
@@ -457,6 +444,7 @@ logicalrep_write_tuple(StringInfo out, Relation rel, HeapTuple tuple)
continue;
nliveatts++;
}
+
pq_sendint16(out, nliveatts);
/* try to allocate enough memory from the get-go */
@@ -492,12 +480,31 @@ logicalrep_write_tuple(StringInfo out, Relation rel, HeapTuple tuple)
elog(ERROR, "cache lookup failed for type %u", att->atttypid);
typclass = (Form_pg_type) GETSTRUCT(typtup);
- pq_sendbyte(out, 't'); /* 'text' data follows */
- outputstr = OidOutputFunctionCall(typclass->typoutput, values[i]);
- pq_sendcountedtext(out, outputstr, strlen(outputstr), false);
- pfree(outputstr);
+ if (binary_basetypes &&
+ OidIsValid(typclass->typreceive) &&
+ (att->atttypid < FirstNormalObjectId || typclass->typtype != 'c') &&
+ (att->atttypid < FirstNormalObjectId || typclass->typelem == InvalidOid))
+ {
+ bytea *outputbytes;
+ int len;
+ pq_sendbyte(out, 'b'); /* binary send/recv data follows */
+
+ outputbytes = OidSendFunctionCall(typclass->typsend,
+ values[i]);
+ len = VARSIZE(outputbytes) - VARHDRSZ;
+ pq_sendint(out, len, 4); /* length */
+ pq_sendbytes(out, VARDATA(outputbytes), len); /* data */
+ pfree(outputbytes);
+ }
+ else
+ {
+ pq_sendbyte(out, 't'); /* 'text' data follows */
+ outputstr = OidOutputFunctionCall(typclass->typoutput, values[i]);
+ pq_sendcountedtext(out, outputstr, strlen(outputstr), false);
+ pfree(outputstr);
+ }
ReleaseSysCache(typtup);
}
}
@@ -518,6 +525,9 @@ logicalrep_read_tuple(StringInfo in, LogicalRepTupleData *tuple)
memset(tuple->changed, 0, sizeof(tuple->changed));
+ /* default is text */
+ memset(tuple->binary, 0, sizeof(tuple->binary));
+
/* Read the data */
for (i = 0; i < natts; i++)
{
@@ -528,25 +538,43 @@ logicalrep_read_tuple(StringInfo in, LogicalRepTupleData *tuple)
switch (kind)
{
case 'n': /* null */
- tuple->values[i] = NULL;
+ tuple->values[i].len = 0;
+ tuple->values[i].data = NULL;
tuple->changed[i] = true;
break;
case 'u': /* unchanged column */
/* we don't receive the value of an unchanged column */
- tuple->values[i] = NULL;
+ tuple->values[i].len = 0;
+ tuple->values[i].data = NULL;
break;
- case 't': /* text formatted value */
+ case 'b': /* binary formatted value */
{
- int len;
-
tuple->changed[i] = true;
+ tuple->binary[i] = true;
+
+ int len = pq_getmsgint(in, 4); /* read length */
- len = pq_getmsgint(in, 4); /* read length */
+ tuple->values[i].data = palloc(len + 1);
+ /* and data */
+
+ pq_copymsgbytes(in, tuple->values[i].data, len);
+ tuple->values[i].len = len;
+ tuple->values[i].cursor = 0;
+ tuple->values[i].maxlen = len;
+ /* not strictly necessary but the docs say it is required */
+ tuple->values[i].data[len] = '\0';
+ break;
+ }
+ case 't': /* text formatted value */
+ {
+ tuple->changed[i] = true;
+ int len = pq_getmsgint(in, 4); /* read length */
/* and data */
- tuple->values[i] = palloc(len + 1);
- pq_copymsgbytes(in, tuple->values[i], len);
- tuple->values[i][len] = '\0';
+ tuple->values[i].data = palloc(len + 1);
+ pq_copymsgbytes(in, tuple->values[i].data, len);
+ tuple->values[i].data[len] = '\0';
+ tuple->values[i].len = len;
}
break;
default:
diff --git a/src/backend/replication/logical/worker.c b/src/backend/replication/logical/worker.c
index ced0d191c2..9a70649134 100644
--- a/src/backend/replication/logical/worker.c
+++ b/src/backend/replication/logical/worker.c
@@ -296,13 +296,12 @@ slot_store_error_callback(void *arg)
}
/*
- * Store data in C string form into slot.
- * This is similar to BuildTupleFromCStrings but TupleTableSlot fits our
- * use better.
+ * Store data into slot.
+ * Data can be either text or binary transfer format
*/
static void
-slot_store_cstrings(TupleTableSlot *slot, LogicalRepRelMapEntry *rel,
- char **values)
+slot_store_data(TupleTableSlot *slot, LogicalRepRelMapEntry *rel,
+ LogicalRepTupleData *tupleData)
{
int natts = slot->tts_tupleDescriptor->natts;
int i;
@@ -327,18 +326,40 @@ slot_store_cstrings(TupleTableSlot *slot, LogicalRepRelMapEntry *rel,
int remoteattnum = rel->attrmap[i];
if (!att->attisdropped && remoteattnum >= 0 &&
- values[remoteattnum] != NULL)
+ tupleData->values[remoteattnum].data != NULL)
{
- Oid typinput;
- Oid typioparam;
errarg.local_attnum = i;
errarg.remote_attnum = remoteattnum;
- getTypeInputInfo(att->atttypid, &typinput, &typioparam);
- slot->tts_values[i] =
- OidInputFunctionCall(typinput, values[remoteattnum],
- typioparam, att->atttypmod);
+ if (tupleData->binary[remoteattnum])
+ {
+ Oid typreceive;
+ Oid typioparam;
+
+ getTypeBinaryInputInfo(att->atttypid, &typreceive, &typioparam);
+
+ int cursor = tupleData->values[remoteattnum].cursor;
+ slot->tts_values[i] =
+ OidReceiveFunctionCall(typreceive, &tupleData->values[remoteattnum],
+ typioparam, att->atttypmod);
+ /*
+ * Do not advance the cursor in case we need to re-read this
+ * This saves us from pushing all of this type logic into proto.c
+ */
+ tupleData->values[remoteattnum].cursor = cursor;
+
+ }
+ else
+ {
+ Oid typinput;
+ Oid typioparam;
+
+ getTypeInputInfo(att->atttypid, &typinput, &typioparam);
+ slot->tts_values[i] =
+ OidInputFunctionCall(typinput, tupleData->values[remoteattnum].data,
+ typioparam, att->atttypmod);
+ }
slot->tts_isnull[i] = false;
errarg.local_attnum = -1;
@@ -372,11 +393,17 @@ slot_store_cstrings(TupleTableSlot *slot, LogicalRepRelMapEntry *rel,
* Caution: unreplaced pass-by-ref columns in "slot" will point into the
* storage for "srcslot". This is OK for current usage, but someday we may
* need to materialize "slot" at the end to make it independent of "srcslot".
+ *
+ * TODO: figure out the right comment here
+ * Modify slot with user data provided.
+ * This is somewhat similar to heap_modify_tuple but also calls the type
+ * input function on the user data as the input is either text or binary transfer
+ * format
*/
static void
-slot_modify_cstrings(TupleTableSlot *slot, TupleTableSlot *srcslot,
- LogicalRepRelMapEntry *rel,
- char **values, bool *replaces)
+slot_modify_data(TupleTableSlot *slot, TupleTableSlot *srcslot,
+ LogicalRepRelMapEntry *rel,
+ LogicalRepTupleData *tupleData)
{
int natts = slot->tts_tupleDescriptor->natts;
int i;
@@ -413,21 +440,43 @@ slot_modify_cstrings(TupleTableSlot *slot, TupleTableSlot *srcslot,
if (remoteattnum < 0)
continue;
- if (!replaces[remoteattnum])
+ if (!tupleData->changed[remoteattnum])
continue;
- if (values[remoteattnum] != NULL)
+ if (tupleData->values[remoteattnum].data != NULL)
{
- Oid typinput;
- Oid typioparam;
errarg.local_attnum = i;
errarg.remote_attnum = remoteattnum;
- getTypeInputInfo(att->atttypid, &typinput, &typioparam);
- slot->tts_values[i] =
- OidInputFunctionCall(typinput, values[remoteattnum],
- typioparam, att->atttypmod);
+ if (tupleData->binary[remoteattnum])
+ {
+ Oid typreceive;
+ Oid typioparam;
+
+ getTypeBinaryInputInfo(att->atttypid, &typreceive, &typioparam);
+
+
+ int cursor = tupleData->values[remoteattnum].cursor;
+ slot->tts_values[i] =
+ OidReceiveFunctionCall(typreceive, &tupleData->values[remoteattnum],
+ typioparam, att->atttypmod);
+ /*
+ * Do not advance the cursor in case we need to re-read this
+ * This saves us from pushing all of this type logic into proto.c
+ */
+ tupleData->values[remoteattnum].cursor = cursor;
+ }
+ else
+ {
+ Oid typinput;
+ Oid typioparam;
+
+ getTypeInputInfo(att->atttypid, &typinput, &typioparam);
+ slot->tts_values[i] =
+ OidInputFunctionCall(typinput, tupleData->values[remoteattnum].data,
+ typioparam, att->atttypmod);
+ }
slot->tts_isnull[i] = false;
errarg.local_attnum = -1;
@@ -592,8 +641,12 @@ apply_handle_insert(StringInfo s)
ensure_transaction();
- relid = logicalrep_read_insert(s, &newtup);
+ /* read the relation id */
+ relid = pq_getmsgint(s, 4);
rel = logicalrep_rel_open(relid, RowExclusiveLock);
+
+ logicalrep_read_insert(s, &newtup);
+
if (!should_apply_changes_for_rel(rel))
{
/*
@@ -615,7 +668,7 @@ apply_handle_insert(StringInfo s)
/* Process and store remote tuple in the slot */
oldctx = MemoryContextSwitchTo(GetPerTupleMemoryContext(estate));
- slot_store_cstrings(remoteslot, rel, newtup.values);
+ slot_store_data(remoteslot, rel, &newtup);
slot_fill_defaults(rel, estate, remoteslot);
MemoryContextSwitchTo(oldctx);
@@ -695,9 +748,12 @@ apply_handle_update(StringInfo s)
ensure_transaction();
- relid = logicalrep_read_update(s, &has_oldtup, &oldtup,
- &newtup);
+ /* read the relation id */
+ relid = pq_getmsgint(s, 4);
rel = logicalrep_rel_open(relid, RowExclusiveLock);
+
+ logicalrep_read_update(s, &has_oldtup, &oldtup,
+ &newtup);
if (!should_apply_changes_for_rel(rel))
{
/*
@@ -725,8 +781,8 @@ apply_handle_update(StringInfo s)
/* Build the search tuple. */
oldctx = MemoryContextSwitchTo(GetPerTupleMemoryContext(estate));
- slot_store_cstrings(remoteslot, rel,
- has_oldtup ? oldtup.values : newtup.values);
+ slot_store_data(remoteslot, rel,
+ has_oldtup ? &oldtup : &newtup);
MemoryContextSwitchTo(oldctx);
/*
@@ -756,8 +812,7 @@ apply_handle_update(StringInfo s)
{
/* Process and store remote tuple in the slot */
oldctx = MemoryContextSwitchTo(GetPerTupleMemoryContext(estate));
- slot_modify_cstrings(remoteslot, localslot, rel,
- newtup.values, newtup.changed);
+ slot_modify_data(remoteslot, localslot, rel, &newtup);
MemoryContextSwitchTo(oldctx);
EvalPlanQualSetSlot(&epqstate, remoteslot);
@@ -815,8 +870,11 @@ apply_handle_delete(StringInfo s)
ensure_transaction();
- relid = logicalrep_read_delete(s, &oldtup);
+ /* read the relation id */
+ relid = pq_getmsgint(s, 4);
rel = logicalrep_rel_open(relid, RowExclusiveLock);
+
+ logicalrep_read_delete(s, &oldtup);
if (!should_apply_changes_for_rel(rel))
{
/*
@@ -844,7 +902,7 @@ apply_handle_delete(StringInfo s)
/* Find the tuple using the replica identity index. */
oldctx = MemoryContextSwitchTo(GetPerTupleMemoryContext(estate));
- slot_store_cstrings(remoteslot, rel, oldtup.values);
+ slot_store_data(remoteslot, rel, &oldtup);
MemoryContextSwitchTo(oldctx);
/*
diff --git a/src/backend/replication/pgoutput/pgoutput.c b/src/backend/replication/pgoutput/pgoutput.c
index 3483c1b877..2cb8624e9e 100644
--- a/src/backend/replication/pgoutput/pgoutput.c
+++ b/src/backend/replication/pgoutput/pgoutput.c
@@ -87,11 +87,15 @@ _PG_output_plugin_init(OutputPluginCallbacks *cb)
static void
parse_output_parameters(List *options, uint32 *protocol_version,
- List **publication_names)
+ List **publication_names, bool *binary_basetypes)
{
ListCell *lc;
bool protocol_version_given = false;
bool publication_names_given = false;
+ bool binary_option_given = false;
+
+ // default to false
+ *binary_basetypes = false;
foreach(lc, options)
{
@@ -137,6 +141,22 @@ parse_output_parameters(List *options, uint32 *protocol_version,
(errcode(ERRCODE_INVALID_NAME),
errmsg("invalid publication_names syntax")));
}
+ else if (strcmp(defel->defname, "binary") == 0 )
+ {
+ bool parsed;
+ if (binary_option_given)
+ ereport(ERROR,
+ (errcode(ERRCODE_SYNTAX_ERROR),
+ errmsg("conflicting or redundant options")));
+ binary_option_given = true;
+
+ if (!parse_bool(strVal(defel->arg), &parsed))
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("invalid binary option")));
+
+ *binary_basetypes = parsed;
+ }
else
elog(ERROR, "unrecognized pgoutput option: %s", defel->defname);
}
@@ -171,7 +191,8 @@ pgoutput_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
/* Parse the params and ERROR if we see any we don't recognize */
parse_output_parameters(ctx->output_plugin_options,
&data->protocol_version,
- &data->publication_names);
+ &data->publication_names,
+ &data->binary_basetypes);
/* Check if we support requested protocol */
if (data->protocol_version > LOGICALREP_PROTO_VERSION_NUM)
@@ -343,7 +364,8 @@ pgoutput_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
case REORDER_BUFFER_CHANGE_INSERT:
OutputPluginPrepareWrite(ctx, true);
logicalrep_write_insert(ctx->out, relation,
- &change->data.tp.newtuple->tuple);
+ &change->data.tp.newtuple->tuple,
+ data->binary_basetypes);
OutputPluginWrite(ctx, true);
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -353,7 +375,8 @@ pgoutput_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
OutputPluginPrepareWrite(ctx, true);
logicalrep_write_update(ctx->out, relation, oldtuple,
- &change->data.tp.newtuple->tuple);
+ &change->data.tp.newtuple->tuple,
+ data->binary_basetypes);
OutputPluginWrite(ctx, true);
break;
}
@@ -362,7 +385,8 @@ pgoutput_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
{
OutputPluginPrepareWrite(ctx, true);
logicalrep_write_delete(ctx->out, relation,
- &change->data.tp.oldtuple->tuple);
+ &change->data.tp.oldtuple->tuple,
+ data->binary_basetypes);
OutputPluginWrite(ctx, true);
}
else
diff --git a/src/include/replication/logicalproto.h b/src/include/replication/logicalproto.h
index 3fc430af01..4d1b7e8c4f 100644
--- a/src/include/replication/logicalproto.h
+++ b/src/include/replication/logicalproto.h
@@ -30,8 +30,12 @@
/* Tuple coming via logical replication. */
typedef struct LogicalRepTupleData
{
- /* column values in text format, or NULL for a null value: */
- char *values[MaxTupleAttributeNumber];
+ /* column values */
+ StringInfoData values[MaxTupleAttributeNumber];
+
+ /* markers for binary */
+ bool binary[MaxTupleAttributeNumber];
+
/* markers for changed/unchanged column values: */
bool changed[MaxTupleAttributeNumber];
} LogicalRepTupleData;
@@ -86,16 +90,16 @@ extern void logicalrep_write_origin(StringInfo out, const char *origin,
XLogRecPtr origin_lsn);
extern char *logicalrep_read_origin(StringInfo in, XLogRecPtr *origin_lsn);
extern void logicalrep_write_insert(StringInfo out, Relation rel,
- HeapTuple newtuple);
-extern LogicalRepRelId logicalrep_read_insert(StringInfo in, LogicalRepTupleData *newtup);
+ HeapTuple newtuple, bool binary_basetypes);
+extern void logicalrep_read_insert(StringInfo in, LogicalRepTupleData *newtup);
extern void logicalrep_write_update(StringInfo out, Relation rel, HeapTuple oldtuple,
- HeapTuple newtuple);
-extern LogicalRepRelId logicalrep_read_update(StringInfo in,
+ HeapTuple newtuple, bool binary_basetypes);
+extern void logicalrep_read_update(StringInfo in,
bool *has_oldtuple, LogicalRepTupleData *oldtup,
LogicalRepTupleData *newtup);
extern void logicalrep_write_delete(StringInfo out, Relation rel,
- HeapTuple oldtuple);
-extern LogicalRepRelId logicalrep_read_delete(StringInfo in,
+ HeapTuple oldtuple, bool binary_basetypes);
+extern void logicalrep_read_delete(StringInfo in,
LogicalRepTupleData *oldtup);
extern void logicalrep_write_truncate(StringInfo out, int nrelids, Oid relids[],
bool cascade, bool restart_seqs);
diff --git a/src/include/replication/pgoutput.h b/src/include/replication/pgoutput.h
index 8870721bcd..933038f385 100644
--- a/src/include/replication/pgoutput.h
+++ b/src/include/replication/pgoutput.h
@@ -25,6 +25,7 @@ typedef struct PGOutputData
List *publication_names;
List *publications;
+ bool binary_basetypes;
} PGOutputData;
#endif /* PGOUTPUT_H */
--
2.20.1 (Apple Git-117)
[application/octet-stream] 0007-check-that-the-subscriber-is-compatible-with-the-pub.patch (7.6K, ../../CADK3HHJ-jJ8ROhXBHyGxnZdnvExeKZaNa95xLY2pP8PPBcAniw@mail.gmail.com/9-0007-check-that-the-subscriber-is-compatible-with-the-pub.patch)
download | inline diff:
From 424d9cd3a72c9119aefa4e9481bfd63bb8bfc855 Mon Sep 17 00:00:00 2001
From: Dave Cramer <[email protected]>
Date: Mon, 11 Nov 2019 14:38:08 -0500
Subject: [PATCH 7/7] check that the subscriber is compatible with the
publisher
---
.../libpqwalreceiver/libpqwalreceiver.c | 36 +++-
src/backend/replication/pgoutput/pgoutput.c | 179 ++++++++++++++++++
2 files changed, 212 insertions(+), 3 deletions(-)
diff --git a/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c b/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c
index c4daea33d2..88693afa88 100644
--- a/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c
+++ b/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c
@@ -400,7 +400,6 @@ libpqrcv_startstreaming(WalReceiverConn *conn,
char *pubnames_str;
List *pubnames;
char *pubnames_literal;
- bool binary;
appendStringInfoString(&cmd, " (");
@@ -422,9 +421,40 @@ libpqrcv_startstreaming(WalReceiverConn *conn,
appendStringInfo(&cmd, ", publication_names %s", pubnames_literal);
PQfreemem(pubnames_literal);
pfree(pubnames_str);
- if (options->proto.logical.binary)
+ if (options->proto.logical.binary) {
appendStringInfo(&cmd, ", binary 'true'");
-
+ appendStringInfo(&cmd, ", sizeof_datum %zu", sizeof(Datum));
+ appendStringInfo(&cmd, ", sizeof_int %zu", sizeof(int));
+ appendStringInfo(&cmd, ", sizeof_long %zu", sizeof(long));
+ appendStringInfo(&cmd, ", bigendian %d",
+#ifdef WORDS_BIGENDIAN
+ true
+#else
+ false
+#endif
+ );
+ appendStringInfo(&cmd, ", float4_byval %d",
+#ifdef USE_FLOAT4_BYVAL
+ true
+#else
+ false
+#endif
+ );
+ appendStringInfo(&cmd, ", float8_byval %d",
+#ifdef USE_FLOAT8_BYVAL
+ true
+#else
+ false
+#endif
+ );
+ appendStringInfo(&cmd, ", integer_datetimes %d",
+#ifdef USE_INTEGER_DATETIMES
+ true
+#else
+ false
+#endif
+ );
+ }
appendStringInfoChar(&cmd, ')');
}
else
diff --git a/src/backend/replication/pgoutput/pgoutput.c b/src/backend/replication/pgoutput/pgoutput.c
index 2cb8624e9e..d46095998e 100644
--- a/src/backend/replication/pgoutput/pgoutput.c
+++ b/src/backend/replication/pgoutput/pgoutput.c
@@ -93,10 +93,25 @@ parse_output_parameters(List *options, uint32 *protocol_version,
bool protocol_version_given = false;
bool publication_names_given = false;
bool binary_option_given = false;
+ bool sizeof_int_given = false;
+ bool sizeof_datum_given = false;
+ bool sizeof_long_given = false;
+ bool big_endian_given = false;
+ bool float4_byval_given = false;
+ bool float8_byval_given = false;
+ bool integer_datetimes_given = false;
+ long datum_size;
+ long int_size;
+ long long_size;
+ bool bigendian;
+ bool float4_byval;
+ bool float8_byval;
+ bool integer_datetimes;
// default to false
*binary_basetypes = false;
+
foreach(lc, options)
{
DefElem *defel = (DefElem *) lfirst(lc);
@@ -156,10 +171,174 @@ parse_output_parameters(List *options, uint32 *protocol_version,
errmsg("invalid binary option")));
*binary_basetypes = parsed;
+
+
+ }
+ else if (strcmp(defel->defname, "sizeof_datum") == 0)
+ {
+
+ if (sizeof_datum_given)
+ ereport(ERROR,
+ (errcode(ERRCODE_SYNTAX_ERROR),
+ errmsg("conflicting or redundant options")));
+ sizeof_datum_given = true;
+
+ if (!scanint8(strVal(defel->arg), true, &datum_size))
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("invalid sizeof_datum option")));
+ }
+ else if (strcmp(defel->defname, "sizeof_int") == 0)
+ {
+
+ if (sizeof_int_given)
+ ereport(ERROR,
+ (errcode(ERRCODE_SYNTAX_ERROR),
+ errmsg("conflicting or redundant options")));
+ sizeof_int_given = true;
+
+ if (!scanint8(strVal(defel->arg), true, &int_size))
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("invalid sizeof_int option")));
+ }
+ else if (strcmp(defel->defname, "sizeof_long") == 0)
+ {
+
+ if (sizeof_long_given)
+ ereport(ERROR,
+ (errcode(ERRCODE_SYNTAX_ERROR),
+ errmsg("conflicting or redundant options")));
+ sizeof_int_given = true;
+
+ if (!scanint8(strVal(defel->arg), true, &long_size))
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("invalid sizeof_long option")));
+ }
+ else if (strcmp(defel->defname, "bigendian") == 0)
+ {
+
+ if (big_endian_given)
+ ereport(ERROR,
+ (errcode(ERRCODE_SYNTAX_ERROR),
+ errmsg("conflicting or redundant options")));
+ big_endian_given = true;
+
+ if (!parse_bool(strVal(defel->arg), &bigendian))
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("invalid bigendian option")));
+ }
+ else if (strcmp(defel->defname, "float4_byval") == 0)
+ {
+
+ if (float4_byval_given)
+ ereport(ERROR,
+ (errcode(ERRCODE_SYNTAX_ERROR),
+ errmsg("conflicting or redundant options")));
+ float4_byval_given = true;
+
+ if (!parse_bool(strVal(defel->arg), &float4_byval))
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("invalid float4_byval option")));
+ }
+ else if (strcmp(defel->defname, "float8_byval") == 0)
+ {
+
+ if (float8_byval_given)
+ ereport(ERROR,
+ (errcode(ERRCODE_SYNTAX_ERROR),
+ errmsg("conflicting or redundant options")));
+ float8_byval_given = true;
+
+ if (!parse_bool(strVal(defel->arg), &float8_byval))
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("invalid float8_byval option")));
+ }
+ else if (strcmp(defel->defname, "integer_date_times") == 0)
+ {
+
+ if (integer_datetimes_given)
+ ereport(ERROR,
+ (errcode(ERRCODE_SYNTAX_ERROR),
+ errmsg("conflicting or redundant options")));
+ integer_datetimes_given = true;
+
+ if (!parse_bool(strVal(defel->arg), &integer_datetimes))
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("invalid integer_date_times option")));
}
else
elog(ERROR, "unrecognized pgoutput option: %s", defel->defname);
}
+
+/*
+ * after we know that the subscriber is requesting binary check to make sure
+ * we are compatible with the subscriber.
+ */
+ if ( *binary_basetypes == true )
+ {
+ if (sizeof(Datum) != datum_size)
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("incompatible datum size")));
+
+ if (sizeof(int) != int_size)
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("incompatible integer size")));
+
+ if (sizeof(long) != long_size)
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("incompatible long size")));
+ if(
+#ifdef WORDS_BIGENDIAN
+ true
+#else
+ false
+#endif
+ != bigendian)
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("incompatible endianness")));
+ if( float4_byval !=
+#ifdef USE_FLOAT4_BYVAL
+ true
+#else
+ false
+#endif
+ )
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("incompatible float4_byval")));
+ if( float8_byval !=
+#ifdef USE_FLOAT4_BYVAL
+ true
+#else
+ false
+#endif
+ )
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("incompatible float8_byval")));
+
+ if ( integer_datetimes !=
+#ifdef USE_INTEGER_DATETIMES
+ true
+#else
+ false
+#endif
+ )
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("incompatible integer_datetimes")));
+
+ }
}
/*
--
2.20.1 (Apple Git-117)
^ permalink raw reply [nested|flat] 1606+ messages in thread
* Re: Binary support for pgoutput plugin
2020-02-28 23:34 Re: Binary support for pgoutput plugin Tom Lane <[email protected]>
2020-02-29 15:44 ` Re: Binary support for pgoutput plugin Dave Cramer <[email protected]>
@ 2020-03-06 16:54 ` Petr Jelinek <[email protected]>
2020-03-07 23:18 ` Re: Binary support for pgoutput plugin Dave Cramer <[email protected]>
0 siblings, 1 reply; 1606+ messages in thread
From: Petr Jelinek @ 2020-03-06 16:54 UTC (permalink / raw)
To: Dave Cramer <[email protected]>; Tom Lane <[email protected]>; +Cc: Michael Paquier <[email protected]>; Alvaro Herrera <[email protected]>; Dmitry Dolgov <[email protected]>; Thomas Munro <[email protected]>; Tomas Vondra <[email protected]>; Petr Jelinek <[email protected]>; Andres Freund <[email protected]>; pgsql-hackers
Hi Dave,
On 29/02/2020 18:44, Dave Cramer wrote:
>
>
> rebased and removed the catversion bump.
Looked into this and it generally seems okay, but I do have one gripe here:
> + tuple->values[i].data = palloc(len + 1);
> + /* and data */
> +
> + pq_copymsgbytes(in, tuple->values[i].data, len);
> + tuple->values[i].len = len;
> + tuple->values[i].cursor = 0;
> + tuple->values[i].maxlen = len;
> + /* not strictly necessary but the docs say it is required */
> + tuple->values[i].data[len] = '\0';
> + break;
> + }
> + case 't': /* text formatted value */
> + {
> + tuple->changed[i] = true;
> + int len = pq_getmsgint(in, 4); /* read length */
>
> /* and data */
> - tuple->values[i] = palloc(len + 1);
> - pq_copymsgbytes(in, tuple->values[i], len);
> - tuple->values[i][len] = '\0';
> + tuple->values[i].data = palloc(len + 1);
> + pq_copymsgbytes(in, tuple->values[i].data, len);
> + tuple->values[i].data[len] = '\0';
> + tuple->values[i].len = len;
The cursor should be set to 0 in the text formatted case too if this is
how we chose to encode data.
However I am not quite convinced I like the StringInfoData usage here.
Why not just change the struct to include additional array of lengths
rather than replacing the existing values array with StringInfoData
array, that seems generally both simpler and should have smaller memory
footprint too, no?
We could also merge the binary and changed arrays into single char array
named something like format (as data can be either unchanged, binary or
text) and just reuse same identifiers we have in protocol.
--
Petr Jelinek
2ndQuadrant - PostgreSQL Solutions for the Enterprise
https://www.2ndQuadrant.com/
^ permalink raw reply [nested|flat] 1606+ messages in thread
* Re: Binary support for pgoutput plugin
2020-02-28 23:34 Re: Binary support for pgoutput plugin Tom Lane <[email protected]>
2020-02-29 15:44 ` Re: Binary support for pgoutput plugin Dave Cramer <[email protected]>
2020-03-06 16:54 ` Re: Binary support for pgoutput plugin Petr Jelinek <[email protected]>
@ 2020-03-07 23:18 ` Dave Cramer <[email protected]>
2020-04-03 07:42 ` Re: Binary support for pgoutput plugin Petr Jelinek <[email protected]>
0 siblings, 1 reply; 1606+ messages in thread
From: Dave Cramer @ 2020-03-07 23:18 UTC (permalink / raw)
To: Petr Jelinek <[email protected]>; +Cc: Tom Lane <[email protected]>; Michael Paquier <[email protected]>; Alvaro Herrera <[email protected]>; Dmitry Dolgov <[email protected]>; Thomas Munro <[email protected]>; Tomas Vondra <[email protected]>; Petr Jelinek <[email protected]>; Andres Freund <[email protected]>; pgsql-hackers
On Fri, 6 Mar 2020 at 08:54, Petr Jelinek <[email protected]> wrote:
> Hi Dave,
>
> On 29/02/2020 18:44, Dave Cramer wrote:
> >
> >
> > rebased and removed the catversion bump.
>
> Looked into this and it generally seems okay, but I do have one gripe here:
>
> > + tuple->values[i].data = palloc(len
> + 1);
> > + /* and data */
> > +
> > + pq_copymsgbytes(in,
> tuple->values[i].data, len);
> > + tuple->values[i].len = len;
> > + tuple->values[i].cursor = 0;
> > + tuple->values[i].maxlen = len;
> > + /* not strictly necessary but the
> docs say it is required */
> > + tuple->values[i].data[len] = '\0';
> > + break;
> > + }
> > + case 't': /* text formatted
> value */
> > + {
> > + tuple->changed[i] = true;
> > + int len = pq_getmsgint(in, 4); /*
> read length */
> >
> > /* and data */
> > - tuple->values[i] = palloc(len + 1);
> > - pq_copymsgbytes(in,
> tuple->values[i], len);
> > - tuple->values[i][len] = '\0';
> > + tuple->values[i].data = palloc(len
> + 1);
> > + pq_copymsgbytes(in,
> tuple->values[i].data, len);
> > + tuple->values[i].data[len] = '\0';
> > + tuple->values[i].len = len;
>
> The cursor should be set to 0 in the text formatted case too if this is
> how we chose to encode data.
>
> However I am not quite convinced I like the StringInfoData usage here.
> Why not just change the struct to include additional array of lengths
> rather than replacing the existing values array with StringInfoData
> array, that seems generally both simpler and should have smaller memory
> footprint too, no?
>
Can you explain this a bit more? I don't really see a huge difference in
memory usage.
We still need length and the data copied into LogicalRepTupleData when
sending the data in binary, no?
>
> We could also merge the binary and changed arrays into single char array
> named something like format (as data can be either unchanged, binary or
> text) and just reuse same identifiers we have in protocol.
>
This seems like a good idea.
Dave Cramer
>
> --
> Petr Jelinek
> 2ndQuadrant - PostgreSQL Solutions for the Enterprise
> https://www.2ndQuadrant.com/
>
^ permalink raw reply [nested|flat] 1606+ messages in thread
* Re: Binary support for pgoutput plugin
2020-02-28 23:34 Re: Binary support for pgoutput plugin Tom Lane <[email protected]>
2020-02-29 15:44 ` Re: Binary support for pgoutput plugin Dave Cramer <[email protected]>
2020-03-06 16:54 ` Re: Binary support for pgoutput plugin Petr Jelinek <[email protected]>
2020-03-07 23:18 ` Re: Binary support for pgoutput plugin Dave Cramer <[email protected]>
@ 2020-04-03 07:42 ` Petr Jelinek <[email protected]>
2020-04-03 20:44 ` Re: Binary support for pgoutput plugin Dave Cramer <[email protected]>
0 siblings, 1 reply; 1606+ messages in thread
From: Petr Jelinek @ 2020-04-03 07:42 UTC (permalink / raw)
To: Dave Cramer <[email protected]>; +Cc: Tom Lane <[email protected]>; Michael Paquier <[email protected]>; Alvaro Herrera <[email protected]>; Dmitry Dolgov <[email protected]>; Thomas Munro <[email protected]>; Tomas Vondra <[email protected]>; Petr Jelinek <[email protected]>; Andres Freund <[email protected]>; pgsql-hackers
Hi,
On 08/03/2020 00:18, Dave Cramer wrote:
> On Fri, 6 Mar 2020 at 08:54, Petr Jelinek <[email protected]
> <mailto:[email protected]>> wrote:
>
> Hi Dave,
>
> On 29/02/2020 18:44, Dave Cramer wrote:
> >
> >
> > rebased and removed the catversion bump.
>
> Looked into this and it generally seems okay, but I do have one
> gripe here:
>
> > +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â tuple->values[i].data =
> palloc(len + 1);
> > +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â /* and data */
> > +
> > +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â pq_copymsgbytes(in,
> tuple->values[i].data, len);
> > +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â tuple->values[i].len = len;
> > +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â tuple->values[i].cursor = 0;
> > +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â tuple->values[i].maxlen = len;
> > +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â /* not strictly necessary
> but the docs say it is required */
> > +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â tuple->values[i].data[len]
> = '\0';
> > +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â break;
> > +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â }
> > +Â Â Â Â Â Â Â Â Â Â Â case 't':Â Â Â Â Â Â Â Â Â Â Â Â /* text
> formatted value */
> > +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â {
> > +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â tuple->changed[i] = true;
> > +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â int len = pq_getmsgint(in,
> 4);Â /* read length */
> >
> >Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â /* and data */
> > -Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â tuple->values[i] =
> palloc(len + 1);
> > -Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â pq_copymsgbytes(in,
> tuple->values[i], len);
> > -Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â tuple->values[i][len] = '\0';
> > +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â tuple->values[i].data =
> palloc(len + 1);
> > +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â pq_copymsgbytes(in,
> tuple->values[i].data, len);
> > +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â tuple->values[i].data[len]
> = '\0';
> > +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â tuple->values[i].len = len;
>
> The cursor should be set to 0 in the text formatted case too if this is
> how we chose to encode data.
>
> However I am not quite convinced I like the StringInfoData usage here.
> Why not just change the struct to include additional array of lengths
> rather than replacing the existing values array with StringInfoData
> array, that seems generally both simpler and should have smaller memory
> footprint too, no?
>
>
> Can you explain this a bit more? I don't really see a huge difference in
> memory usage.
> We still need length and the data copied into LogicalRepTupleData when
> sending the data in binary, no?
>
Yes but we don't need to have fixed sized array of 1600 elements that
contains maxlen and cursor positions of the StringInfoData struct which
we don't use for anything AFAICS.
--
Petr Jelinek
2ndQuadrant - PostgreSQL Solutions for the Enterprise
https://www.2ndQuadrant.com/
^ permalink raw reply [nested|flat] 1606+ messages in thread
* Re: Binary support for pgoutput plugin
2020-02-28 23:34 Re: Binary support for pgoutput plugin Tom Lane <[email protected]>
2020-02-29 15:44 ` Re: Binary support for pgoutput plugin Dave Cramer <[email protected]>
2020-03-06 16:54 ` Re: Binary support for pgoutput plugin Petr Jelinek <[email protected]>
2020-03-07 23:18 ` Re: Binary support for pgoutput plugin Dave Cramer <[email protected]>
2020-04-03 07:42 ` Re: Binary support for pgoutput plugin Petr Jelinek <[email protected]>
@ 2020-04-03 20:44 ` Dave Cramer <[email protected]>
2020-04-07 19:45 ` Re: Binary support for pgoutput plugin Dave Cramer <[email protected]>
0 siblings, 1 reply; 1606+ messages in thread
From: Dave Cramer @ 2020-04-03 20:44 UTC (permalink / raw)
To: Petr Jelinek <[email protected]>; +Cc: Tom Lane <[email protected]>; Michael Paquier <[email protected]>; Alvaro Herrera <[email protected]>; Dmitry Dolgov <[email protected]>; Thomas Munro <[email protected]>; Tomas Vondra <[email protected]>; Petr Jelinek <[email protected]>; Andres Freund <[email protected]>; pgsql-hackers
On Fri, 3 Apr 2020 at 03:43, Petr Jelinek <[email protected]> wrote:
> Hi,
>
> On 08/03/2020 00:18, Dave Cramer wrote:
> > On Fri, 6 Mar 2020 at 08:54, Petr Jelinek <[email protected]
> > <mailto:[email protected]>> wrote:
> >
> > Hi Dave,
> >
> > On 29/02/2020 18:44, Dave Cramer wrote:
> > >
> > >
> > > rebased and removed the catversion bump.
> >
> > Looked into this and it generally seems okay, but I do have one
> > gripe here:
> >
> > > + tuple->values[i].data =
> > palloc(len + 1);
> > > + /* and data */
> > > +
> > > + pq_copymsgbytes(in,
> > tuple->values[i].data, len);
> > > + tuple->values[i].len = len;
> > > + tuple->values[i].cursor = 0;
> > > + tuple->values[i].maxlen =
> len;
> > > + /* not strictly necessary
> > but the docs say it is required */
> > > + tuple->values[i].data[len]
> > = '\0';
> > > + break;
> > > + }
> > > + case 't': /* text
> > formatted value */
> > > + {
> > > + tuple->changed[i] = true;
> > > + int len = pq_getmsgint(in,
> > 4); /* read length */
> > >
> > > /* and data */
> > > - tuple->values[i] =
> > palloc(len + 1);
> > > - pq_copymsgbytes(in,
> > tuple->values[i], len);
> > > - tuple->values[i][len] =
> '\0';
> > > + tuple->values[i].data =
> > palloc(len + 1);
> > > + pq_copymsgbytes(in,
> > tuple->values[i].data, len);
> > > + tuple->values[i].data[len]
> > = '\0';
> > > + tuple->values[i].len = len;
> >
> > The cursor should be set to 0 in the text formatted case too if this
> is
> > how we chose to encode data.
> >
> > However I am not quite convinced I like the StringInfoData usage
> here.
> > Why not just change the struct to include additional array of lengths
> > rather than replacing the existing values array with StringInfoData
> > array, that seems generally both simpler and should have smaller
> memory
> > footprint too, no?
> >
> >
> > Can you explain this a bit more? I don't really see a huge difference in
> > memory usage.
> > We still need length and the data copied into LogicalRepTupleData when
> > sending the data in binary, no?
> >
>
> Yes but we don't need to have fixed sized array of 1600 elements that
> contains maxlen and cursor positions of the StringInfoData struct which
> we don't use for anything AFAICS.
>
OK, I can see an easy way to only allocate the number of elements required
but since OidReceiveFunctionCall takes
StringInfo as one of it's arguments it seems like an easy path unless there
is something I am missing ?
Dave
^ permalink raw reply [nested|flat] 1606+ messages in thread
* Re: Binary support for pgoutput plugin
2020-02-28 23:34 Re: Binary support for pgoutput plugin Tom Lane <[email protected]>
2020-02-29 15:44 ` Re: Binary support for pgoutput plugin Dave Cramer <[email protected]>
2020-03-06 16:54 ` Re: Binary support for pgoutput plugin Petr Jelinek <[email protected]>
2020-03-07 23:18 ` Re: Binary support for pgoutput plugin Dave Cramer <[email protected]>
2020-04-03 07:42 ` Re: Binary support for pgoutput plugin Petr Jelinek <[email protected]>
2020-04-03 20:44 ` Re: Binary support for pgoutput plugin Dave Cramer <[email protected]>
@ 2020-04-07 19:45 ` Dave Cramer <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Dave Cramer @ 2020-04-07 19:45 UTC (permalink / raw)
To: Petr Jelinek <[email protected]>; +Cc: Tom Lane <[email protected]>; Michael Paquier <[email protected]>; Alvaro Herrera <[email protected]>; Dmitry Dolgov <[email protected]>; Thomas Munro <[email protected]>; Tomas Vondra <[email protected]>; Petr Jelinek <[email protected]>; Andres Freund <[email protected]>; pgsql-hackers
On Fri, 3 Apr 2020 at 16:44, Dave Cramer <[email protected]> wrote:
>
>
> On Fri, 3 Apr 2020 at 03:43, Petr Jelinek <[email protected]> wrote:
>
>> Hi,
>>
>> On 08/03/2020 00:18, Dave Cramer wrote:
>> > On Fri, 6 Mar 2020 at 08:54, Petr Jelinek <[email protected]
>> > <mailto:[email protected]>> wrote:
>> >
>> > Hi Dave,
>> >
>> > On 29/02/2020 18:44, Dave Cramer wrote:
>> > >
>> > >
>> > > rebased and removed the catversion bump.
>> >
>> > Looked into this and it generally seems okay, but I do have one
>> > gripe here:
>> >
>> > > + tuple->values[i].data =
>> > palloc(len + 1);
>> > > + /* and data */
>> > > +
>> > > + pq_copymsgbytes(in,
>> > tuple->values[i].data, len);
>> > > + tuple->values[i].len = len;
>> > > + tuple->values[i].cursor =
>> 0;
>> > > + tuple->values[i].maxlen =
>> len;
>> > > + /* not strictly necessary
>> > but the docs say it is required */
>> > > + tuple->values[i].data[len]
>> > = '\0';
>> > > + break;
>> > > + }
>> > > + case 't': /* text
>> > formatted value */
>> > > + {
>> > > + tuple->changed[i] = true;
>> > > + int len = pq_getmsgint(in,
>> > 4); /* read length */
>> > >
>> > > /* and data */
>> > > - tuple->values[i] =
>> > palloc(len + 1);
>> > > - pq_copymsgbytes(in,
>> > tuple->values[i], len);
>> > > - tuple->values[i][len] =
>> '\0';
>> > > + tuple->values[i].data =
>> > palloc(len + 1);
>> > > + pq_copymsgbytes(in,
>> > tuple->values[i].data, len);
>> > > + tuple->values[i].data[len]
>> > = '\0';
>> > > + tuple->values[i].len = len;
>> >
>> > The cursor should be set to 0 in the text formatted case too if
>> this is
>> > how we chose to encode data.
>> >
>> > However I am not quite convinced I like the StringInfoData usage
>> here.
>> > Why not just change the struct to include additional array of
>> lengths
>> > rather than replacing the existing values array with StringInfoData
>> > array, that seems generally both simpler and should have smaller
>> memory
>> > footprint too, no?
>> >
>> >
>> > Can you explain this a bit more? I don't really see a huge difference
>> in
>> > memory usage.
>> > We still need length and the data copied into LogicalRepTupleData when
>> > sending the data in binary, no?
>> >
>>
>> Yes but we don't need to have fixed sized array of 1600 elements that
>> contains maxlen and cursor positions of the StringInfoData struct which
>> we don't use for anything AFAICS.
>>
>
New patch that fixes a number of errors in the check for validity as well
as reduces the memory usage by
dynamically allocating the data changed as well as collapsing the changed
and binary arrays into a format array.
Dave Cramer
>
Attachments:
[application/octet-stream] 0001-First-pass-at-working-code-without-subscription-opti.patch (21.4K, ../../CADK3HHKXjajsTDiEEaP_TiJtRbfQxkL0tSOHWF+OP308AP4apQ@mail.gmail.com/3-0001-First-pass-at-working-code-without-subscription-opti.patch)
download | inline diff:
From 7b1824d9ad6069343b1204ee72b5e5435cf0bdce Mon Sep 17 00:00:00 2001
From: Dave Cramer <[email protected]>
Date: Tue, 11 Jun 2019 15:35:11 -0400
Subject: [PATCH 1/8] First pass at working code without subscription options
---
src/backend/replication/logical/proto.c | 108 ++++++++++-------
src/backend/replication/logical/worker.c | 124 ++++++++++++++------
src/backend/replication/pgoutput/pgoutput.c | 34 +++++-
src/include/replication/logicalproto.h | 20 ++--
src/include/replication/pgoutput.h | 1 +
5 files changed, 201 insertions(+), 86 deletions(-)
diff --git a/src/backend/replication/logical/proto.c b/src/backend/replication/logical/proto.c
index 3c6d0cd171..935b167ec2 100644
--- a/src/backend/replication/logical/proto.c
+++ b/src/backend/replication/logical/proto.c
@@ -16,9 +16,11 @@
#include "catalog/pg_namespace.h"
#include "catalog/pg_type.h"
#include "libpq/pqformat.h"
+#include "replication/logicalrelation.h"
#include "replication/logicalproto.h"
#include "utils/builtins.h"
#include "utils/lsyscache.h"
+#include "utils/rel.h"
#include "utils/syscache.h"
/*
@@ -31,7 +33,7 @@
static void logicalrep_write_attrs(StringInfo out, Relation rel);
static void logicalrep_write_tuple(StringInfo out, Relation rel,
- HeapTuple tuple);
+ HeapTuple tuple, bool binary_basetypes);
static void logicalrep_read_attrs(StringInfo in, LogicalRepRelation *rel);
static void logicalrep_read_tuple(StringInfo in, LogicalRepTupleData *tuple);
@@ -139,7 +141,7 @@ logicalrep_read_origin(StringInfo in, XLogRecPtr *origin_lsn)
* Write INSERT to the output stream.
*/
void
-logicalrep_write_insert(StringInfo out, Relation rel, HeapTuple newtuple)
+logicalrep_write_insert(StringInfo out, Relation rel, HeapTuple newtuple, bool binary_basetypes)
{
pq_sendbyte(out, 'I'); /* action INSERT */
@@ -147,7 +149,7 @@ logicalrep_write_insert(StringInfo out, Relation rel, HeapTuple newtuple)
pq_sendint32(out, RelationGetRelid(rel));
pq_sendbyte(out, 'N'); /* new tuple follows */
- logicalrep_write_tuple(out, rel, newtuple);
+ logicalrep_write_tuple(out, rel, newtuple, binary_basetypes);
}
/*
@@ -155,14 +157,10 @@ logicalrep_write_insert(StringInfo out, Relation rel, HeapTuple newtuple)
*
* Fills the new tuple.
*/
-LogicalRepRelId
+void
logicalrep_read_insert(StringInfo in, LogicalRepTupleData *newtup)
{
char action;
- LogicalRepRelId relid;
-
- /* read the relation id */
- relid = pq_getmsgint(in, 4);
action = pq_getmsgbyte(in);
if (action != 'N')
@@ -171,7 +169,6 @@ logicalrep_read_insert(StringInfo in, LogicalRepTupleData *newtup)
logicalrep_read_tuple(in, newtup);
- return relid;
}
/*
@@ -179,7 +176,7 @@ logicalrep_read_insert(StringInfo in, LogicalRepTupleData *newtup)
*/
void
logicalrep_write_update(StringInfo out, Relation rel, HeapTuple oldtuple,
- HeapTuple newtuple)
+ HeapTuple newtuple, bool binary_basetypes)
{
pq_sendbyte(out, 'U'); /* action UPDATE */
@@ -196,26 +193,22 @@ logicalrep_write_update(StringInfo out, Relation rel, HeapTuple oldtuple,
pq_sendbyte(out, 'O'); /* old tuple follows */
else
pq_sendbyte(out, 'K'); /* old key follows */
- logicalrep_write_tuple(out, rel, oldtuple);
+ logicalrep_write_tuple(out, rel, oldtuple, binary_basetypes);
}
pq_sendbyte(out, 'N'); /* new tuple follows */
- logicalrep_write_tuple(out, rel, newtuple);
+ logicalrep_write_tuple(out, rel, newtuple, binary_basetypes);
}
/*
* Read UPDATE from stream.
*/
-LogicalRepRelId
+void
logicalrep_read_update(StringInfo in, bool *has_oldtuple,
LogicalRepTupleData *oldtup,
LogicalRepTupleData *newtup)
{
char action;
- LogicalRepRelId relid;
-
- /* read the relation id */
- relid = pq_getmsgint(in, 4);
/* read and verify action */
action = pq_getmsgbyte(in);
@@ -241,14 +234,13 @@ logicalrep_read_update(StringInfo in, bool *has_oldtuple,
logicalrep_read_tuple(in, newtup);
- return relid;
}
/*
* Write DELETE to the output stream.
*/
void
-logicalrep_write_delete(StringInfo out, Relation rel, HeapTuple oldtuple)
+logicalrep_write_delete(StringInfo out, Relation rel, HeapTuple oldtuple, bool binary_basetypes)
{
Assert(rel->rd_rel->relreplident == REPLICA_IDENTITY_DEFAULT ||
rel->rd_rel->relreplident == REPLICA_IDENTITY_FULL ||
@@ -264,7 +256,7 @@ logicalrep_write_delete(StringInfo out, Relation rel, HeapTuple oldtuple)
else
pq_sendbyte(out, 'K'); /* old key follows */
- logicalrep_write_tuple(out, rel, oldtuple);
+ logicalrep_write_tuple(out, rel, oldtuple, binary_basetypes);
}
/*
@@ -272,14 +264,10 @@ logicalrep_write_delete(StringInfo out, Relation rel, HeapTuple oldtuple)
*
* Fills the old tuple.
*/
-LogicalRepRelId
+void
logicalrep_read_delete(StringInfo in, LogicalRepTupleData *oldtup)
{
char action;
- LogicalRepRelId relid;
-
- /* read the relation id */
- relid = pq_getmsgint(in, 4);
/* read and verify action */
action = pq_getmsgbyte(in);
@@ -288,7 +276,6 @@ logicalrep_read_delete(StringInfo in, LogicalRepTupleData *oldtup)
logicalrep_read_tuple(in, oldtup);
- return relid;
}
/*
@@ -437,7 +424,7 @@ logicalrep_read_typ(StringInfo in, LogicalRepTyp *ltyp)
* Write a tuple to the outputstream, in the most efficient format possible.
*/
static void
-logicalrep_write_tuple(StringInfo out, Relation rel, HeapTuple tuple)
+logicalrep_write_tuple(StringInfo out, Relation rel, HeapTuple tuple, bool binary_basetypes)
{
TupleDesc desc;
Datum values[MaxTupleAttributeNumber];
@@ -453,6 +440,7 @@ logicalrep_write_tuple(StringInfo out, Relation rel, HeapTuple tuple)
continue;
nliveatts++;
}
+
pq_sendint16(out, nliveatts);
/* try to allocate enough memory from the get-go */
@@ -488,12 +476,31 @@ logicalrep_write_tuple(StringInfo out, Relation rel, HeapTuple tuple)
elog(ERROR, "cache lookup failed for type %u", att->atttypid);
typclass = (Form_pg_type) GETSTRUCT(typtup);
- pq_sendbyte(out, 't'); /* 'text' data follows */
- outputstr = OidOutputFunctionCall(typclass->typoutput, values[i]);
- pq_sendcountedtext(out, outputstr, strlen(outputstr), false);
- pfree(outputstr);
+ if (binary_basetypes &&
+ OidIsValid(typclass->typreceive) &&
+ (att->atttypid < FirstNormalObjectId || typclass->typtype != 'c') &&
+ (att->atttypid < FirstNormalObjectId || typclass->typelem == InvalidOid))
+ {
+ bytea *outputbytes;
+ int len;
+ pq_sendbyte(out, 'b'); /* binary send/recv data follows */
+
+ outputbytes = OidSendFunctionCall(typclass->typsend,
+ values[i]);
+ len = VARSIZE(outputbytes) - VARHDRSZ;
+ pq_sendint(out, len, 4); /* length */
+ pq_sendbytes(out, VARDATA(outputbytes), len); /* data */
+ pfree(outputbytes);
+ }
+ else
+ {
+ pq_sendbyte(out, 't'); /* 'text' data follows */
+ outputstr = OidOutputFunctionCall(typclass->typoutput, values[i]);
+ pq_sendcountedtext(out, outputstr, strlen(outputstr), false);
+ pfree(outputstr);
+ }
ReleaseSysCache(typtup);
}
}
@@ -514,6 +521,9 @@ logicalrep_read_tuple(StringInfo in, LogicalRepTupleData *tuple)
memset(tuple->changed, 0, sizeof(tuple->changed));
+ /* default is text */
+ memset(tuple->binary, 0, sizeof(tuple->binary));
+
/* Read the data */
for (i = 0; i < natts; i++)
{
@@ -524,25 +534,43 @@ logicalrep_read_tuple(StringInfo in, LogicalRepTupleData *tuple)
switch (kind)
{
case 'n': /* null */
- tuple->values[i] = NULL;
+ tuple->values[i].len = 0;
+ tuple->values[i].data = NULL;
tuple->changed[i] = true;
break;
case 'u': /* unchanged column */
/* we don't receive the value of an unchanged column */
- tuple->values[i] = NULL;
+ tuple->values[i].len = 0;
+ tuple->values[i].data = NULL;
break;
- case 't': /* text formatted value */
+ case 'b': /* binary formatted value */
{
- int len;
-
tuple->changed[i] = true;
+ tuple->binary[i] = true;
+
+ int len = pq_getmsgint(in, 4); /* read length */
- len = pq_getmsgint(in, 4); /* read length */
+ tuple->values[i].data = palloc(len + 1);
+ /* and data */
+
+ pq_copymsgbytes(in, tuple->values[i].data, len);
+ tuple->values[i].len = len;
+ tuple->values[i].cursor = 0;
+ tuple->values[i].maxlen = len;
+ /* not strictly necessary but the docs say it is required */
+ tuple->values[i].data[len] = '\0';
+ break;
+ }
+ case 't': /* text formatted value */
+ {
+ tuple->changed[i] = true;
+ int len = pq_getmsgint(in, 4); /* read length */
/* and data */
- tuple->values[i] = palloc(len + 1);
- pq_copymsgbytes(in, tuple->values[i], len);
- tuple->values[i][len] = '\0';
+ tuple->values[i].data = palloc(len + 1);
+ pq_copymsgbytes(in, tuple->values[i].data, len);
+ tuple->values[i].data[len] = '\0';
+ tuple->values[i].len = len;
}
break;
default:
diff --git a/src/backend/replication/logical/worker.c b/src/backend/replication/logical/worker.c
index 673ebd211d..049a3b3392 100644
--- a/src/backend/replication/logical/worker.c
+++ b/src/backend/replication/logical/worker.c
@@ -310,13 +310,12 @@ slot_store_error_callback(void *arg)
}
/*
- * Store data in C string form into slot.
- * This is similar to BuildTupleFromCStrings but TupleTableSlot fits our
- * use better.
+ * Store data into slot.
+ * Data can be either text or binary transfer format
*/
static void
-slot_store_cstrings(TupleTableSlot *slot, LogicalRepRelMapEntry *rel,
- char **values)
+slot_store_data(TupleTableSlot *slot, LogicalRepRelMapEntry *rel,
+ LogicalRepTupleData *tupleData)
{
int natts = slot->tts_tupleDescriptor->natts;
int i;
@@ -342,18 +341,40 @@ slot_store_cstrings(TupleTableSlot *slot, LogicalRepRelMapEntry *rel,
int remoteattnum = rel->attrmap->attnums[i];
if (!att->attisdropped && remoteattnum >= 0 &&
- values[remoteattnum] != NULL)
+ tupleData->values[remoteattnum].data != NULL)
{
- Oid typinput;
- Oid typioparam;
errarg.local_attnum = i;
errarg.remote_attnum = remoteattnum;
- getTypeInputInfo(att->atttypid, &typinput, &typioparam);
- slot->tts_values[i] =
- OidInputFunctionCall(typinput, values[remoteattnum],
- typioparam, att->atttypmod);
+ if (tupleData->binary[remoteattnum])
+ {
+ Oid typreceive;
+ Oid typioparam;
+
+ getTypeBinaryInputInfo(att->atttypid, &typreceive, &typioparam);
+
+ int cursor = tupleData->values[remoteattnum].cursor;
+ slot->tts_values[i] =
+ OidReceiveFunctionCall(typreceive, &tupleData->values[remoteattnum],
+ typioparam, att->atttypmod);
+ /*
+ * Do not advance the cursor in case we need to re-read this
+ * This saves us from pushing all of this type logic into proto.c
+ */
+ tupleData->values[remoteattnum].cursor = cursor;
+
+ }
+ else
+ {
+ Oid typinput;
+ Oid typioparam;
+
+ getTypeInputInfo(att->atttypid, &typinput, &typioparam);
+ slot->tts_values[i] =
+ OidInputFunctionCall(typinput, tupleData->values[remoteattnum].data,
+ typioparam, att->atttypmod);
+ }
slot->tts_isnull[i] = false;
errarg.local_attnum = -1;
@@ -387,11 +408,17 @@ slot_store_cstrings(TupleTableSlot *slot, LogicalRepRelMapEntry *rel,
* Caution: unreplaced pass-by-ref columns in "slot" will point into the
* storage for "srcslot". This is OK for current usage, but someday we may
* need to materialize "slot" at the end to make it independent of "srcslot".
+ *
+ * TODO: figure out the right comment here
+ * Modify slot with user data provided.
+ * This is somewhat similar to heap_modify_tuple but also calls the type
+ * input function on the user data as the input is either text or binary transfer
+ * format
*/
static void
-slot_modify_cstrings(TupleTableSlot *slot, TupleTableSlot *srcslot,
- LogicalRepRelMapEntry *rel,
- char **values, bool *replaces)
+slot_modify_data(TupleTableSlot *slot, TupleTableSlot *srcslot,
+ LogicalRepRelMapEntry *rel,
+ LogicalRepTupleData *tupleData)
{
int natts = slot->tts_tupleDescriptor->natts;
int i;
@@ -429,21 +456,43 @@ slot_modify_cstrings(TupleTableSlot *slot, TupleTableSlot *srcslot,
if (remoteattnum < 0)
continue;
- if (!replaces[remoteattnum])
+ if (!tupleData->changed[remoteattnum])
continue;
- if (values[remoteattnum] != NULL)
+ if (tupleData->values[remoteattnum].data != NULL)
{
- Oid typinput;
- Oid typioparam;
errarg.local_attnum = i;
errarg.remote_attnum = remoteattnum;
- getTypeInputInfo(att->atttypid, &typinput, &typioparam);
- slot->tts_values[i] =
- OidInputFunctionCall(typinput, values[remoteattnum],
- typioparam, att->atttypmod);
+ if (tupleData->binary[remoteattnum])
+ {
+ Oid typreceive;
+ Oid typioparam;
+
+ getTypeBinaryInputInfo(att->atttypid, &typreceive, &typioparam);
+
+
+ int cursor = tupleData->values[remoteattnum].cursor;
+ slot->tts_values[i] =
+ OidReceiveFunctionCall(typreceive, &tupleData->values[remoteattnum],
+ typioparam, att->atttypmod);
+ /*
+ * Do not advance the cursor in case we need to re-read this
+ * This saves us from pushing all of this type logic into proto.c
+ */
+ tupleData->values[remoteattnum].cursor = cursor;
+ }
+ else
+ {
+ Oid typinput;
+ Oid typioparam;
+
+ getTypeInputInfo(att->atttypid, &typinput, &typioparam);
+ slot->tts_values[i] =
+ OidInputFunctionCall(typinput, tupleData->values[remoteattnum].data,
+ typioparam, att->atttypmod);
+ }
slot->tts_isnull[i] = false;
errarg.local_attnum = -1;
@@ -609,8 +658,12 @@ apply_handle_insert(StringInfo s)
ensure_transaction();
- relid = logicalrep_read_insert(s, &newtup);
+ /* read the relation id */
+ relid = pq_getmsgint(s, 4);
rel = logicalrep_rel_open(relid, RowExclusiveLock);
+
+ logicalrep_read_insert(s, &newtup);
+
if (!should_apply_changes_for_rel(rel))
{
/*
@@ -632,7 +685,7 @@ apply_handle_insert(StringInfo s)
/* Process and store remote tuple in the slot */
oldctx = MemoryContextSwitchTo(GetPerTupleMemoryContext(estate));
- slot_store_cstrings(remoteslot, rel, newtup.values);
+ slot_store_data(remoteslot, rel, &newtup);
slot_fill_defaults(rel, estate, remoteslot);
MemoryContextSwitchTo(oldctx);
@@ -720,9 +773,12 @@ apply_handle_update(StringInfo s)
ensure_transaction();
- relid = logicalrep_read_update(s, &has_oldtup, &oldtup,
- &newtup);
+ /* read the relation id */
+ relid = pq_getmsgint(s, 4);
rel = logicalrep_rel_open(relid, RowExclusiveLock);
+
+ logicalrep_read_update(s, &has_oldtup, &oldtup,
+ &newtup);
if (!should_apply_changes_for_rel(rel))
{
/*
@@ -763,8 +819,8 @@ apply_handle_update(StringInfo s)
/* Build the search tuple. */
oldctx = MemoryContextSwitchTo(GetPerTupleMemoryContext(estate));
- slot_store_cstrings(remoteslot, rel,
- has_oldtup ? oldtup.values : newtup.values);
+ slot_store_data(remoteslot, rel,
+ has_oldtup ? &oldtup : &newtup);
MemoryContextSwitchTo(oldctx);
Assert(rel->localrel->rd_rel->relkind == RELKIND_RELATION);
@@ -814,8 +870,7 @@ apply_handle_update_internal(ResultRelInfo *relinfo,
{
/* Process and store remote tuple in the slot */
oldctx = MemoryContextSwitchTo(GetPerTupleMemoryContext(estate));
- slot_modify_cstrings(remoteslot, localslot, relmapentry,
- newtup->values, newtup->changed);
+ slot_modify_data(remoteslot, localslot, rel, &newtup);
MemoryContextSwitchTo(oldctx);
EvalPlanQualSetSlot(&epqstate, remoteslot);
@@ -858,8 +913,11 @@ apply_handle_delete(StringInfo s)
ensure_transaction();
- relid = logicalrep_read_delete(s, &oldtup);
+ /* read the relation id */
+ relid = pq_getmsgint(s, 4);
rel = logicalrep_rel_open(relid, RowExclusiveLock);
+
+ logicalrep_read_delete(s, &oldtup);
if (!should_apply_changes_for_rel(rel))
{
/*
@@ -883,7 +941,7 @@ apply_handle_delete(StringInfo s)
/* Build the search tuple. */
oldctx = MemoryContextSwitchTo(GetPerTupleMemoryContext(estate));
- slot_store_cstrings(remoteslot, rel, oldtup.values);
+ slot_store_data(remoteslot, rel, &oldtup);
MemoryContextSwitchTo(oldctx);
Assert(rel->localrel->rd_rel->relkind == RELKIND_RELATION);
diff --git a/src/backend/replication/pgoutput/pgoutput.c b/src/backend/replication/pgoutput/pgoutput.c
index 552a70cffa..2b38e6375e 100644
--- a/src/backend/replication/pgoutput/pgoutput.c
+++ b/src/backend/replication/pgoutput/pgoutput.c
@@ -92,11 +92,15 @@ _PG_output_plugin_init(OutputPluginCallbacks *cb)
static void
parse_output_parameters(List *options, uint32 *protocol_version,
- List **publication_names)
+ List **publication_names, bool *binary_basetypes)
{
ListCell *lc;
bool protocol_version_given = false;
bool publication_names_given = false;
+ bool binary_option_given = false;
+
+ // default to false
+ *binary_basetypes = false;
foreach(lc, options)
{
@@ -142,6 +146,22 @@ parse_output_parameters(List *options, uint32 *protocol_version,
(errcode(ERRCODE_INVALID_NAME),
errmsg("invalid publication_names syntax")));
}
+ else if (strcmp(defel->defname, "binary") == 0 )
+ {
+ bool parsed;
+ if (binary_option_given)
+ ereport(ERROR,
+ (errcode(ERRCODE_SYNTAX_ERROR),
+ errmsg("conflicting or redundant options")));
+ binary_option_given = true;
+
+ if (!parse_bool(strVal(defel->arg), &parsed))
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("invalid binary option")));
+
+ *binary_basetypes = parsed;
+ }
else
elog(ERROR, "unrecognized pgoutput option: %s", defel->defname);
}
@@ -176,7 +196,8 @@ pgoutput_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
/* Parse the params and ERROR if we see any we don't recognize */
parse_output_parameters(ctx->output_plugin_options,
&data->protocol_version,
- &data->publication_names);
+ &data->publication_names,
+ &data->binary_basetypes);
/* Check if we support requested protocol */
if (data->protocol_version > LOGICALREP_PROTO_VERSION_NUM)
@@ -348,7 +369,8 @@ pgoutput_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
case REORDER_BUFFER_CHANGE_INSERT:
OutputPluginPrepareWrite(ctx, true);
logicalrep_write_insert(ctx->out, relation,
- &change->data.tp.newtuple->tuple);
+ &change->data.tp.newtuple->tuple,
+ data->binary_basetypes);
OutputPluginWrite(ctx, true);
break;
case REORDER_BUFFER_CHANGE_UPDATE:
@@ -358,7 +380,8 @@ pgoutput_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
OutputPluginPrepareWrite(ctx, true);
logicalrep_write_update(ctx->out, relation, oldtuple,
- &change->data.tp.newtuple->tuple);
+ &change->data.tp.newtuple->tuple,
+ data->binary_basetypes);
OutputPluginWrite(ctx, true);
break;
}
@@ -367,7 +390,8 @@ pgoutput_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
{
OutputPluginPrepareWrite(ctx, true);
logicalrep_write_delete(ctx->out, relation,
- &change->data.tp.oldtuple->tuple);
+ &change->data.tp.oldtuple->tuple,
+ data->binary_basetypes);
OutputPluginWrite(ctx, true);
}
else
diff --git a/src/include/replication/logicalproto.h b/src/include/replication/logicalproto.h
index 4860561be9..ac2e17a769 100644
--- a/src/include/replication/logicalproto.h
+++ b/src/include/replication/logicalproto.h
@@ -30,8 +30,12 @@
/* Tuple coming via logical replication. */
typedef struct LogicalRepTupleData
{
- /* column values in text format, or NULL for a null value: */
- char *values[MaxTupleAttributeNumber];
+ /* column values */
+ StringInfoData values[MaxTupleAttributeNumber];
+
+ /* markers for binary */
+ bool binary[MaxTupleAttributeNumber];
+
/* markers for changed/unchanged column values: */
bool changed[MaxTupleAttributeNumber];
} LogicalRepTupleData;
@@ -87,16 +91,16 @@ extern void logicalrep_write_origin(StringInfo out, const char *origin,
XLogRecPtr origin_lsn);
extern char *logicalrep_read_origin(StringInfo in, XLogRecPtr *origin_lsn);
extern void logicalrep_write_insert(StringInfo out, Relation rel,
- HeapTuple newtuple);
-extern LogicalRepRelId logicalrep_read_insert(StringInfo in, LogicalRepTupleData *newtup);
+ HeapTuple newtuple, bool binary_basetypes);
+extern void logicalrep_read_insert(StringInfo in, LogicalRepTupleData *newtup);
extern void logicalrep_write_update(StringInfo out, Relation rel, HeapTuple oldtuple,
- HeapTuple newtuple);
-extern LogicalRepRelId logicalrep_read_update(StringInfo in,
+ HeapTuple newtuple, bool binary_basetypes);
+extern void logicalrep_read_update(StringInfo in,
bool *has_oldtuple, LogicalRepTupleData *oldtup,
LogicalRepTupleData *newtup);
extern void logicalrep_write_delete(StringInfo out, Relation rel,
- HeapTuple oldtuple);
-extern LogicalRepRelId logicalrep_read_delete(StringInfo in,
+ HeapTuple oldtuple, bool binary_basetypes);
+extern void logicalrep_read_delete(StringInfo in,
LogicalRepTupleData *oldtup);
extern void logicalrep_write_truncate(StringInfo out, int nrelids, Oid relids[],
bool cascade, bool restart_seqs);
diff --git a/src/include/replication/pgoutput.h b/src/include/replication/pgoutput.h
index 2e8e9daf44..1252e9132b 100644
--- a/src/include/replication/pgoutput.h
+++ b/src/include/replication/pgoutput.h
@@ -25,6 +25,7 @@ typedef struct PGOutputData
List *publication_names;
List *publications;
+ bool binary_basetypes;
} PGOutputData;
#endif /* PGOUTPUT_H */
--
2.20.1 (Apple Git-117)
[application/octet-stream] 0002-add-binary-column-to-pg_subscription.patch (11.5K, ../../CADK3HHKXjajsTDiEEaP_TiJtRbfQxkL0tSOHWF+OP308AP4apQ@mail.gmail.com/4-0002-add-binary-column-to-pg_subscription.patch)
download | inline diff:
From 190f43a30517ddb0b474052da9860b3fb427b22f Mon Sep 17 00:00:00 2001
From: Dave Cramer <[email protected]>
Date: Fri, 14 Jun 2019 15:39:47 -0400
Subject: [PATCH 2/8] add binary column to pg_subscription support create and
alter subcription with binary option
---
src/backend/catalog/system_views.sql | 2 +-
src/backend/commands/subscriptioncmds.c | 39 ++++++++++---
.../libpqwalreceiver/libpqwalreceiver.c | 3 +
src/backend/replication/logical/worker.c | 1 +
src/include/catalog/catversion.h | 58 -------------------
src/include/catalog/pg_subscription.h | 4 ++
src/include/replication/walreceiver.h | 1 +
7 files changed, 42 insertions(+), 66 deletions(-)
delete mode 100644 src/include/catalog/catversion.h
diff --git a/src/backend/catalog/system_views.sql b/src/backend/catalog/system_views.sql
index 813ea8bfc3..0bee6728d6 100644
--- a/src/backend/catalog/system_views.sql
+++ b/src/backend/catalog/system_views.sql
@@ -1122,7 +1122,7 @@ REVOKE ALL ON pg_replication_origin_status FROM public;
-- All columns of pg_subscription except subconninfo are readable.
REVOKE ALL ON pg_subscription FROM public;
-GRANT SELECT (subdbid, subname, subowner, subenabled, subslotname, subpublications)
+GRANT SELECT (subdbid, subname, subowner, subenabled, subbinary, subslotname, subpublications)
ON pg_subscription TO public;
diff --git a/src/backend/commands/subscriptioncmds.c b/src/backend/commands/subscriptioncmds.c
index 7f156673f7..e0ea6cd413 100644
--- a/src/backend/commands/subscriptioncmds.c
+++ b/src/backend/commands/subscriptioncmds.c
@@ -59,7 +59,7 @@ parse_subscription_options(List *options, bool *connect, bool *enabled_given,
bool *enabled, bool *create_slot,
bool *slot_name_given, char **slot_name,
bool *copy_data, char **synchronous_commit,
- bool *refresh)
+ bool *refresh, bool *binary_given, bool *binary)
{
ListCell *lc;
bool connect_given = false;
@@ -90,6 +90,12 @@ parse_subscription_options(List *options, bool *connect, bool *enabled_given,
*synchronous_commit = NULL;
if (refresh)
*refresh = true;
+ if (binary)
+ {
+ *binary_given = false;
+ /* not all versions of pgoutput will understand this option default to false */
+ *binary = false;
+ }
/* Parse options */
foreach(lc, options)
@@ -175,6 +181,11 @@ parse_subscription_options(List *options, bool *connect, bool *enabled_given,
refresh_given = true;
*refresh = defGetBoolean(defel);
}
+ else if (strcmp(defel->defname, "binary") == 0 && binary)
+ {
+ *binary_given = true;
+ *binary = defGetBoolean(defel);
+ }
else
ereport(ERROR,
(errcode(ERRCODE_SYNTAX_ERROR),
@@ -324,8 +335,10 @@ CreateSubscription(CreateSubscriptionStmt *stmt, bool isTopLevel)
bool slotname_given;
char originname[NAMEDATALEN];
bool create_slot;
- List *publications;
+ bool binary;
+ bool binary_given;
+ List *publications;
/*
* Parse and check options.
*
@@ -334,7 +347,7 @@ CreateSubscription(CreateSubscriptionStmt *stmt, bool isTopLevel)
parse_subscription_options(stmt->options, &connect, &enabled_given,
&enabled, &create_slot, &slotname_given,
&slotname, ©_data, &synchronous_commit,
- NULL);
+ NULL, &binary_given, &binary);
/*
* Since creating a replication slot is not transactional, rolling back
@@ -400,6 +413,7 @@ CreateSubscription(CreateSubscriptionStmt *stmt, bool isTopLevel)
DirectFunctionCall1(namein, CStringGetDatum(stmt->subname));
values[Anum_pg_subscription_subowner - 1] = ObjectIdGetDatum(owner);
values[Anum_pg_subscription_subenabled - 1] = BoolGetDatum(enabled);
+ values[Anum_pg_subscription_subbinary - 1] = BoolGetDatum(binary);
values[Anum_pg_subscription_subconninfo - 1] =
CStringGetTextDatum(conninfo);
if (slotname)
@@ -669,10 +683,13 @@ AlterSubscription(AlterSubscriptionStmt *stmt)
char *slotname;
bool slotname_given;
char *synchronous_commit;
+ bool binary_given;
+ bool binary;
parse_subscription_options(stmt->options, NULL, NULL, NULL,
NULL, &slotname_given, &slotname,
- NULL, &synchronous_commit, NULL);
+ NULL, &synchronous_commit, NULL,
+ &binary_given, &binary);
if (slotname_given)
{
@@ -697,6 +714,13 @@ AlterSubscription(AlterSubscriptionStmt *stmt)
replaces[Anum_pg_subscription_subsynccommit - 1] = true;
}
+ if (binary_given)
+ {
+ values[Anum_pg_subscription_subbinary - 1] =
+ BoolGetDatum(binary);
+ replaces[Anum_pg_subscription_subbinary - 1] = true;
+ }
+
update_tuple = true;
break;
}
@@ -708,7 +732,8 @@ AlterSubscription(AlterSubscriptionStmt *stmt)
parse_subscription_options(stmt->options, NULL,
&enabled_given, &enabled, NULL,
- NULL, NULL, NULL, NULL, NULL);
+ NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL);
Assert(enabled_given);
if (!sub->slotname && enabled)
@@ -746,7 +771,7 @@ AlterSubscription(AlterSubscriptionStmt *stmt)
parse_subscription_options(stmt->options, NULL, NULL, NULL,
NULL, NULL, NULL, ©_data,
- NULL, &refresh);
+ NULL, &refresh, NULL, NULL);
values[Anum_pg_subscription_subpublications - 1] =
publicationListToArray(stmt->publication);
@@ -783,7 +808,7 @@ AlterSubscription(AlterSubscriptionStmt *stmt)
parse_subscription_options(stmt->options, NULL, NULL, NULL,
NULL, NULL, NULL, ©_data,
- NULL, NULL);
+ NULL, NULL, NULL, NULL);
AlterSubscription_refresh(sub, copy_data);
diff --git a/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c b/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c
index e4fd1f9bb6..2a9d966ec1 100644
--- a/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c
+++ b/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c
@@ -402,6 +402,7 @@ libpqrcv_startstreaming(WalReceiverConn *conn,
char *pubnames_str;
List *pubnames;
char *pubnames_literal;
+ bool binary;
appendStringInfoString(&cmd, " (");
@@ -423,6 +424,8 @@ libpqrcv_startstreaming(WalReceiverConn *conn,
appendStringInfo(&cmd, ", publication_names %s", pubnames_literal);
PQfreemem(pubnames_literal);
pfree(pubnames_str);
+ if (options->proto.logical.binary)
+ appendStringInfo(&cmd, ", binary 'true'");
appendStringInfoChar(&cmd, ')');
}
diff --git a/src/backend/replication/logical/worker.c b/src/backend/replication/logical/worker.c
index 049a3b3392..c10414b16d 100644
--- a/src/backend/replication/logical/worker.c
+++ b/src/backend/replication/logical/worker.c
@@ -1866,6 +1866,7 @@ ApplyWorkerMain(Datum main_arg)
options.slotname = myslotname;
options.proto.logical.proto_version = LOGICALREP_PROTO_VERSION_NUM;
options.proto.logical.publication_names = MySubscription->publications;
+ options.proto.logical.binary = MySubscription->binary;
/* Start normal logical streaming replication. */
walrcv_startstreaming(wrconn, &options);
diff --git a/src/include/catalog/catversion.h b/src/include/catalog/catversion.h
deleted file mode 100644
index 6d91fa2bde..0000000000
--- a/src/include/catalog/catversion.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/*-------------------------------------------------------------------------
- *
- * catversion.h
- * "Catalog version number" for PostgreSQL.
- *
- * The catalog version number is used to flag incompatible changes in
- * the PostgreSQL system catalogs. Whenever anyone changes the format of
- * a system catalog relation, or adds, deletes, or modifies standard
- * catalog entries in such a way that an updated backend wouldn't work
- * with an old database (or vice versa), the catalog version number
- * should be changed. The version number stored in pg_control by initdb
- * is checked against the version number compiled into the backend at
- * startup time, so that a backend can refuse to run in an incompatible
- * database.
- *
- * The point of this feature is to provide a finer grain of compatibility
- * checking than is possible from looking at the major version number
- * stored in PG_VERSION. It shouldn't matter to end users, but during
- * development cycles we usually make quite a few incompatible changes
- * to the contents of the system catalogs, and we don't want to bump the
- * major version number for each one. What we can do instead is bump
- * this internal version number. This should save some grief for
- * developers who might otherwise waste time tracking down "bugs" that
- * are really just code-vs-database incompatibilities.
- *
- * The rule for developers is: if you commit a change that requires
- * an initdb, you should update the catalog version number (as well as
- * notifying the pgsql-hackers mailing list, which has been the
- * informal practice for a long time).
- *
- * The catalog version number is placed here since modifying files in
- * include/catalog is the most common kind of initdb-forcing change.
- * But it could be used to protect any kind of incompatible change in
- * database contents or layout, such as altering tuple headers.
- *
- *
- * Portions Copyright (c) 1996-2020, PostgreSQL Global Development Group
- * Portions Copyright (c) 1994, Regents of the University of California
- *
- * src/include/catalog/catversion.h
- *
- *-------------------------------------------------------------------------
- */
-#ifndef CATVERSION_H
-#define CATVERSION_H
-
-/*
- * We could use anything we wanted for version numbers, but I recommend
- * following the "YYYYMMDDN" style often used for DNS zone serial numbers.
- * YYYYMMDD are the date of the change, and N is the number of the change
- * on that day. (Hopefully we'll never commit ten independent sets of
- * catalog changes on the same day...)
- */
-
-/* yyyymmddN */
-#define CATALOG_VERSION_NO 202004022
-
-#endif
diff --git a/src/include/catalog/pg_subscription.h b/src/include/catalog/pg_subscription.h
index 0a756d42d8..100789a52f 100644
--- a/src/include/catalog/pg_subscription.h
+++ b/src/include/catalog/pg_subscription.h
@@ -48,6 +48,9 @@ CATALOG(pg_subscription,6100,SubscriptionRelationId) BKI_SHARED_RELATION BKI_ROW
bool subenabled; /* True if the subscription is enabled (the
* worker should be running) */
+ bool subbinary; /* True if the subscription wants the
+ * output plugin to send data in binary */
+
#ifdef CATALOG_VARLEN /* variable-length fields start here */
/* Connection string to the publisher */
text subconninfo BKI_FORCE_NOT_NULL;
@@ -73,6 +76,7 @@ typedef struct Subscription
char *name; /* Name of the subscription */
Oid owner; /* Oid of the subscription owner */
bool enabled; /* Indicates if the subscription is enabled */
+ bool binary; /* Indicates if the subscription wants data in binary format */
char *conninfo; /* Connection string to the publisher */
char *slotname; /* Name of the replication slot */
char *synccommit; /* Synchronous commit setting for worker */
diff --git a/src/include/replication/walreceiver.h b/src/include/replication/walreceiver.h
index cf3e43128c..13f38b34d6 100644
--- a/src/include/replication/walreceiver.h
+++ b/src/include/replication/walreceiver.h
@@ -168,6 +168,7 @@ typedef struct
{
uint32 proto_version; /* Logical protocol version */
List *publication_names; /* String list of publications */
+ bool binary; /* Ask publisher output plugin to use binary */
} logical;
} proto;
} WalRcvStreamOptions;
--
2.20.1 (Apple Git-117)
[application/octet-stream] 0003-document-new-binary-option-for-CREATE-SUBSCRIPTION.patch (2.9K, ../../CADK3HHKXjajsTDiEEaP_TiJtRbfQxkL0tSOHWF+OP308AP4apQ@mail.gmail.com/5-0003-document-new-binary-option-for-CREATE-SUBSCRIPTION.patch)
download | inline diff:
From 5dbb45664d2880c3aef64a2555ecce10e097c401 Mon Sep 17 00:00:00 2001
From: Dave Cramer <[email protected]>
Date: Mon, 17 Jun 2019 10:26:59 -0400
Subject: [PATCH 3/8] document new binary option for CREATE SUBSCRIPTION
document addition of binary column to pg_subscription
---
doc/src/sgml/catalogs.sgml | 7 +++++++
doc/src/sgml/ref/alter_subscription.sgml | 4 ++--
doc/src/sgml/ref/create_subscription.sgml | 11 +++++++++++
3 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/doc/src/sgml/catalogs.sgml b/doc/src/sgml/catalogs.sgml
index 64614b569c..381a7e730b 100644
--- a/doc/src/sgml/catalogs.sgml
+++ b/doc/src/sgml/catalogs.sgml
@@ -6667,6 +6667,13 @@ SCRAM-SHA-256$<replaceable><iteration count></replaceable>:<replaceable>&l
<entry>If true, the subscription is enabled and should be replicating.</entry>
</row>
+ <row>
+ <entry><structfield>subbinary</structfield></entry>
+ <entry><type>bool</type></entry>
+ <entry></entry>
+ <entry>If true, the subscription will request that the publisher send base types in binary format.</entry>
+ </row>
+
<row>
<entry><structfield>subsynccommit</structfield></entry>
<entry><type>text</type></entry>
diff --git a/doc/src/sgml/ref/alter_subscription.sgml b/doc/src/sgml/ref/alter_subscription.sgml
index 1b8beadbaa..66172a9b05 100644
--- a/doc/src/sgml/ref/alter_subscription.sgml
+++ b/doc/src/sgml/ref/alter_subscription.sgml
@@ -164,8 +164,8 @@ ALTER SUBSCRIPTION <replaceable class="parameter">name</replaceable> RENAME TO <
<para>
This clause alters parameters originally set by
<xref linkend="sql-createsubscription"/>. See there for more
- information. The allowed options are <literal>slot_name</literal> and
- <literal>synchronous_commit</literal>
+ information. The allowed options are <literal>slot_name</literal>,
+ <literal>synchronous_commit</literal> and <literal>binary</literal>
</para>
</listitem>
</varlistentry>
diff --git a/doc/src/sgml/ref/create_subscription.sgml b/doc/src/sgml/ref/create_subscription.sgml
index 1a90c244fb..1059370a2c 100644
--- a/doc/src/sgml/ref/create_subscription.sgml
+++ b/doc/src/sgml/ref/create_subscription.sgml
@@ -128,6 +128,17 @@ CREATE SUBSCRIPTION <replaceable class="parameter">subscription_name</replaceabl
</listitem>
</varlistentry>
+ <varlistentry>
+ <term><literal>binary</literal> (<type>boolean</type>)</term>
+ <listitem>
+ <para>
+ Specifies whether the subscription will request the publisher send
+ the base types in binary or not. The default
+ is <literal>false</literal>.
+ </para>
+ </listitem>
+ </varlistentry>
+
<varlistentry>
<term><literal>slot_name</literal> (<type>string</type>)</term>
<listitem>
--
2.20.1 (Apple Git-117)
[application/octet-stream] 0005-Remove-C99-declaration-and-code.patch (1.3K, ../../CADK3HHKXjajsTDiEEaP_TiJtRbfQxkL0tSOHWF+OP308AP4apQ@mail.gmail.com/6-0005-Remove-C99-declaration-and-code.patch)
download | inline diff:
From 52418a9a79b8f4913e13a75d921d4251eeaf1c5e Mon Sep 17 00:00:00 2001
From: Dave Cramer <[email protected]>
Date: Tue, 5 Nov 2019 07:14:30 -0500
Subject: [PATCH 5/8] Remove C99 declaration and code
---
src/backend/replication/logical/proto.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/backend/replication/logical/proto.c b/src/backend/replication/logical/proto.c
index 6494b645d0..d4c6283a17 100644
--- a/src/backend/replication/logical/proto.c
+++ b/src/backend/replication/logical/proto.c
@@ -547,10 +547,11 @@ logicalrep_read_tuple(StringInfo in, LogicalRepTupleData *tuple)
break;
case 'b': /* binary formatted value */
{
+ int len;
tuple->changed[i] = true;
tuple->binary[i] = true;
- int len = pq_getmsgint(in, 4); /* read length */
+ len = pq_getmsgint(in, 4); /* read length */
tuple->values[i].data = palloc(len + 1);
/* and data */
@@ -565,8 +566,9 @@ logicalrep_read_tuple(StringInfo in, LogicalRepTupleData *tuple)
}
case 't': /* text formatted value */
{
+ int len;
tuple->changed[i] = true;
- int len = pq_getmsgint(in, 4); /* read length */
+ len = pq_getmsgint(in, 4); /* read length */
/* and data */
tuple->values[i].data = palloc(len + 1);
--
2.20.1 (Apple Git-117)
[application/octet-stream] 0004-get-relid-inside-of-logical_read_insert.patch (2.5K, ../../CADK3HHKXjajsTDiEEaP_TiJtRbfQxkL0tSOHWF+OP308AP4apQ@mail.gmail.com/7-0004-get-relid-inside-of-logical_read_insert.patch)
download | inline diff:
From f4856757288be4a313f3561dece727a3f7cdb7cb Mon Sep 17 00:00:00 2001
From: Dave Cramer <[email protected]>
Date: Wed, 30 Oct 2019 09:58:59 -0400
Subject: [PATCH 4/8] get relid inside of logical_read_insert
---
src/backend/replication/logical/proto.c | 6 ++++--
src/backend/replication/logical/worker.c | 4 ++--
src/include/replication/logicalproto.h | 2 +-
3 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/src/backend/replication/logical/proto.c b/src/backend/replication/logical/proto.c
index 935b167ec2..6494b645d0 100644
--- a/src/backend/replication/logical/proto.c
+++ b/src/backend/replication/logical/proto.c
@@ -157,18 +157,20 @@ logicalrep_write_insert(StringInfo out, Relation rel, HeapTuple newtuple, bool b
*
* Fills the new tuple.
*/
-void
+LogicalRepRelId
logicalrep_read_insert(StringInfo in, LogicalRepTupleData *newtup)
{
char action;
+ LogicalRepRelId relid;
+ relid = pq_getmsgint(in, 4);
action = pq_getmsgbyte(in);
if (action != 'N')
elog(ERROR, "expected new tuple but got %d",
action);
logicalrep_read_tuple(in, newtup);
-
+ return relid;
}
/*
diff --git a/src/backend/replication/logical/worker.c b/src/backend/replication/logical/worker.c
index c10414b16d..58ada925ee 100644
--- a/src/backend/replication/logical/worker.c
+++ b/src/backend/replication/logical/worker.c
@@ -659,10 +659,10 @@ apply_handle_insert(StringInfo s)
ensure_transaction();
/* read the relation id */
- relid = pq_getmsgint(s, 4);
+ relid = logicalrep_read_insert(s, &newtup);
rel = logicalrep_rel_open(relid, RowExclusiveLock);
- logicalrep_read_insert(s, &newtup);
+
if (!should_apply_changes_for_rel(rel))
{
diff --git a/src/include/replication/logicalproto.h b/src/include/replication/logicalproto.h
index ac2e17a769..85351c6093 100644
--- a/src/include/replication/logicalproto.h
+++ b/src/include/replication/logicalproto.h
@@ -92,7 +92,7 @@ extern void logicalrep_write_origin(StringInfo out, const char *origin,
extern char *logicalrep_read_origin(StringInfo in, XLogRecPtr *origin_lsn);
extern void logicalrep_write_insert(StringInfo out, Relation rel,
HeapTuple newtuple, bool binary_basetypes);
-extern void logicalrep_read_insert(StringInfo in, LogicalRepTupleData *newtup);
+extern LogicalRepRelId logicalrep_read_insert(StringInfo in, LogicalRepTupleData *newtup);
extern void logicalrep_write_update(StringInfo out, Relation rel, HeapTuple oldtuple,
HeapTuple newtuple, bool binary_basetypes);
extern void logicalrep_read_update(StringInfo in,
--
2.20.1 (Apple Git-117)
[application/octet-stream] 0006-make-sure-the-subcription-is-marked-as-binary.patch (829B, ../../CADK3HHKXjajsTDiEEaP_TiJtRbfQxkL0tSOHWF+OP308AP4apQ@mail.gmail.com/8-0006-make-sure-the-subcription-is-marked-as-binary.patch)
download | inline diff:
From 5250b55a55275b5431e246feff5ca18fe4540176 Mon Sep 17 00:00:00 2001
From: Dave Cramer <[email protected]>
Date: Mon, 11 Nov 2019 14:37:35 -0500
Subject: [PATCH 6/8] make sure the subcription is marked as binary
---
src/backend/catalog/pg_subscription.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/backend/catalog/pg_subscription.c b/src/backend/catalog/pg_subscription.c
index cb15731115..e6afb3203e 100644
--- a/src/backend/catalog/pg_subscription.c
+++ b/src/backend/catalog/pg_subscription.c
@@ -65,6 +65,7 @@ GetSubscription(Oid subid, bool missing_ok)
sub->name = pstrdup(NameStr(subform->subname));
sub->owner = subform->subowner;
sub->enabled = subform->subenabled;
+ sub->binary = subform->subbinary;
/* Get conninfo */
datum = SysCacheGetAttr(SUBSCRIPTIONOID,
--
2.20.1 (Apple Git-117)
[application/octet-stream] 0007-check-that-the-subscriber-is-compatible-with-the-pub.patch (7.6K, ../../CADK3HHKXjajsTDiEEaP_TiJtRbfQxkL0tSOHWF+OP308AP4apQ@mail.gmail.com/9-0007-check-that-the-subscriber-is-compatible-with-the-pub.patch)
download | inline diff:
From d920c0637569d81ea343851715622318ad0e50f1 Mon Sep 17 00:00:00 2001
From: Dave Cramer <[email protected]>
Date: Mon, 11 Nov 2019 14:38:08 -0500
Subject: [PATCH 7/8] check that the subscriber is compatible with the
publisher
---
.../libpqwalreceiver/libpqwalreceiver.c | 36 +++-
src/backend/replication/pgoutput/pgoutput.c | 179 ++++++++++++++++++
2 files changed, 212 insertions(+), 3 deletions(-)
diff --git a/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c b/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c
index 2a9d966ec1..9130d645b6 100644
--- a/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c
+++ b/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c
@@ -402,7 +402,6 @@ libpqrcv_startstreaming(WalReceiverConn *conn,
char *pubnames_str;
List *pubnames;
char *pubnames_literal;
- bool binary;
appendStringInfoString(&cmd, " (");
@@ -424,9 +423,40 @@ libpqrcv_startstreaming(WalReceiverConn *conn,
appendStringInfo(&cmd, ", publication_names %s", pubnames_literal);
PQfreemem(pubnames_literal);
pfree(pubnames_str);
- if (options->proto.logical.binary)
+ if (options->proto.logical.binary) {
appendStringInfo(&cmd, ", binary 'true'");
-
+ appendStringInfo(&cmd, ", sizeof_datum %zu", sizeof(Datum));
+ appendStringInfo(&cmd, ", sizeof_int %zu", sizeof(int));
+ appendStringInfo(&cmd, ", sizeof_long %zu", sizeof(long));
+ appendStringInfo(&cmd, ", bigendian %d",
+#ifdef WORDS_BIGENDIAN
+ true
+#else
+ false
+#endif
+ );
+ appendStringInfo(&cmd, ", float4_byval %d",
+#ifdef USE_FLOAT4_BYVAL
+ true
+#else
+ false
+#endif
+ );
+ appendStringInfo(&cmd, ", float8_byval %d",
+#ifdef USE_FLOAT8_BYVAL
+ true
+#else
+ false
+#endif
+ );
+ appendStringInfo(&cmd, ", integer_datetimes %d",
+#ifdef USE_INTEGER_DATETIMES
+ true
+#else
+ false
+#endif
+ );
+ }
appendStringInfoChar(&cmd, ')');
}
else
diff --git a/src/backend/replication/pgoutput/pgoutput.c b/src/backend/replication/pgoutput/pgoutput.c
index 2b38e6375e..fab6f75b49 100644
--- a/src/backend/replication/pgoutput/pgoutput.c
+++ b/src/backend/replication/pgoutput/pgoutput.c
@@ -98,10 +98,25 @@ parse_output_parameters(List *options, uint32 *protocol_version,
bool protocol_version_given = false;
bool publication_names_given = false;
bool binary_option_given = false;
+ bool sizeof_int_given = false;
+ bool sizeof_datum_given = false;
+ bool sizeof_long_given = false;
+ bool big_endian_given = false;
+ bool float4_byval_given = false;
+ bool float8_byval_given = false;
+ bool integer_datetimes_given = false;
+ long datum_size;
+ long int_size;
+ long long_size;
+ bool bigendian;
+ bool float4_byval;
+ bool float8_byval;
+ bool integer_datetimes;
// default to false
*binary_basetypes = false;
+
foreach(lc, options)
{
DefElem *defel = (DefElem *) lfirst(lc);
@@ -161,10 +176,174 @@ parse_output_parameters(List *options, uint32 *protocol_version,
errmsg("invalid binary option")));
*binary_basetypes = parsed;
+
+
+ }
+ else if (strcmp(defel->defname, "sizeof_datum") == 0)
+ {
+
+ if (sizeof_datum_given)
+ ereport(ERROR,
+ (errcode(ERRCODE_SYNTAX_ERROR),
+ errmsg("conflicting or redundant options")));
+ sizeof_datum_given = true;
+
+ if (!scanint8(strVal(defel->arg), true, &datum_size))
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("invalid sizeof_datum option")));
+ }
+ else if (strcmp(defel->defname, "sizeof_int") == 0)
+ {
+
+ if (sizeof_int_given)
+ ereport(ERROR,
+ (errcode(ERRCODE_SYNTAX_ERROR),
+ errmsg("conflicting or redundant options")));
+ sizeof_int_given = true;
+
+ if (!scanint8(strVal(defel->arg), true, &int_size))
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("invalid sizeof_int option")));
+ }
+ else if (strcmp(defel->defname, "sizeof_long") == 0)
+ {
+
+ if (sizeof_long_given)
+ ereport(ERROR,
+ (errcode(ERRCODE_SYNTAX_ERROR),
+ errmsg("conflicting or redundant options")));
+ sizeof_int_given = true;
+
+ if (!scanint8(strVal(defel->arg), true, &long_size))
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("invalid sizeof_long option")));
+ }
+ else if (strcmp(defel->defname, "bigendian") == 0)
+ {
+
+ if (big_endian_given)
+ ereport(ERROR,
+ (errcode(ERRCODE_SYNTAX_ERROR),
+ errmsg("conflicting or redundant options")));
+ big_endian_given = true;
+
+ if (!parse_bool(strVal(defel->arg), &bigendian))
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("invalid bigendian option")));
+ }
+ else if (strcmp(defel->defname, "float4_byval") == 0)
+ {
+
+ if (float4_byval_given)
+ ereport(ERROR,
+ (errcode(ERRCODE_SYNTAX_ERROR),
+ errmsg("conflicting or redundant options")));
+ float4_byval_given = true;
+
+ if (!parse_bool(strVal(defel->arg), &float4_byval))
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("invalid float4_byval option")));
+ }
+ else if (strcmp(defel->defname, "float8_byval") == 0)
+ {
+
+ if (float8_byval_given)
+ ereport(ERROR,
+ (errcode(ERRCODE_SYNTAX_ERROR),
+ errmsg("conflicting or redundant options")));
+ float8_byval_given = true;
+
+ if (!parse_bool(strVal(defel->arg), &float8_byval))
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("invalid float8_byval option")));
+ }
+ else if (strcmp(defel->defname, "integer_date_times") == 0)
+ {
+
+ if (integer_datetimes_given)
+ ereport(ERROR,
+ (errcode(ERRCODE_SYNTAX_ERROR),
+ errmsg("conflicting or redundant options")));
+ integer_datetimes_given = true;
+
+ if (!parse_bool(strVal(defel->arg), &integer_datetimes))
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("invalid integer_date_times option")));
}
else
elog(ERROR, "unrecognized pgoutput option: %s", defel->defname);
}
+
+/*
+ * after we know that the subscriber is requesting binary check to make sure
+ * we are compatible with the subscriber.
+ */
+ if ( *binary_basetypes == true )
+ {
+ if (sizeof(Datum) != datum_size)
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("incompatible datum size")));
+
+ if (sizeof(int) != int_size)
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("incompatible integer size")));
+
+ if (sizeof(long) != long_size)
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("incompatible long size")));
+ if(
+#ifdef WORDS_BIGENDIAN
+ true
+#else
+ false
+#endif
+ != bigendian)
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("incompatible endianness")));
+ if( float4_byval !=
+#ifdef USE_FLOAT4_BYVAL
+ true
+#else
+ false
+#endif
+ )
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("incompatible float4_byval")));
+ if( float8_byval !=
+#ifdef USE_FLOAT4_BYVAL
+ true
+#else
+ false
+#endif
+ )
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("incompatible float8_byval")));
+
+ if ( integer_datetimes !=
+#ifdef USE_INTEGER_DATETIMES
+ true
+#else
+ false
+#endif
+ )
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("incompatible integer_datetimes")));
+
+ }
}
/*
--
2.20.1 (Apple Git-117)
[application/octet-stream] 0008-Changed-binary-and-changed-to-format-and-use-existin.patch (16.5K, ../../CADK3HHKXjajsTDiEEaP_TiJtRbfQxkL0tSOHWF+OP308AP4apQ@mail.gmail.com/10-0008-Changed-binary-and-changed-to-format-and-use-existin.patch)
download | inline diff:
From 223509362254d6962a336aeeb957b07f2d237a5c Mon Sep 17 00:00:00 2001
From: Dave Cramer <[email protected]>
Date: Tue, 7 Apr 2020 15:35:47 -0400
Subject: [PATCH 8/8] Changed binary and changed to format and use existing
codes to get rid of one array\ Dynamically allocate the arrays to avoid
allocating max columns sized arrays Fixed numerous issues with checking for
validity
---
.../libpqwalreceiver/libpqwalreceiver.c | 39 ++++++++-----
src/backend/replication/logical/proto.c | 56 +++++++++++--------
src/backend/replication/logical/worker.c | 30 +++++-----
src/backend/replication/pgoutput/pgoutput.c | 35 +++++++-----
src/include/pg_config_manual.h | 2 +-
src/include/replication/logicalproto.h | 8 +--
6 files changed, 99 insertions(+), 71 deletions(-)
diff --git a/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c b/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c
index 9130d645b6..08313fa2a5 100644
--- a/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c
+++ b/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c
@@ -425,36 +425,49 @@ libpqrcv_startstreaming(WalReceiverConn *conn,
pfree(pubnames_str);
if (options->proto.logical.binary) {
appendStringInfo(&cmd, ", binary 'true'");
- appendStringInfo(&cmd, ", sizeof_datum %zu", sizeof(Datum));
- appendStringInfo(&cmd, ", sizeof_int %zu", sizeof(int));
- appendStringInfo(&cmd, ", sizeof_long %zu", sizeof(long));
- appendStringInfo(&cmd, ", bigendian %d",
+ appendStringInfo(&cmd, ", sizeof_datum '%zu'", sizeof(Datum));
+ appendStringInfo(&cmd, ", sizeof_int '%zu'", sizeof(int));
+ appendStringInfo(&cmd, ", sizeof_long '%zu'", sizeof(long));
+ appendStringInfo(&cmd, ", bigendian '%d'",
#ifdef WORDS_BIGENDIAN
true
#else
false
#endif
);
- appendStringInfo(&cmd, ", float4_byval %d",
+ appendStringInfo(&cmd, ", float4_byval '%d'",
+#if PG_VERSION_NUM >= 130000
+ true
+#else
#ifdef USE_FLOAT4_BYVAL
- true
+ true
#else
- false
+ false
#endif
- );
- appendStringInfo(&cmd, ", float8_byval %d",
+#endif
+ );
+ appendStringInfo(&cmd, ", float8_byval '%d'",
#ifdef USE_FLOAT8_BYVAL
- true
+ true
#else
- false
+ false
#endif
- );
- appendStringInfo(&cmd, ", integer_datetimes %d",
+ );
+ appendStringInfo(&cmd, ", integer_datetimes '%d'",
+
+/* integer date times are always enabled in version 10 and up */
+
+#if PG_VERSION_NUM >= 100000
+ true
+#else
+
#ifdef USE_INTEGER_DATETIMES
true
#else
false
#endif
+#endif
+
);
}
appendStringInfoChar(&cmd, ')');
diff --git a/src/backend/replication/logical/proto.c b/src/backend/replication/logical/proto.c
index d4c6283a17..73148f39f3 100644
--- a/src/backend/replication/logical/proto.c
+++ b/src/backend/replication/logical/proto.c
@@ -521,10 +521,12 @@ logicalrep_read_tuple(StringInfo in, LogicalRepTupleData *tuple)
/* Get number of attributes */
natts = pq_getmsgint(in, 2);
- memset(tuple->changed, 0, sizeof(tuple->changed));
+ tuple->values = palloc(natts * sizeof(StringInfoData *));
+
+ /* default is unchanged */
+ tuple->format = palloc(natts * sizeof(char));
+ memset(tuple->format, 't', natts * sizeof(char));
- /* default is text */
- memset(tuple->binary, 0, sizeof(tuple->binary));
/* Read the data */
for (i = 0; i < natts; i++)
@@ -536,45 +538,51 @@ logicalrep_read_tuple(StringInfo in, LogicalRepTupleData *tuple)
switch (kind)
{
case 'n': /* null */
- tuple->values[i].len = 0;
- tuple->values[i].data = NULL;
- tuple->changed[i] = true;
- break;
+ {
+ tuple->values[i] = (StringInfoData *)NULL;
+ tuple->format[i] = 't';
+ break;
+ }
case 'u': /* unchanged column */
- /* we don't receive the value of an unchanged column */
- tuple->values[i].len = 0;
- tuple->values[i].data = NULL;
- break;
+ {
+ /* we don't receive the value of an unchanged column */
+ tuple->values[i] = (StringInfoData *)NULL;
+ tuple->format[i] = 'u'; /* be explicit */
+ break;
+ }
case 'b': /* binary formatted value */
{
int len;
- tuple->changed[i] = true;
- tuple->binary[i] = true;
+ StringInfoData *value = palloc(sizeof(StringInfoData));
+ tuple->format[i] = 'b';
len = pq_getmsgint(in, 4); /* read length */
- tuple->values[i].data = palloc(len + 1);
+ value->data = palloc(len + 1);
/* and data */
- pq_copymsgbytes(in, tuple->values[i].data, len);
- tuple->values[i].len = len;
- tuple->values[i].cursor = 0;
- tuple->values[i].maxlen = len;
+ pq_copymsgbytes(in, value->data, len);
+ value->len = len;
+ value->cursor = 0;
+ value->maxlen = len;
/* not strictly necessary but the docs say it is required */
- tuple->values[i].data[len] = '\0';
+ value->data[len] = '\0';
+ tuple->values[i] = value;
break;
}
case 't': /* text formatted value */
{
int len;
- tuple->changed[i] = true;
+ StringInfoData *value = palloc(sizeof(StringInfoData));
+ tuple->format[i] = 't';
len = pq_getmsgint(in, 4); /* read length */
/* and data */
- tuple->values[i].data = palloc(len + 1);
- pq_copymsgbytes(in, tuple->values[i].data, len);
- tuple->values[i].data[len] = '\0';
- tuple->values[i].len = len;
+ value->data = palloc(len + 1);
+ pq_copymsgbytes(in, value->data, len);
+ value->len = len;
+ value->data[len] = '\0';
+ tuple->values[i] = value;
}
break;
default:
diff --git a/src/backend/replication/logical/worker.c b/src/backend/replication/logical/worker.c
index 58ada925ee..a46c97c188 100644
--- a/src/backend/replication/logical/worker.c
+++ b/src/backend/replication/logical/worker.c
@@ -341,28 +341,28 @@ slot_store_data(TupleTableSlot *slot, LogicalRepRelMapEntry *rel,
int remoteattnum = rel->attrmap->attnums[i];
if (!att->attisdropped && remoteattnum >= 0 &&
- tupleData->values[remoteattnum].data != NULL)
+ tupleData->values[remoteattnum] != NULL)
{
errarg.local_attnum = i;
errarg.remote_attnum = remoteattnum;
- if (tupleData->binary[remoteattnum])
+ if (tupleData->format[remoteattnum] == 'b')
{
Oid typreceive;
Oid typioparam;
getTypeBinaryInputInfo(att->atttypid, &typreceive, &typioparam);
- int cursor = tupleData->values[remoteattnum].cursor;
+ int cursor = tupleData->values[remoteattnum]->cursor;
slot->tts_values[i] =
- OidReceiveFunctionCall(typreceive, &tupleData->values[remoteattnum],
+ OidReceiveFunctionCall(typreceive, tupleData->values[remoteattnum],
typioparam, att->atttypmod);
/*
* Do not advance the cursor in case we need to re-read this
* This saves us from pushing all of this type logic into proto.c
*/
- tupleData->values[remoteattnum].cursor = cursor;
+ tupleData->values[remoteattnum]->cursor = cursor;
}
else
@@ -372,7 +372,7 @@ slot_store_data(TupleTableSlot *slot, LogicalRepRelMapEntry *rel,
getTypeInputInfo(att->atttypid, &typinput, &typioparam);
slot->tts_values[i] =
- OidInputFunctionCall(typinput, tupleData->values[remoteattnum].data,
+ OidInputFunctionCall(typinput, tupleData->values[remoteattnum]->data,
typioparam, att->atttypmod);
}
slot->tts_isnull[i] = false;
@@ -456,16 +456,16 @@ slot_modify_data(TupleTableSlot *slot, TupleTableSlot *srcslot,
if (remoteattnum < 0)
continue;
- if (!tupleData->changed[remoteattnum])
+ if (tupleData->format[remoteattnum] =='u')
continue;
- if (tupleData->values[remoteattnum].data != NULL)
+ if (tupleData->values[remoteattnum] != NULL)
{
errarg.local_attnum = i;
errarg.remote_attnum = remoteattnum;
- if (tupleData->binary[remoteattnum])
+ if (tupleData->format[remoteattnum] == 'b')
{
Oid typreceive;
Oid typioparam;
@@ -473,15 +473,15 @@ slot_modify_data(TupleTableSlot *slot, TupleTableSlot *srcslot,
getTypeBinaryInputInfo(att->atttypid, &typreceive, &typioparam);
- int cursor = tupleData->values[remoteattnum].cursor;
+ int cursor = tupleData->values[remoteattnum]->cursor;
slot->tts_values[i] =
- OidReceiveFunctionCall(typreceive, &tupleData->values[remoteattnum],
+ OidReceiveFunctionCall(typreceive, tupleData->values[remoteattnum],
typioparam, att->atttypmod);
/*
* Do not advance the cursor in case we need to re-read this
* This saves us from pushing all of this type logic into proto.c
*/
- tupleData->values[remoteattnum].cursor = cursor;
+ tupleData->values[remoteattnum]->cursor = cursor;
}
else
{
@@ -490,7 +490,7 @@ slot_modify_data(TupleTableSlot *slot, TupleTableSlot *srcslot,
getTypeInputInfo(att->atttypid, &typinput, &typioparam);
slot->tts_values[i] =
- OidInputFunctionCall(typinput, tupleData->values[remoteattnum].data,
+ OidInputFunctionCall(typinput, tupleData->values[remoteattnum]->data,
typioparam, att->atttypmod);
}
slot->tts_isnull[i] = false;
@@ -808,7 +808,7 @@ apply_handle_update(StringInfo s)
target_rte = list_nth(estate->es_range_table, 0);
for (int i = 0; i < remoteslot->tts_tupleDescriptor->natts; i++)
{
- if (newtup.changed[i])
+ if (newtup.format[i] != 'u')
target_rte->updatedCols = bms_add_member(target_rte->updatedCols,
i + 1 - FirstLowInvalidHeapAttributeNumber);
}
@@ -870,7 +870,7 @@ apply_handle_update_internal(ResultRelInfo *relinfo,
{
/* Process and store remote tuple in the slot */
oldctx = MemoryContextSwitchTo(GetPerTupleMemoryContext(estate));
- slot_modify_data(remoteslot, localslot, rel, &newtup);
+ slot_modify_data(remoteslot, localslot, relmapentry, newtup);
MemoryContextSwitchTo(oldctx);
EvalPlanQualSetSlot(&epqstate, remoteslot);
diff --git a/src/backend/replication/pgoutput/pgoutput.c b/src/backend/replication/pgoutput/pgoutput.c
index fab6f75b49..050ccfaadb 100644
--- a/src/backend/replication/pgoutput/pgoutput.c
+++ b/src/backend/replication/pgoutput/pgoutput.c
@@ -18,6 +18,7 @@
#include "replication/logicalproto.h"
#include "replication/origin.h"
#include "replication/pgoutput.h"
+#include "utils/builtins.h"
#include "utils/int8.h"
#include "utils/inval.h"
#include "utils/memutils.h"
@@ -131,7 +132,7 @@ parse_output_parameters(List *options, uint32 *protocol_version,
if (protocol_version_given)
ereport(ERROR,
(errcode(ERRCODE_SYNTAX_ERROR),
- errmsg("conflicting or redundant options")));
+ errmsg("conflicting or redundant options %s already provided", defel->defname)));
protocol_version_given = true;
if (!scanint8(strVal(defel->arg), true, &parsed))
@@ -152,7 +153,7 @@ parse_output_parameters(List *options, uint32 *protocol_version,
if (publication_names_given)
ereport(ERROR,
(errcode(ERRCODE_SYNTAX_ERROR),
- errmsg("conflicting or redundant options")));
+ errmsg("conflicting or redundant options %s already provided", defel->defname)));
publication_names_given = true;
if (!SplitIdentifierString(strVal(defel->arg), ',',
@@ -167,7 +168,7 @@ parse_output_parameters(List *options, uint32 *protocol_version,
if (binary_option_given)
ereport(ERROR,
(errcode(ERRCODE_SYNTAX_ERROR),
- errmsg("conflicting or redundant options")));
+ errmsg("conflicting or redundant options %s already provided", defel->defname)));
binary_option_given = true;
if (!parse_bool(strVal(defel->arg), &parsed))
@@ -185,7 +186,7 @@ parse_output_parameters(List *options, uint32 *protocol_version,
if (sizeof_datum_given)
ereport(ERROR,
(errcode(ERRCODE_SYNTAX_ERROR),
- errmsg("conflicting or redundant options")));
+ errmsg("conflicting or redundant options %s already provided", defel->defname)));
sizeof_datum_given = true;
if (!scanint8(strVal(defel->arg), true, &datum_size))
@@ -199,7 +200,7 @@ parse_output_parameters(List *options, uint32 *protocol_version,
if (sizeof_int_given)
ereport(ERROR,
(errcode(ERRCODE_SYNTAX_ERROR),
- errmsg("conflicting or redundant options")));
+ errmsg("conflicting or redundant options %s already provided", defel->defname)));
sizeof_int_given = true;
if (!scanint8(strVal(defel->arg), true, &int_size))
@@ -213,8 +214,8 @@ parse_output_parameters(List *options, uint32 *protocol_version,
if (sizeof_long_given)
ereport(ERROR,
(errcode(ERRCODE_SYNTAX_ERROR),
- errmsg("conflicting or redundant options")));
- sizeof_int_given = true;
+ errmsg("conflicting or redundant options %s already provided", defel->defname)));
+ sizeof_long_given = true;
if (!scanint8(strVal(defel->arg), true, &long_size))
ereport(ERROR,
@@ -227,7 +228,7 @@ parse_output_parameters(List *options, uint32 *protocol_version,
if (big_endian_given)
ereport(ERROR,
(errcode(ERRCODE_SYNTAX_ERROR),
- errmsg("conflicting or redundant options")));
+ errmsg("conflicting or redundant options %s already provided", defel->defname)));
big_endian_given = true;
if (!parse_bool(strVal(defel->arg), &bigendian))
@@ -241,7 +242,7 @@ parse_output_parameters(List *options, uint32 *protocol_version,
if (float4_byval_given)
ereport(ERROR,
(errcode(ERRCODE_SYNTAX_ERROR),
- errmsg("conflicting or redundant options")));
+ errmsg("conflicting or redundant options %s already provided", defel->defname)));
float4_byval_given = true;
if (!parse_bool(strVal(defel->arg), &float4_byval))
@@ -255,7 +256,7 @@ parse_output_parameters(List *options, uint32 *protocol_version,
if (float8_byval_given)
ereport(ERROR,
(errcode(ERRCODE_SYNTAX_ERROR),
- errmsg("conflicting or redundant options")));
+ errmsg("conflicting or redundant options %s already provided", defel->defname)));
float8_byval_given = true;
if (!parse_bool(strVal(defel->arg), &float8_byval))
@@ -263,13 +264,13 @@ parse_output_parameters(List *options, uint32 *protocol_version,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("invalid float8_byval option")));
}
- else if (strcmp(defel->defname, "integer_date_times") == 0)
+ else if (strcmp(defel->defname, "integer_datetimes") == 0)
{
if (integer_datetimes_given)
ereport(ERROR,
(errcode(ERRCODE_SYNTAX_ERROR),
- errmsg("conflicting or redundant options")));
+ errmsg("conflicting or redundant options %s already provided", defel->defname)));
integer_datetimes_given = true;
if (!parse_bool(strVal(defel->arg), &integer_datetimes))
@@ -312,17 +313,21 @@ parse_output_parameters(List *options, uint32 *protocol_version,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("incompatible endianness")));
if( float4_byval !=
+#if PG_VERSION_NUM >= 130000
+ true
+#else
#ifdef USE_FLOAT4_BYVAL
true
#else
false
+#endif
#endif
)
ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("incompatible float4_byval")));
if( float8_byval !=
-#ifdef USE_FLOAT4_BYVAL
+#ifdef USE_FLOAT8_BYVAL
true
#else
false
@@ -333,10 +338,14 @@ parse_output_parameters(List *options, uint32 *protocol_version,
errmsg("incompatible float8_byval")));
if ( integer_datetimes !=
+#if PG_VERSION_NUM >= 100000
+ true
+#else
#ifdef USE_INTEGER_DATETIMES
true
#else
false
+#endif
#endif
)
ereport(ERROR,
diff --git a/src/include/pg_config_manual.h b/src/include/pg_config_manual.h
index 32f739706d..3504a19728 100644
--- a/src/include/pg_config_manual.h
+++ b/src/include/pg_config_manual.h
@@ -336,7 +336,7 @@
* Enable debugging print statements for WAL-related operations; see
* also the wal_debug GUC var.
*/
-/* #define WAL_DEBUG */
+#define WAL_DEBUG
/*
* Enable tracing of resource consumption during sort operations;
diff --git a/src/include/replication/logicalproto.h b/src/include/replication/logicalproto.h
index 85351c6093..b209af4cf2 100644
--- a/src/include/replication/logicalproto.h
+++ b/src/include/replication/logicalproto.h
@@ -31,13 +31,11 @@
typedef struct LogicalRepTupleData
{
/* column values */
- StringInfoData values[MaxTupleAttributeNumber];
+ StringInfoData **values;
- /* markers for binary */
- bool binary[MaxTupleAttributeNumber];
+ /* markers for changed/unchanged/binary/text */
+ char *format;
- /* markers for changed/unchanged column values: */
- bool changed[MaxTupleAttributeNumber];
} LogicalRepTupleData;
typedef uint32 LogicalRepRelId;
--
2.20.1 (Apple Git-117)
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index eb9d6502fc..838d9b80d0 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -297,7 +297,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -306,7 +306,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.45.1
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20240912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
* [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo.
@ 2024-09-11 04:25 Andy Fan <[email protected]>
0 siblings, 0 replies; 1606+ messages in thread
From: Andy Fan @ 2024-09-11 04:25 UTC (permalink / raw)
enlargeStringInfo has a noticeable ratio in perf peport with a
"select * from pg_class" workload). So add a unlikely hint in
enlargeStringinfo to avoid some overhead.
---
src/common/stringinfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index ae39540e468..a725ef132d7 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -345,7 +345,7 @@ enlargeStringInfo(StringInfo str, int needed)
* Guard against out-of-range "needed" values. Without this, we can get
* an overflow or infinite loop in the following.
*/
- if (needed < 0) /* should not happen */
+ if (unlikely(needed < 0)) /* should not happen */
{
#ifndef FRONTEND
elog(ERROR, "invalid string enlargement request size: %d", needed);
@@ -354,7 +354,7 @@ enlargeStringInfo(StringInfo str, int needed)
exit(EXIT_FAILURE);
#endif
}
- if (((Size) needed) >= (MaxAllocSize - (Size) str->len))
+ if (unlikely(((Size) needed) >= (MaxAllocSize - (Size) str->len)))
{
#ifndef FRONTEND
ereport(ERROR,
--
2.43.0
--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
filename=v20260912-0001-Refactor-float8out_internval-for-better-pe.patch
^ permalink raw reply [nested|flat] 1606+ messages in thread
end of thread, other threads:[~2024-09-11 04:25 UTC | newest]
Thread overview: 1606+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-02-28 23:34 Re: Binary support for pgoutput plugin Tom Lane <[email protected]>
2020-02-29 15:44 ` Dave Cramer <[email protected]>
2020-03-06 16:54 ` Petr Jelinek <[email protected]>
2020-03-07 23:18 ` Dave Cramer <[email protected]>
2020-04-03 07:42 ` Petr Jelinek <[email protected]>
2020-04-03 20:44 ` Dave Cramer <[email protected]>
2020-04-07 19:45 ` Dave Cramer <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20240912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
2024-09-11 04:25 [PATCH v20260912 3/4] add unlikely hint for enlargeStringInfo. Andy Fan <[email protected]>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox