Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9515299

Browse files
committed
Improve handling of numeric-valued variables in pgbench.
The previous coding always stored variable values as strings, doingconversion on-the-fly when a numeric value was needed or a number was to beassigned. This was a bit inefficient and risked loss of precision forfloating-point values. The precision aspect had been hacked around byprinting doubles in "%.18e" format, which is ugly and has machine-dependentresults. Instead, arrange to preserve an assigned numeric value in theoriginal binary numeric format, converting to string only when and ifneeded. When we do need to convert a double to string, convert in "%g"format with DBL_DIG precision, which is the standard way to do it andproduces the least surprising results in most cases.The implementation supports storing both a string value and a numericvalue for any one variable, with lazy conversion between them. I alsoarranged for lazy re-sorting of the variable array when new variables areadded. That was mainly to allow a clean refactoring of putVariable()into two levels of subroutine, but it may allow us to save a few sorts.Discussion: <9188.1462475559@sss.pgh.pa.us>
1 parentdaa9856 commit9515299

File tree

1 file changed

+188
-86
lines changed

1 file changed

+188
-86
lines changed

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp