Skip to Content.
Sympa Menu

freetds - [freetds] tds_convert speed

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "James K. Lowden" <jklowden AT schemamania.org>
  • To: TDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: [freetds] tds_convert speed
  • Date: Sat, 8 Feb 2003 20:42:33 -0500

All,

I added a unit test src/tds/unittests/convert.c. It tests every datatype
conversion possible (subject to tds_willconvert). If you give it a
parameter (which "make check" will not do), it runs the conversion that
number of times, and computes iterations/second.

Below is how we do converting to varchar. This is significant for bcp
performance if you use the -c switch to write/read text data files.

Also, we fail in 10 (other) cases. These are cases where we return
TDS_CONVERT_NOAVAIL -- which I take to mean "we can't do that" -- even
though tds_willconvert() returns true.

--jkl

$ make convert && ./convert 1 2>err \
|grep interations \
|grep 'varchar\.' \
|sort -n \
; grep fail err

`convert' is up to date.
174 interations/second converting numeric => varchar.
329 interations/second converting decimal => varchar.
5128 interations/second converting money => varchar.
62602 interations/second converting binary => varchar.
62602 interations/second converting datetime => varchar.
66576 interations/second converting image => varchar.
91181 interations/second converting smalldatetime => varchar.
99864 interations/second converting real => varchar.
99864 interations/second converting tinyint => varchar.
99864 interations/second converting long long => varchar.
110376 interations/second converting int => varchar.
110376 interations/second converting float => varchar.
110376 interations/second converting smallint => varchar.
111848 interations/second converting smallmoney => varchar.
142180 interations/second converting bit => varchar.
167772 interations/second converting char => varchar.
167772 interations/second converting text => varchar.
failed (-2) to convert 45 (binary, 7 bytes) : 108 (numeric).
failed (-2) to convert 45 (binary, 7 bytes) : 106 (decimal).
failed (-2) to convert 45 (binary, 1 bytes) : 50 (bit).
failed (-2) to convert 34 (image, 7 bytes) : 108 (numeric).
failed (-2) to convert 34 (image, 7 bytes) : 106 (decimal).
failed (-2) to convert 34 (image, 1 bytes) : 50 (bit).
failed (-2) to convert 108 (numeric, 35 bytes) : 60 (money).
failed (-2) to convert 108 (numeric, 35 bytes) : 122 (smallmoney).
failed (-2) to convert 106 (decimal, 35 bytes) : 60 (money).
failed (-2) to convert 106 (decimal, 35 bytes) : 122 (smallmoney).




Archive powered by MHonArc 2.6.24.

Top of Page