forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitd996d64
committed
Simplify the inner loop of numeric division in div_var().
In the standard numeric division algorithm, the inner loop multipliesthe divisor by the next quotient digit and subtracts that from theworking dividend. As suggested by the original code comment, theseparate "carry" and "borrow" variables (from the multiplication andsubtraction steps respectively) can be folded together into a singlevariable. Doing so significantly improves performance, as well assimplifying the code.Dean Rasheed, reviewed by Tom Lane.Discussion:https://postgr.es/m/CAEZATCVwsBi-ND-t82Cuuh1=8ee6jdOpzsmGN+CUZB6yjLg9jw@mail.gmail.com1 parente3d41d0 commitd996d64
1 file changed
+15
-21
lines changedLines changed: 15 additions & 21 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8605 | 8605 |
| |
8606 | 8606 |
| |
8607 | 8607 |
| |
| 8608 | + | |
| 8609 | + | |
8608 | 8610 |
| |
8609 | 8611 |
| |
8610 |
| - | |
8611 |
| - | |
| 8612 | + | |
| 8613 | + | |
| 8614 | + | |
| 8615 | + | |
| 8616 | + | |
8612 | 8617 |
| |
8613 |
| - | |
8614 | 8618 |
| |
8615 | 8619 |
| |
8616 | 8620 |
| |
8617 |
| - | |
8618 |
| - | |
8619 |
| - | |
8620 |
| - | |
8621 |
| - | |
8622 |
| - | |
8623 |
| - | |
8624 |
| - | |
8625 |
| - | |
8626 |
| - | |
8627 |
| - | |
8628 |
| - | |
8629 |
| - | |
8630 |
| - | |
| 8621 | + | |
| 8622 | + | |
| 8623 | + | |
| 8624 | + | |
| 8625 | + | |
8631 | 8626 |
| |
8632 |
| - | |
8633 | 8627 |
| |
8634 | 8628 |
| |
8635 | 8629 |
| |
| |||
8645 | 8639 |
| |
8646 | 8640 |
| |
8647 | 8641 |
| |
8648 |
| - | |
| 8642 | + | |
8649 | 8643 |
| |
8650 | 8644 |
| |
8651 |
| - | |
| 8645 | + | |
8652 | 8646 |
| |
8653 | 8647 |
| |
8654 | 8648 |
| |
8655 | 8649 |
| |
8656 |
| - | |
| 8650 | + | |
8657 | 8651 |
| |
8658 | 8652 |
| |
8659 | 8653 |
| |
|
0 commit comments
Comments
(0)