On Sun, Apr 19, 2020 at 11:24:38AM -0300, Ranier Vilela wrote:
Hi, strlen it is one of the low fruits that can be harvested. What is your opinion?
That assumes this actually affects/improves performance, without any measurements proving that. Considering large number of the places you modified are related to DDL (CreateComment, ChooseIndexColumnNames, ...) or stuff that runs only once or infrequently (like the changes in PostmasterMain or libpqrcv_get_senderinfo). Likewise, it seems entirely pointless to worry about strlen() overhead e.g. in fsync_parent_path which is probably dominated by I/O. Maybe there are places where this would help, but I don't see a reason to just throw away all strlen calls and replace them with something clearly less convenient and possibly more error-prone (I'd expect quite a few off-by-one mistakes with this). regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services