Menu

#5922 Rewrite Skyline code

Started
None
needs_work
2020-04-29
2020-04-19
No
  • Do not use contiguous buildings. Instead, Y=-infinity is represented
    by simply omitting the building. This reduces memory requirements
    (for example, an empty skyline needs no buildings at all.), and
    obviates the Skyline::normalize() call which takes ~1 % of CPU.

  • Buildings store Y coordinate of the left edge, rather than the
    intercept at x==0.0. This avoid excessive rounding problems when X
    is large, and lets us compute building.height_at(x[LEFT]) cheaply.

  • Avoid using infinity and NaN. We only let the X coordinates at the
    be infinite (which is only necessary if a minimum height is
    specified)

  • Aggressively prune zero width
    buildings. Adjust input/regression/skyline-point-extent to match
    this behavior

  • Simplify the merge code, using less nested if statements.

  • Add a unittest for the Skyline code

  • Debug output is produced with Lookup::segments_to_line_stencil()

https://codereview.appspot.com/547980044

Related

Issues: #5922

Discussion

  • Anonymous

    Anonymous - 2020-04-20
    • Description has changed:

    Diff:

    
    
    • Needs: -->
    • Patch: new --> needs_work
     
  • Anonymous

    Anonymous - 2020-04-20

    Patch does not apply to current master.

     
  • Han-Wen Nienhuys

    don't trim zero width buildings

    https://codereview.appspot.com/547980044

     
  • Han-Wen Nienhuys

     
  • Anonymous

    Anonymous - 2020-04-26

    Passes make, make check and a full make doc. Reg test diff attached.

     
  • Anonymous

    Anonymous - 2020-04-26
    • Needs: -->
    • Patch: new --> review
    • Type: -->
     
  • Han-Wen Nienhuys

    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,5 +1,3 @@
    -With this change, Carver MSDM goes from 38 seconds to 32 seconds, a
    -15% improvement.
    
     * Do not use contiguous buildings. Instead, Y=-infinity is represented
       by simply omitting the building. This reduces memory requirements
    
     
  • Han-Wen Nienhuys

    needs more benchmarking, but looks performance neutral .

     
  • Anonymous

    Anonymous - 2020-04-28
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,4 +1,3 @@
    -
     * Do not use contiguous buildings. Instead, Y=-infinity is represented
       by simply omitting the building. This reduces memory requirements
       (for example, an empty skyline needs no buildings at all.), and
    
    • Patch: review --> countdown
     
  • Anonymous

    Anonymous - 2020-04-28

    Patch on countdown for April 30th

     
    • Jonas Hahnfeld

      Jonas Hahnfeld - 2020-04-28

      Hm, actually I had some comments yesterday that have not been addressed yet.

       
      • Han-Wen Nienhuys

        I put this on "wait", no? This should not be merged as long as it's not
        showing improved benchmarks

        Op di 28 apr. 2020 09:43 schreef Jonas Hahnfeld hahnjo@users.sourceforge.net:

        Hm, actually I had some comments yesterday that have not been addressed
        yet.


        Status: Started
        Created: Sun Apr 19, 2020 09:42 PM UTC by Han-Wen Nienhuys
        Last Updated: Tue Apr 28, 2020 07:33 AM UTC
        Owner: Han-Wen Nienhuys

        -

        Do not use contiguous buildings. Instead, Y=-infinity is represented
        by simply omitting the building. This reduces memory requirements
        (for example, an empty skyline needs no buildings at all.), and
        obviates the Skyline::normalize() call which takes ~1 % of CPU.
        -

        Buildings store Y coordinate of the left edge, rather than the
        intercept at x==0.0. This avoid excessive rounding problems when X
        is large, and lets us compute building.height_at(x[LEFT]) cheaply.
        -

        Avoid using infinity and NaN. We only let the X coordinates at the
        be infinite (which is only necessary if a minimum height is
        specified)
        -

        Aggressively prune zero width
        buildings. Adjust input/regression/skyline-point-extent to match
        this behavior
        -

        Simplify the merge code, using less nested if statements.
        -

        Add a unittest for the Skyline code
        -

        Debug output is produced with Lookup::segments_to_line_stencil()

        https://codereview.appspot.com/547980044

        Sent from sourceforge.net because you indicated interest in
        https://sourceforge.net/p/testlilyissues/issues/5922/

        To unsubscribe from further messages, please visit
        https://sourceforge.net/auth/subscriptions/

         

        Related

        Issues: #5922

  • Han-Wen Nienhuys

    • Patch: countdown --> needs_work
     
  • Han-Wen Nienhuys

    setting to needs_work for now; this needs to be performance neutral at the very least.
    
     
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.