[PATCH] Replace a long chain of if's in eval_const_expressions_mutator by a switch()
В списке pgsql-hackers по дате отправления:
| От | Andres Freund |
|---|---|
| Тема | [PATCH] Replace a long chain of if's in eval_const_expressions_mutator by a switch() |
| Дата | |
| Msg-id | 201111182113.25826.andres@anarazel.de обсуждение исходный текст |
| Ответы |
Re: [PATCH] Replace a long chain of if's in eval_const_expressions_mutator by a switch()
|
| Список | pgsql-hackers |
Hi, While playing around with writing a newer allocator last week (using a somewhat slab allocator alike architecture) I found eval_const_expressions_mutator to be surprisingly high in profiles. For unknown reasons the function used non chained ifs for every handled nodeType. Replacing the if chain with if; else if; ... resulted in a small speedup. Replacing it with a switch() in a bigger one. When testing with a statement containing a longer VALUES statement: pgbench -M prepared -f stmt -T 10: orig: 10015.28 if: 10075.48 switch: 10246.52 Thats a 2.3% increase over several runs. Other statements yielded smaller but all positive results. As far as I can see there currently is no point for writing the function as it is right now. Am I missing something? Andres
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера