- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit5b7e036
committed
Avoid unnecessary precision loss for pgbench's --rate target.
It's fairly silly to truncate the throttle_delay to integer when the onlymath we ever do with it requires converting back to double. Furthermore,given that people are starting to complain about restrictions like onlysupporting 1K client connections, I don't think we're very far away fromsituations where the precision loss matters. As the code stood, forexample, there's no difference between --rate 100001 and --rate 111111;both get converted to throttle_delay = 9. Somebody trying to run 100threads and have each one dispatch around 1K TPS would find this lack ofprecision rather surprising, especially since the required per-threaddelays are around 1ms, well within the timing precision of modern systems.1 parent64171b3 commit5b7e036
1 file changed
+13
-6
lines changedLines changed: 13 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
169 | 169 |
| |
170 | 170 |
| |
171 | 171 |
| |
172 |
| - | |
| 172 | + | |
173 | 173 |
| |
174 | 174 |
| |
175 | 175 |
| |
| |||
826 | 826 |
| |
827 | 827 |
| |
828 | 828 |
| |
| 829 | + | |
| 830 | + | |
| 831 | + | |
829 | 832 |
| |
830 | 833 |
| |
831 |
| - | |
| 834 | + | |
832 | 835 |
| |
833 | 836 |
| |
834 | 837 |
| |
| |||
839 | 842 |
| |
840 | 843 |
| |
841 | 844 |
| |
842 |
| - | |
| 845 | + | |
843 | 846 |
| |
844 | 847 |
| |
845 | 848 |
| |
| |||
5114 | 5117 |
| |
5115 | 5118 |
| |
5116 | 5119 |
| |
5117 |
| - | |
5118 |
| - | |
| 5120 | + | |
| 5121 | + | |
5119 | 5122 |
| |
5120 | 5123 |
| |
5121 | 5124 |
| |
| |||
5239 | 5242 |
| |
5240 | 5243 |
| |
5241 | 5244 |
| |
5242 |
| - | |
| 5245 | + | |
| 5246 | + | |
| 5247 | + | |
| 5248 | + | |
| 5249 | + | |
5243 | 5250 |
| |
5244 | 5251 |
| |
5245 | 5252 |
| |
|
0 commit comments
Comments
(0)