Re: Missed compiler optimization issue in function select_rtable_names_for_explain

Поиск
Список
Период
Сортировка
Искать
От
XChy
Тема
Re: Missed compiler optimization issue in function select_rtable_names_for_explain
Дата
в 10:12:57
Msg-id
OS0P286MB01632009BF9AA52386BA9E4D82EB2@OS0P286MB0163.JPNP286.PROD.OUTLOOK.COM
Ответ на
Список
Дерево обсуждения
Missed compiler optimization issue in function select_rtable_names_for_explain XChy <xxs_chy@outlook.com>
Re: Missed compiler optimization issue in function select_rtable_names_for_explain Daniel Gustafsson <daniel@yesql.se>
Re: Missed compiler optimization issue in function select_rtable_names_for_explain XChy <xxs_chy@outlook.com>
Re: Missed compiler optimization issue in function select_rtable_names_for_explain Daniel Gustafsson <daniel@yesql.se>
Re: Missed compiler optimization issue in function select_rtable_names_for_explain Tom Lane <tgl@sss.pgh.pa.us>
Re: Missed compiler optimization issue in function select_rtable_names_for_explain Daniel Gustafsson <daniel@yesql.se>
Re: Missed compiler optimization issue in function select_rtable_names_for_explain XChy <xxs_chy@outlook.com>
Re: Missed compiler optimization issue in function select_rtable_names_for_explain Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: Missed compiler optimization issue in function select_rtable_names_for_explain Tom Lane <tgl@sss.pgh.pa.us>
Hash join and picking which result set to build the hash table with. "Dirschel, Steve" <steve.dirschel@thomsonreuters.com>
Re: Hash join and picking which result set to build the hash table with. Tom Lane <tgl@sss.pgh.pa.us>
Re: Missed compiler optimization issue in function select_rtable_names_for_explain Daniel Gustafsson <daniel@yesql.se>
How is the memset in select_rtable_names_for_explain a dead-store? Even memset
calls could be optimized away from the EXPLAIN codepath I have a feeling it
would have to be many in a tight loop for it to be measurable even?

--
Daniel Gustafsson

For the first question, I don't mean that the memset is the dead store. I mean that the stores with value "0" after the memset are dead:

```

    dpns.subplans = NIL;
    dpns.ctes = NIL;
    dpns.appendrels = NULL;
```
since the memset has written zeroes to the object "dpns", and these members are known to be zero.

For the second question, you are right, I don't really profile it or measure the performance impact for it. I just think it's worthwhile to improve codegen quality without affecting readability, as adopting performance tips from some static analyzer.

Best regards, Hongyu.

В списке pgsql-general по дате отправления
От: Daniel Gustafsson
Дата:
От: o1bigtenor
Дата:
FAQ