[postgis-tickets] [PostGIS] #4543: Use Ryū to output floating point numbers

PostGIS trac at osgeo.org
Fri Nov 22 10:37:08 PST 2019


#4543: Use Ryū to output floating point numbers
--------------------------+---------------------------
  Reporter:  Algunenano   |      Owner:  Algunenano
      Type:  enhancement  |     Status:  assigned
  Priority:  medium       |  Milestone:  PostGIS 3.1.0
 Component:  liblwgeom    |    Version:  master
Resolution:               |   Keywords:
--------------------------+---------------------------

Comment (by Algunenano):

 Some updates:
 - I have ryu now integrated inside postgis (under deps) so it builds and
 links without the need of anything external.
 - I've found some inconsistencies between what lwprint_double says it does
 with maxdd and what it actually does. Changing this breaks some tests but
 I think it's ok.
 - Ryu's scientific notation output doesn't trim extra zeros, so it might
 output `1.00000000e+100` instead of `1e+100` I'm not sure whether I want
 to try to fix it or just use snprintf (as it is) since those big numbers
 are rare on GIS.
 - I've started working on improving other parts of the print stack to keep
 improving the performance. I'm not sure if I'll continue down this path or
 move into fixing the broken tests (either by accepting the output or by
 changing the code).


 Comparison of the current status:

 * ST_AsText with big geometries:
 {{{
 explain analyze Select ST_AsText(the_geom) from
 benchmark_4c7214d90a79aa6760367a084a4d4a2f61fbe1c6cc4f7f9e76020;
 }}}
     * Before: 5166.606 / 5220.705 / 5218.330
     * After: 715.381 / 713.122 / 713.993


 * ST_AsGeoJson with big geometries:
 {{{
 explain analyze Select ST_AsGeoJson(the_geom) from
 benchmark_4c7214d90a79aa6760367a084a4d4a2f61fbe1c6cc4f7f9e76020;
 }}}
     * Before: 4738.816 / 4729.487 / 4810.050
     * After: 1057.564 / 1048.442 / 1062.282


 * ST_AsText with points (3 + 1 workers):
 {{{
 explain analyze Select ST_AsText(the_geom) from
 yellow_tripdata_2015_07_1m;
 }}}
     * Before: Before: 610.948 / 606.455 / 602.095
     * After:  274.195 / 273.759 / 279.207

 * ST_AsGeoJson with points  (3 + 1 workers):
 {{{
 explain analyze Select ST_AsGeoJson(the_geom) from
 yellow_tripdata_2015_07_1m;
 }}}
     * Before: 581.969 / 580.237 / 582.805
     * After:  320.685 / 316.013 / 320.374

-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/4543#comment:2>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list