MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Related Changesets ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0029399Open CASCADE[OCCT] OCCT:Foundation Classespublic2017-12-23 22:302018-06-29 21:19
Reporterabv 
Assigned Toapn 
PrioritynormalSeverityminor 
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target Version[OCCT] 7.3.0Fixed in Version[OCCT] 7.3.0 
Summary0029399: Optimize reading of floating point values from text strings
DescriptionDE module of OCCT uses its own function for reading floating point values from text strings, Interface_FileReaderData::Fastof(), which is made to be faster (2-5 times) than functions provided by standard library (strtod() or atof()).

The acceleration is due to simpler implementation, which does not support locale (thousands separators, custom symbol for radix etc.) and less precise calculations that may yield result different in 16-th digit.

It would be reasonable to use similar accelerated function in other places where numbers are read from strings, e.g. in reading BREP files. For that it seems to be sufficient to reimplement function Strtod() (which now calls standard strtod() with locale fixed to be standard C locale).
Steps To ReproduceN/A
TagsNo tags attached.
Test case numberperf draw restore, perf fclasses strtod
Attached Filesxlsx file icon strtod_benchmark.xlsx (33,807 bytes) 2018-01-04 23:31
zip file icon Standard_Strtod_adhoc.zip (16,527 bytes) 2018-01-04 23:31

- Relationships

-  Notes
(0073128)
git (administrator)
2017-12-25 21:18

Branch CR29399 has been created by abv.

SHA-1: 6992ed479f5bffdc993581f6ab6a21ba958c7dfe


Detailed log of new commits:

Author: abv
Date: Sun Dec 24 09:44:04 2017 +0300

    0029399: Optimize reading of floating point values from text strings
    
    Function Strtod() is reimplemented using custom code to provide better prformance (3-10 times faster) than standard strtod(), on expense of possibility to have error in 16-th digit (up to 2 epsilon).
    
    Strtod() is used in Interface_FileReaderData::Fastof() and in RWStl_Reader to accelerate their work.
(0073221)
abv (manager)
2018-01-02 16:01

Regressions on Windows:

Failed
3rdparty export A2 A3 A4 A5 A6 A7
bugs fclasses buc60727 bug9848_1 bug9848_2 bug11568_1 bug11568_2 bug11568_3 bug11568_4
bugs mesh bug26372
bugs modalg_2 bug22804
bugs modalg_5 bug23706_17 bug23706_19 bug23706_20 bug23706_22 bug23706_24 bug24347
bugs modalg_6 bug25613_2 bug26576_3 bug26896_1 bug26896_2 bug27263
bugs modalg_7 bug27390_1 bug27390_2 bug29293_1 bug29293_2
bugs moddata_3 bug24068 bug26038_2
bugs vis buc60632_1 buc60632_2 buc60915 bug10 bug218 bug301 bug21091_3 bug21091_4 bug21091_5 bug21091_6 bug21091_7 bug21091_8 bug21091_9 bug24133_1 bug24133_2 bug24133_3 bug24133_4 bug24288_1 bug24288_2 bug24288_3 bug24293 bug24351_1 bug24351_2 bug24351_3 bug24351_4 bug24374 bug24389 bug24412_1 bug24412_2 bug25403 bug25549_1 bug25549_2 bug26035_1 bug26035_3 bug26035_4 bug26035_5 bug26035_6 bug26056 bug26317 bug27688 bug27692 bug28099_text_core
bugs xde bug23193
caf basic N2
de step_1 A3
de step_3 E6
de_mesh stl_read A1 A5 A9 A13 C1 C4 C6 C8 C12
demo samples dimensions dimensionsglsl snowflake
heal split_angle_advanced ZD1
mesh standard_shading W7
offset simple A07 A14
offset wire_closed_inside_0_005 D1 E8
offset wire_closed_inside_0_025 E8
offset wire_closed_inside_0_075 E8
offset wire_closed_outside_0_005 E8
offset wire_closed_outside_0_025 E8
offset wire_closed_outside_0_075 E8
offset wire_unclosed_outside_0_005 A9 B6
offset wire_unclosed_outside_0_075 A9
v3d dimensions angle180 lengthparam lengthparam_flyout_reversed lengthparam_reversed lengthparam_reversed_direction lengthparam_reversed_flyout_reversed
v3d point_cloud sphere
Improvements
bugs modalg_6 bug26152_1 bug26152_2
de step_2 G6
offset with_intersect_80 L9

Regressions on Linux:

Failed
3rdparty export A1 A2 A3 A4 A5 A6 A7
bugs fclasses buc60727 bug9848_1 bug9848_2 bug11568_1 bug11568_2 bug11568_3 bug11568_4 bug26922
bugs modalg_7 bug29293_1 bug29293_2
bugs vis buc60632_1 buc60632_2 buc60915 bug10 bug218 bug301 bug21091_3 bug21091_4 bug21091_5 bug21091_6 bug21091_7 bug21091_8 bug21091_9 bug24133_1 bug24133_2 bug24133_3 bug24133_4 bug24288_1 bug24288_2 bug24288_3 bug24293 bug24351_1 bug24351_2 bug24351_3 bug24351_4 bug24374 bug24389 bug24412_1 bug24412_2 bug25403 bug25549_1 bug25549_2 bug26035_1 bug26035_3 bug26035_4 bug26035_5 bug26035_6 bug26056 bug26317 bug27688 bug27692 bug28099_text_core
bugs xde bug23193
de step_1 A3
de step_3 E6
de_mesh stl_read A1 A5 A9 A13 C1 C4 C6 C8 C12
demo draw binpersist_2
demo samples dimensions dimensionsglsl snowflake
perf fclasses strtod
v3d dimensions angle180 lengthparam lengthparam_flyout_reversed lengthparam_reversed lengthparam_reversed_direction lengthparam_reversed_flyout_reversed
v3d point_cloud sphere
(0073222)
abv (manager)
2018-01-02 16:04

Some of the above listed regressions are due to bug (single period "." was treated as valid real number, which led to misbehavior of Units package, and resulting in access violations), but most are due to not very accurate conversion (error in 16-th digit). That is, we need more accurate implementation.
(0073223)
git (administrator)
2018-01-02 17:57

Branch CR29399_1 has been created by abv.

SHA-1: 6d5342bbeb6b4a65208ba44d1d78fd5c81c2358a


Detailed log of new commits:

Author: abv
Date: Sun Dec 24 09:44:04 2017 +0300

    0029399: Optimize reading of floating point values from text strings
    
    Function Strtod() is reimplemented using open source (MIT-style license) code by David M. Gay instead of strtod() provided by standard run-time library. This improves performance by 3-10 times.
    
    Strtod() is used in Interface_FileReaderData::Fastof() and in RWStl_Reader to accelerate their work.
    
    DRAW command QATestAtof and test perf fclasses strtod are added to control correctness and performance of strtod.
(0073224)
git (administrator)
2018-01-02 20:50

Branch CR29399_1 has been updated forcibly by abv.

SHA-1: 55aa72617570c2ebe0578115a6ace1c38022c22e
(0073225)
git (administrator)
2018-01-02 23:36

Branch CR29399_1 has been updated forcibly by abv.

SHA-1: 4cf44b409faa661219f38c3ff6ba2fa2e738f005
(0073226)
git (administrator)
2018-01-02 23:53

Branch CR29399_1 has been updated forcibly by abv.

SHA-1: 6d9f7bbebddf4e2137d7c248d0be6516907ac9d4
(0073229)
abv (manager)
2018-01-04 10:08

The result of replacement of standard strtod() by implementation of David M. Gay is improvement of performance of reading large BREP and Ascii STL files.

The following times are measured in DRAW (MSVC 2010 64-bit, i7-4790 CPU):

File | Size | CPU OCCT 7.2.0 | CPU CR29399_2
----------------------------------------------------------------
bug28871_50056.brep | 68 MB | 3.7 sec | 2.7 sec
OCC22759-weldt6.brep| 36 MB | 1.25 sec | 0.64 sec
AR_s1_clean.stla | 4681 MB | 118 sec | 61 sec
(0073230)
git (administrator)
2018-01-04 10:25

Branch CR29399_1 has been updated forcibly by abv.

SHA-1: 938b975f4a3e566060523714e856d7839d17405b
(0073231)
abv (manager)
2018-01-04 22:58

Fix is pushed to branch CR29399_1, please review. The results of non-regression tests are in Jenkins job CR29399-master-abv. The results of manual tests of performance are given in 0029399:0073229.
(0073232)
abv (manager)
2018-01-04 23:37
edited on: 2018-01-04 23:38

Attached Excel file (strtod_benchmark.xlsx) contains results of testing of several implementations of strtod(). The one marked as "david" is use in the patch CR29399_1, as it is quite fast yet accurate. The ad-hoc implementation that I tried to build on my own (faster than david, but can give error in 16-th digit up to 2 epsilon) is attached in archive Standard_Strtod_adhoc.zip. In addition, the same archive contains a more precise version that uses 80-bytes floats and seems to be at the same level of accuracy as david, but slower.

The tests that show failures or improvements with ad-hoc implementation (i.e. deviations caused by difference in 16-digit) are (Windows 10 64-bit, MSVC 2010):

bugs mesh bug26372
bugs modalg_2 bug22804
bugs modalg_5 bug23706_17 bug23706_19 bug23706_20 bug23706_22 bug23706_24 bug24347
bugs modalg_6 bug25613_2 bug26576_3 bug26896_1 bug26896_2 bug27021 bug27263
bugs modalg_7 bug27390_1 bug27390_2
bugs moddata_3 bug24068 bug26038_2
caf basic N2
de step_3 E6
heal split_angle_advanced ZD1
mesh standard_shading W7
offset simple A07 A14
offset wire_closed_inside_0_005 D1 E8
offset wire_closed_inside_0_025 E8
offset wire_closed_inside_0_075 E8
offset wire_closed_outside_0_005 E8
offset wire_closed_outside_0_025 E8
offset wire_closed_outside_0_075 E8
offset wire_unclosed_outside_0_005 A9 B6
offset wire_unclosed_outside_0_075 A9

Improvements
bugs modalg_6 bug26152_1 bug26152_2
de step_2 G6

(0073235)
git (administrator)
2018-01-06 22:01

Branch CR29399_1 has been updated by abv.

SHA-1: 91052427c5f2830a748944334b6296dc9566a73a


Detailed log of new commits:

Author: abv
Date: Sat Jan 6 22:01:09 2018 +0300

    Functions Atof(), Strtod(), Printf(), Sprintf(), Fprintf() are declared as extern "C" to be usable from C programs.

(0073239)
abv (manager)
2018-01-07 14:20

I have added new Strtod() in Products, please review. Test results are in the same Jenkins job CR29399-master-abv
(0073242)
kgv (developer)
2018-01-07 16:37

+#if defined(_MSC_VER) && _MSC_VER < 1700
+      // MSVC < 2010 prints nan and inf as 1.#NAN or 1.INF, and noes not recognize nan or inf on 
read

MSVC <= 2010 ?

+static int check_atof (const NCollection_Array2<char>& theStrings, const char* theFormat,

+                       double (*test_func)(const char*), Draw_Interpretor& di)
+{
...
+    sprintf (buff, theFormat, aVal);

Wouldn't using sprintf instead of Sprintf lead to test failure in case of bad system locale?
(0073243)
kgv (developer)
2018-01-07 17:13

+    if (strcasecmp (buff, &theStrings(i,0)))

strcasecmp() does not return a bool, using it like this in if statement is confusing.

+      if (aNbErr < 5)
+      {
+        char aBuff[256];
+        sprintf (aBuff, "Deviation parsing %s and print back: %s\n", aStr, buff);
+        di << aBuff;

Is there any reason for using sprintf instead of direct output to di?

+  NCollection_Array2<char> aValuesStr (0, aNbToTest, 0, MAXLEN);

aNbToTest-1 ?

+static bool ReadVertex (const char* theStr, double& theX, double& theY, double& theZ)
...
+  // skip 'vertex'
+  while (isspace ((unsigned char)*aStr) || isalpha ((unsigned char)*aStr)) 
+    ++aStr;
...
+  return aEnd != aStr;

These checks are wrong (incomplete - keyword is not checked, presence of 3 float values is not checked), which might allow reading a messed up/non STL file without warnings.

+void Standard_GUID::Assign (const Standard_UUID& theUUID) 

The change is not mentioned in the commit description (and probably unrelated to the bug).

Standard_Strtod.cxx
...
+ This code has been downloaded from  http://www.netlib.org/fp/ [^] on 2017-12-16 
+ and adapted for use within Open CASCADE Technology as follows:

It might be useful pushing original code and modifications to it as separate commits, preserved during integration to master (just a suggestion).

+//! Returns 32-bit hash code for the first theLen charcters in the string theStr 
+__Standard_API Standard_Integer HashCodes (const Standard_CString theStr, const Standard_Integer theLen);

+
+//! Returns bounded hash code for the first theLen charcters in 
+//! the string theStr, in range [1, theUpper]

charcters
(0073244)
kgv (developer)
2018-01-07 18:45

-    float anIntensity;
+    double aIntensity = Strtod (aEnd3, &aEnd4);

anIntensity

+    if (*aStr++ == 'v' && isspace((unsigned char)*aStr++))

Two increments on the same line are very confusing.
(0073245)
git (administrator)
2018-01-07 21:20

Branch CR29399_1 has been updated by abv.

SHA-1: a65440260e906c0a106b09921b07e04bed3e7cdc


Detailed log of new commits:

Author: abv
Date: Sun Jan 7 21:20:04 2018 +0300

    # review remarks

(0073247)
abv (manager)
2018-01-07 21:21

Remarks are taken into account except a few:

> strcasecmp() does not return a bool, using it like this in if statement is confusing.

- using integer value in if() statements are fully compliant with C and C++ language specifications -- these values are implicitly converted to bool, see http://en.cppreference.com/w/cpp/language/implicit_conversion [^] section "Boolean conversions". Thus I see nothing confusing here.

> These checks are wrong (incomplete - keyword is not checked, presence of 3 float values is not checked), which might allow reading a messed up/non STL file without warnings.

- it was the same before the fix for CR29399. Absence of check for "vertex" is intentional relaxation of the reader - both for better performance and for possibility to read files with "vetrex" word being written in different case or otherwise differently. The STL format is not strictly defined and thus its syntax is controlled only partially - only keywords "facet", "outer", "solid" and "endsolid" are checked. For the facet definition, we rely on assumption that it has 3 lines, each contains some word followed by at least 3 real values. If this is not satisfied, error will be reported. You can improve this logic if you find it necessary.

> The change is not mentioned in the commit description (and probably unrelated to the bug).

- Yep, because this is minor change, not affecting anything and assumingly not interesting for anybody in practice.

> It might be useful pushing original code and modifications to it as separate commits, preserved during integration to master (just a suggestion).

- I see no reason in doing that; link to original source and thorough description of changes both provide a way for anyone to recover original version

> Two increments on the same line are very confusing.

- Here efficiency and clarity of the code take precedence over possibility to confuse someone (but who can be confused by plain C code?)
(0073248)
kgv (developer)
2018-01-07 21:57
edited on: 2018-01-08 01:20

>> strcasecmp() does not return a bool,
>> using it like this in if statement is confusing.
>- using integer value in if() statements are fully compliant
> with C and C++ language specifications
I wouldn't mention about something not complying standard, because this would usually emit compiler error or warning - this is more about coding style.
The same is for removing comparison with NULL.

>> These checks are wrong (incomplete - keyword is not checked,
>> presence of 3 float values is not checked),
>> which might allow reading a messed up/non STL file without warnings.
> - it was the same before the fix for CR29399.
Considering case insensitive check - such improvement should be done in dedicated patch, and relaxation within current patch is irrelevant, because other keywords are expected lower-cased. I have seen only once such files, where ALL keywords were all uppercased (not mixed).

> - Yep, because this is minor change,
> not affecting anything and assumingly not interesting for anybody in practice.
Then please drop it from this patch - it is unrelated.

> - I see no reason in doing that;
> link to original source and thorough description
> of changes both provide a way for anyone to recover original version
You are assuming two things:
1) External URL being available forever.
2) The original file will not receive new fixes.
While the second might be near to the true (e.g. original project will not receive any improvements / bug-fixes), the first one cannot be guaranteed and at some point can be lost.

(0073249)
kgv (developer)
2018-01-07 22:04

+      // MSVC < 2015 prints nan and inf as 1.#NAN or 1.INF, and noes not recognize nan or inf on 
read

noes.

 936   sprintf (aFormat, "%%.%dlg", Max (2, Min (20, aNbDigits)));
...
 949       double aVal = aRandomDistr (aRandomEngine);
 950       sprintf(&aValuesStr(i,0), aFormat, aVal);
...
1004       sprintf(&aValuesStr(i,0), aFormat, aVal.valdbl);

Shouldn't be Sprintf used here as well?
(0073251)
git (administrator)
2018-01-08 10:53

Branch CR29399_1 has been updated by abv.

SHA-1: 99dacd245b7b109c710a1c73f3058e6853044d5e


Detailed log of new commits:

Author: abv
Date: Mon Jan 8 10:53:37 2018 +0300

    Method Standard_GUID::Assign (const Standard_UUID&) is implemented (was empty).

(0073253)
abv (manager)
2018-01-08 14:44

Regarding use of NULL, see discussion here:
https://stackoverflow.com/questions/3825668/checking-for-null-pointer-in-c-c [^]
(0073297)
git (administrator)
2018-01-10 22:30

Branch CR29399_2 has been created by abv.

SHA-1: 0b3b5136474971f064aceee87e7169cf9e9784dd


Detailed log of new commits:

Author: abv
Date: Sun Dec 24 09:44:04 2017 +0300

    0029399: Optimize reading of floating point values from text strings
    
    Function Strtod() is reimplemented using open source (MIT-style license) code by David M. Gay instead of strtod() provided by standard run-time library. This improves performance by 3-10 times.
    
    Functions Atof(), Strtod(), Printf(), Sprintf(), Fprintf() are declared as extern "C" to be usable from C programs.
    
    Strtod() is used in Interface_FileReaderData::Fastof() and in RWStl_Reader to accelerate their work.
    
    DRAW command QATestAtof and test perf fclasses strtod are added to control correctness and performance of strtod.
    
    Method Standard_GUID::Assign (const Standard_UUID&) is implemented (was empty).

Author: abv
Date: Wed Jan 10 21:17:35 2018 +0300

    0029399: Optimize reading of floating point values from text strings -- base dtoa.c
    
    Fast implementation of strtod downloaded from www.netlib.org/fp/dtoa.c (base version) is integrated as Standard_Strtod.cxx.
(0073298)
abv (manager)
2018-01-10 22:33

I have pushed branch CR29399_2 which is the same as CR29399_1 (thus results of testing are relevant - see Jenkins job CR29399-master-abv), but split in two commits as per the laet remark -- the first commit is integration of base (unmodified) version of dtoa.c as downloaded from its source site, for future reference. Please review.
(0073299)
kgv (developer)
2018-01-10 22:36

Please take the patch.
(0073304)
apn (administrator)
2018-01-11 10:21

Combination -
OCCT branch : CR29399_1 SHA - a65440260e906c0a106b09921b07e04bed3e7cdc
Products branch : CR29399 SHA - aea4ea0bef935f11aa06f5979d609a4518fe82dc
was compiled on Linux, MacOS and Windows platforms and tested in optimize mode.

Number of compiler warnings:
No new/fixed warnings

Regressions/Differences/Improvements:
No regressions/differences

CPU differences:
Debian70-64:
OCCT
Total CPU difference: 18356.309999999714 / 18498.959999999654 [-0.77%]
Products
Total CPU difference: 7448.9100000000135 / 7484.560000000007 [-0.48%]
Windows-64-VC10:
OCCT
Total CPU difference: 17878.77540679854 / 17960.90993329856 [-0.46%]
Products
Total CPU difference: 7986.861197499988 / 8020.448212799986 [-0.42%]

Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention
(0073378)
apn (administrator)
2018-01-12 11:30
edited on: 2018-01-12 13:19

There are following compilation errors on platforms with old compilers:

CentOS64-64-opt (gcc 4.4.7 20120313), Windows-32-VC9-opt, Windows-64-VC9-opt:

/builds/IR-WEEK2_IR-WEEK2/CentOS64-64-opt/OCCT/src/QANCollection/QANCollection_Test.cxx:945: error: 'default_random_engine' is not a member of 'std'
/builds/IR-WEEK2_IR-WEEK2/CentOS64-64-opt/OCCT/src/QANCollection/QANCollection_Test.cxx:945: error: expected ';' before 'aRandomEngine'
/builds/IR-WEEK2_IR-WEEK2/CentOS64-64-opt/OCCT/src/QANCollection/QANCollection_Test.cxx:946: error: 'uniform_real_distribution' is not a member of 'std'
/builds/IR-WEEK2_IR-WEEK2/CentOS64-64-opt/OCCT/src/QANCollection/QANCollection_Test.cxx:946: error: expected primary-expression before 'double'
/builds/IR-WEEK2_IR-WEEK2/CentOS64-64-opt/OCCT/src/QANCollection/QANCollection_Test.cxx:946: error: expected ';' before 'double'
/builds/IR-WEEK2_IR-WEEK2/CentOS64-64-opt/OCCT/src/QANCollection/QANCollection_Test.cxx:949: error: 'aRandomEngine' was not declared in this scope
/builds/IR-WEEK2_IR-WEEK2/CentOS64-64-opt/OCCT/src/QANCollection/QANCollection_Test.cxx:949: error: 'aRandomDistr' was not declared in this scope
/builds/IR-WEEK2_IR-WEEK2/CentOS64-64-opt/OCCT/src/QANCollection/QANCollection_Test.cxx:995: error: 'default_random_engine' is not a member of 'std'
/builds/IR-WEEK2_IR-WEEK2/CentOS64-64-opt/OCCT/src/QANCollection/QANCollection_Test.cxx:995: error: expected ';' before 'aRandomEngine'
/builds/IR-WEEK2_IR-WEEK2/CentOS64-64-opt/OCCT/src/QANCollection/QANCollection_Test.cxx:996: error: 'uniform_int_distribution' is not a member of 'std'
/builds/IR-WEEK2_IR-WEEK2/CentOS64-64-opt/OCCT/src/QANCollection/QANCollection_Test.cxx:996: error: expected primary-expression before '>' token
/builds/IR-WEEK2_IR-WEEK2/CentOS64-64-opt/OCCT/src/QANCollection/QANCollection_Test.cxx:996: error: 'aRandomDistr' was not declared in this scope
/builds/IR-WEEK2_IR-WEEK2/CentOS64-64-opt/OCCT/src/QANCollection/QANCollection_Test.cxx:1003: error: 'aRandomEngine' was not declared in this scope

http://jenkins-test-08.nnov.opencascade.com/view/IR-WEEK2_IR-WEEK2/view/OCCT%20compile/job/IR-WEEK2_IR-WEEK2-OCCT-CentOS64-64-opt-compile/2/parsed_console/ [^]
http://jenkins-test-08.nnov.opencascade.com/view/IR-WEEK2_IR-WEEK2/view/OCCT%20compile/job/IR-WEEK2_IR-WEEK2-OCCT-Windows-32-VC9-opt-compile/2/parsed_console/ [^]
http://jenkins-test-08.nnov.opencascade.com/view/IR-WEEK2_IR-WEEK2/view/OCCT%20compile/job/IR-WEEK2_IR-WEEK2-OCCT-Windows-64-VC9-opt-compile/2/parsed_console/ [^]

Minimal working gcc version among testing stations is gcc 4.7.2.

(0073584)
git (administrator)
2018-01-25 04:48

Branch CR29399_3 has been created by abv.

SHA-1: 9d6702c778c3f07a7528891098755f461c89b978


Detailed log of new commits:

Author: abv
Date: Sun Dec 24 09:44:04 2017 +0300

    0029399: Optimize reading of floating point values from text strings
    
    Function Strtod() is reimplemented using open source (MIT-style license) code by David M. Gay instead of strtod() provided by standard run-time library. This improves its performance by 3-10 times.
    
    Functions Atof(), Strtod(), Printf(), Sprintf(), Fprintf() are declared as extern "C" to be usable from C programs.
    
    Strtod() is used in Interface_FileReaderData::Fastof() and in RWStl_Reader to accelerate their work.
    
    DRAW command QATestAtof and test perf fclasses strtod are added to check correctness and performance of Strtod().
    
    Method Standard_GUID::Assign (const Standard_UUID&) is implemented (was empty).

Author: abv
Date: Wed Jan 10 21:17:35 2018 +0300

    0029399: Optimize reading of floating point values from text strings -- base dtoa.c
    
    Fast implementation of strtod downloaded from www.netlib.org/fp/dtoa.c (base version) is integrated as Standard_Strtod.cxx.
(0073587)
git (administrator)
2018-01-25 11:08

Branch CR29399_3 has been updated forcibly by abv.

SHA-1: d0800af571fc19413fb537b7a2dab7280d447319
(0073588)
abv (manager)
2018-01-25 11:16

I have updated implementation of test command to not rely on C++ random generator functionality missing in older compilers, and checked that it builds with VC9 - 14. Please check compilation on CentOS to see if it OK.
(0073593)
apn (administrator)
2018-01-25 14:07
edited on: 2018-01-25 14:08

There are following compilation errors on Linux platforms:

/builds/CR29399_3_CR29399/Debian70-64-opt/OCCT/src/QANCollection/QANCollection_Test.cxx: In function 'Standard_Integer QATestAtof(Draw_Interpretor&, Standard_Integer, const char**)':
/builds/CR29399_3_CR29399/Debian70-64-opt/OCCT/src/QANCollection/QANCollection_Test.cxx:952:50: error: 'numeric_limits' is not a member of 'std'
/builds/CR29399_3_CR29399/Debian70-64-opt/OCCT/src/QANCollection/QANCollection_Test.cxx:952:78: error: expected primary-expression before '>' token
/builds/CR29399_3_CR29399/Debian70-64-opt/OCCT/src/QANCollection/QANCollection_Test.cxx:952:79: error: '::max' has not been declared

http://jenkins-test-08.nnov.opencascade.com/view/CR29399_3_CR29399/view/OCCT%20compile/job/CR29399_3_CR29399-OCCT-CentOS64-64-opt-compile/1/parsed_console/ [^]
http://jenkins-test-08.nnov.opencascade.com/view/CR29399_3_CR29399/view/OCCT%20compile/job/CR29399_3_CR29399-OCCT-Debian70-64-opt-compile/1/parsed_console/ [^]

(0073608)
git (administrator)
2018-01-26 12:46

Branch CR29399_3 has been updated by abv.

SHA-1: b6363621a88a9f8043fddf071c387de4e3f44ff7


Detailed log of new commits:

Author: abv
Date: Fri Jan 26 12:45:51 2018 +0300

    # correction for old GCC

(0073609)
abv (manager)
2018-01-26 12:46

Correction is pushed, please re-check
(0073612)
apn (administrator)
2018-01-26 14:40

Compilation is OK.
http://jenkins-test-08.nnov.opencascade.com/view/CR29399_3_CR29399/view/OCCT%20compile/ [^]
(0073613)
abv (manager)
2018-01-26 15:44

Shall I re-run tests? or results of previous tests would be sufficient? (the last change affected only test command implementation, already tested on Windows).
(0073621)
apn (administrator)
2018-01-26 19:21

Combination -
OCCT branch : CR29399_3 SHA - b6363621a88a9f8043fddf071c387de4e3f44ff7
Products branch : CR29399 SHA - aea4ea0bef935f11aa06f5979d609a4518fe82dc
was compiled on Linux, MacOS and Windows platforms and tested in optimize mode.

Number of compiler warnings:
No new/fixed warnings

Regressions/Differences/Improvements:
No regressions/differences

CPU differences:
Debian70-64:
OCCT
Total CPU difference: 18323.489999999645 / 18449.779999999675 [-0.68%]
Products
Total CPU difference: 7452.380000000004 / 7437.72000000001 [+0.20%]
Windows-64-VC10:
OCCT
Total CPU difference: 17882.285429298623 / 17999.364179798602 [-0.65%]
Products
Total CPU difference: 7954.334988999978 / 7980.137554399978 [-0.32%]

Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention
(0073738)
kgv (developer)
2018-02-02 19:37

After porting CAD Assistant and replacing fscanf with Strtod in ASCII STL reader,
reading a big ASCII STL file (AR_s1_clean.stla, 4.7 GiB):
- fscanf (vc10): 114 sec
- fscanf (vc14): 127 sec
- Strtod (vc14): 34 sec

Strtod is quite helpful.
(0073771)
git (administrator)
2018-02-05 11:39

Branch CR29399 has been deleted by kgv.

SHA-1: 6992ed479f5bffdc993581f6ab6a21ba958c7dfe
(0073772)
git (administrator)
2018-02-05 11:39

Branch CR29399_1 has been deleted by kgv.

SHA-1: 99dacd245b7b109c710a1c73f3058e6853044d5e
(0073773)
git (administrator)
2018-02-05 11:39

Branch CR29399_2 has been deleted by kgv.

SHA-1: 0b3b5136474971f064aceee87e7169cf9e9784dd
(0073774)
git (administrator)
2018-02-05 11:39

Branch CR29399_3 has been deleted by kgv.

SHA-1: b6363621a88a9f8043fddf071c387de4e3f44ff7

- Related Changesets
occt: master 07bbde45
Timestamp: 2017-12-24 06:44:04
Author: abv
Committer: apn
Details ] Diff ]
0029399: Optimize reading of floating point values from text strings

Function Strtod() is reimplemented using open source (MIT-style license) code by David M. Gay instead of strtod() provided by standard run-time library. This improves its performance by 3-10 times.

Functions Atof(), Strtod(), Printf(), Sprintf(), Fprintf() are declared as extern "C" to be usable from C programs.

Strtod() is used in Interface_FileReaderData::Fastof() and in RWStl_Reader to accelerate their work.

DRAW command QATestAtof and test perf fclasses strtod are added to check correctness and performance of Strtod().
Test perf draw restore is added to monitor performance of reading BREP files.

Minor off-topic corrections:
- method Standard_GUID::Assign (const Standard_UUID&) is implemented (was empty);
- Precision.hxx is included in BRepMesh_Vertex.hxx that uses it.
mod - dox/overview/overview.md Diff ] File ]
mod - src/BRepMesh/BRepMesh_Vertex.hxx Diff ] File ]
mod - src/Interface/Interface_FileReaderData.cxx Diff ] File ]
mod - src/QANCollection/QANCollection_Test.cxx Diff ] File ]
mod - src/RWStl/RWStl_Reader.cxx Diff ] File ]
mod - src/Standard/FILES Diff ] File ]
mod - src/Standard/Standard_CString.cxx Diff ] File ]
mod - src/Standard/Standard_CString.hxx Diff ] File ]
mod - src/Standard/Standard_GUID.cxx Diff ] File ]
rm - src/Standard/Standard_SStream.cxx Diff ] File ]
mod - src/Standard/Standard_Strtod.cxx Diff ] File ]
rm - src/Standard/Standard_UUID.cxx Diff ] File ]
mod - tests/de/step_1/A3 Diff ] File ]
mod - tests/de/step_3/E6 Diff ] File ]
add - tests/perf/draw/restore Diff ] File ]
add - tests/perf/fclasses/strtod Diff ] File ]
occt: master 0edbf105
Timestamp: 2018-01-10 18:17:35
Author: abv
Committer: apn
Details ] Diff ]
0029399: Optimize reading of floating point values from text strings -- base dtoa.c

Fast implementation of strtod downloaded from www.netlib.org/fp/dtoa.c (base version) is integrated as Standard_Strtod.cxx.
add - src/Standard/Standard_Strtod.cxx Diff ] File ]

- Issue History
Date Modified Username Field Change
2017-12-23 22:30 abv New Issue
2017-12-23 22:30 abv Assigned To => abv
2017-12-25 21:18 git Note Added: 0073128
2018-01-02 16:01 abv Note Added: 0073221
2018-01-02 16:04 abv Note Added: 0073222
2018-01-02 17:57 git Note Added: 0073223
2018-01-02 20:50 git Note Added: 0073224
2018-01-02 23:36 git Note Added: 0073225
2018-01-02 23:53 git Note Added: 0073226
2018-01-04 10:08 abv Note Added: 0073229
2018-01-04 10:25 git Note Added: 0073230
2018-01-04 22:58 abv Note Added: 0073231
2018-01-04 22:58 abv Status new => resolved
2018-01-04 22:58 abv Steps to Reproduce Updated View Revisions
2018-01-04 23:31 abv File Added: strtod_benchmark.xlsx
2018-01-04 23:31 abv File Added: Standard_Strtod_adhoc.zip
2018-01-04 23:37 abv Note Added: 0073232
2018-01-04 23:38 abv Note Edited: 0073232 View Revisions
2018-01-05 18:22 abv Assigned To abv => kgv
2018-01-06 22:01 git Note Added: 0073235
2018-01-07 14:20 abv Note Added: 0073239
2018-01-07 16:37 kgv Note Added: 0073242
2018-01-07 17:13 kgv Note Added: 0073243
2018-01-07 18:45 kgv Note Added: 0073244
2018-01-07 18:45 kgv Assigned To kgv => abv
2018-01-07 18:45 kgv Status resolved => assigned
2018-01-07 21:20 git Note Added: 0073245
2018-01-07 21:21 abv Note Added: 0073247
2018-01-07 21:57 kgv Note Added: 0073248
2018-01-07 22:04 kgv Note Added: 0073249
2018-01-08 01:20 kgv Note Edited: 0073248 View Revisions
2018-01-08 10:53 git Note Added: 0073251
2018-01-08 14:44 abv Note Added: 0073253
2018-01-10 22:30 git Note Added: 0073297
2018-01-10 22:33 abv Note Added: 0073298
2018-01-10 22:36 kgv Note Added: 0073299
2018-01-10 22:36 kgv Assigned To abv => bugmaster
2018-01-10 22:36 kgv Status assigned => resolved
2018-01-10 22:36 kgv Status resolved => reviewed
2018-01-11 10:21 apn Test case number => Not needed
2018-01-11 10:21 apn Note Added: 0073304
2018-01-11 10:21 apn Status reviewed => tested
2018-01-12 11:30 apn Note Added: 0073378
2018-01-12 11:30 apn Assigned To bugmaster => abv
2018-01-12 11:30 apn Status tested => assigned
2018-01-12 13:19 apn Note Edited: 0073378 View Revisions
2018-01-25 04:48 git Note Added: 0073584
2018-01-25 11:08 git Note Added: 0073587
2018-01-25 11:16 abv Note Added: 0073588
2018-01-25 11:16 abv Assigned To abv => apn
2018-01-25 11:16 abv Status assigned => feedback
2018-01-25 14:07 apn Note Added: 0073593
2018-01-25 14:07 apn Assigned To apn => abv
2018-01-25 14:08 apn Note Edited: 0073593 View Revisions
2018-01-26 12:46 git Note Added: 0073608
2018-01-26 12:46 abv Note Added: 0073609
2018-01-26 14:40 apn Note Added: 0073612
2018-01-26 15:44 abv Note Added: 0073613
2018-01-26 19:21 apn Note Added: 0073621
2018-01-26 19:21 apn Assigned To abv => bugmaster
2018-01-26 19:21 apn Status feedback => tested
2018-01-26 19:24 apn Test case number Not needed => perf draw restore, perf fclasses strtod
2018-01-28 12:18 apn Changeset attached => occt master 07bbde45
2018-01-28 12:18 apn Changeset attached => occt master 0edbf105
2018-01-28 12:18 apn Assigned To bugmaster => apn
2018-01-28 12:18 apn Status tested => verified
2018-01-28 12:18 apn Resolution open => fixed
2018-01-29 16:31 kgv Relationship added related to 0029461
2018-02-02 19:37 kgv Note Added: 0073738
2018-02-05 11:39 git Note Added: 0073771
2018-02-05 11:39 git Note Added: 0073772
2018-02-05 11:39 git Note Added: 0073773
2018-02-05 11:39 git Note Added: 0073774
2018-02-12 22:27 kgv Relationship added related to 0028970
2018-06-29 21:15 user533 Fixed in Version => 7.3.0
2018-06-29 21:19 user533 Status verified => closed


Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker