[postgis-tickets] [PostGIS] #4775: [3.1] Performance regression on gserialized_overlaps_2d

PostGIS trac at osgeo.org
Fri Oct 23 06:40:51 PDT 2020


#4775: [3.1] Performance regression on gserialized_overlaps_2d
------------------------+---------------------------
 Reporter:  Algunenano  |      Owner:  Algunenano
     Type:  defect      |     Status:  assigned
 Priority:  medium      |  Milestone:  PostGIS 3.1.0
Component:  postgis     |    Version:  master
 Keywords:              |
------------------------+---------------------------
 While doing a perf check over 3.1 I've noticed a slowdown on some MVT
 queries (the only ones I'm running).

 The underlying database is exactly the same, with the same query and plan
 (I just changed the .so library), and when I compare the perf output of
 both 3.0 and 3.1 I get this:

 - 3.0 (only the gserialized_overlaps_2d part)

 {{{
 -   11.76%     1.24%  postgres  postgis-3.so            [.]
 gserialized_overlaps_2d                                         ▒
    - 10.52% gserialized_overlaps_2d
 ▒
       - 9.96% gserialized_datum_get_box2df_p
 ▒
          - 3.19% gserialized2_get_gbox_p
 ▒
             - 2.78% gserialized2_peek_gbox_p
 ▒
                  1.25% gbox_float_round
 ▒
                  0.85% nextafterf32
 ▒
            1.78% __memmove_avx_unaligned_erms
 ▒
          - 1.34% heap_tuple_untoast_attr
 ▒
             - 0.77% palloc
 ▒
                  AllocSetAlloc
 ▒
            0.61% AllocSetFree
 ▒
    - 0.80% __libc_start_main
 ▒
         0x5569d1f94705
 ▒
         PostmasterMain
 ▒
         __restore_rt
 ▒
         sigusr1_handler
 ▒
         0x5569d202d837
 ▒
         StartBackgroundWorker
 ▒
         ParallelWorkerMain
 ▒
         ParallelQueryMain
 ▒
         standard_ExecutorRun
 ▒
         ExecAgg
 ▒
         fetch_input_tuple
 ▒
       - ExecScan
 ▒
          - 0.80% ExecInterpExpr
 ▒
               0.70% gserialized_overlaps_2

 }}}

 * 3.1 (gserialized_overlaps_2d part):

 {{{
    - 20.41% gserialized_overlaps_2d
 ▒
       - 20.01% gserialized_datum_predicate_2d
 ▒
          - 15.83% gserialized_datum_get_internals_p
 ▒
             - 4.42% gserialized2_get_gbox_p
 ▒
                - 2.50% gserialized2_peek_gbox_p
 ▒
                     1.22% gbox_float_round
 ▒
                     0.79% nextafterf32
 ▒
                  1.32% gserialized2_read_gbox_p.llvm.13873022969809935523
 ▒
             - 4.31% heap_tuple_untoast_attr_slice
 ▒
                - 1.85% palloc
 ▒
                     AllocSetAlloc
 ▒
               1.43% __memmove_avx_unaligned_erms
 ▒
               1.09% AllocSetFree
 ▒
               0.68% heap_tuple_untoast_attr
 }}}


 So it has gone from ~12% of the query to ~20% of the CPU time spent in the
 query.

 I did tinker around these functions for #4676 so that's likely to be the
 culprit.

-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/4775>
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