Small improvement to json out functions by using cstring_to_text_with_len instead of cstring_to_text

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Small improvement to json out functions by using cstring_to_text_with_len instead of cstring_to_text
Date: 2013-11-14 07:18:03
Message-ID: CAApHDvoBeogDdc5g6FzyRkGOCJmtAa6vk3yg03CqcwCRbYErZw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

Here's a small patch which should speedup json out functions a little bit
by removing a call to strlen for which could be a long string.
The length of the string is already known by the StringInfoData, so there's
no point in letting cstring_to_text() loop over the whole string again.

Regards

David Rowley

Attachment Content-Type Size
ctring_to_text_with_len.diff text/plain 2.0 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2013-11-14 07:50:10 Re: ALTER SYSTEM SET command to change postgresql.conf parameters (RE: Proposal for Allow postgresql.conf values to be changed via SQL [review])
Previous Message Michael Paquier 2013-11-14 06:53:44 Re: Logging WAL when updating hintbit