Skip to content
  1. Jun 09, 2017
    • faiface's avatar
      optimize GLTriangles SetLen and Update · 1fd110ce
      faiface authored
      1fd110ce
    • faiface's avatar
      Merge branch 'master' into gl2.1 · 3665eaf7
      faiface authored
      3665eaf7
    • faiface's avatar
      minor, mostly stylistic, changes · c0766504
      faiface authored
      c0766504
    • Michal Štrba's avatar
      Merge pull request #36 from seebs/master · 5f2ced88
      Michal Štrba authored
      revised performance tuning pull request
      5f2ced88
    • Seebs's avatar
      Don't duplicate computations in gltriangles.go · ce8687b8
      Seebs authored
      The computation including a call to Stride() can't be optimized away
      safely because the compiler can't tell that Stride() is effectively
      constant, but we know it won't change so we can make a slice pointing
      at that part of the array.
      
      CPU time for updateData goes from 26.35% to 18.65% in my test case.
      ce8687b8
    • Seebs's avatar
      Reduce copying in fillPolygon · c6e7a834
      Seebs authored
      A slice of points means copying every point into the slice, then
      copying every point's data from the slice to TrianglesData. An
      array of indicies lets the compiler make better choices.
      c6e7a834
    • Seebs's avatar
      smaller imdraw optimizations · b6533006
      Seebs authored
      For polyline, don't compute each normal twice; when we're going through a line,
      the "next" normal for segment N is always the "previous" normal for segment
      N+1, and we can compute fewer of them.
      b6533006
    • Seebs's avatar
      use point pool · 9d1fc5bd
      Seebs authored
      For internal operations (anything using getAndClearPoints), there's a
      pretty good chance that the operation will repeatedly invoke something
      like fillPolygon(), meaning that it needs to push "a few" points
      and then invoke something that uses those points.
      
      So, we add a slice for containing spare slices of points, and on the
      way out of each such function, shove the current imd.points (as used
      inside that function) onto a stack, and set imd.points to [0:0] of
      the thing it was called with.
      
      Performance goes from 11-13fps to 17-18fps on my test case.
      9d1fc5bd
    • Seebs's avatar
      Simplify Matrix math, use 6-value affine matrixes. · c321515d
      Seebs authored
      It turns out that affine matrices are much simpler than the 3x3 matrices
      they imply, and we can use this to dramatically streamline some code.
      For a test program, this was about a 50% gain in frame rate just from
      the cost of the applyMatrixAndMask calls in imdraw, which were calling
      matrix.Project() many times. Simplifying matrix.Project, alone, got a
      nearly 50% frame rate boost!
      
      Also modify pixelgl's SetMatrix to copy the six values of a 3x2
      Affine into the corresponding locations of a 3x3 matrix.
      c321515d
  2. Jun 08, 2017
    • Seebs's avatar
      The initializer is surprisingly expensive. · 1586e600
      Seebs authored
      Removing the call to Alpha(1) and replacing it with an inline definition
      produces measurable improvements. Replacing each instance of ZV with
      Vec{} further improves things. We keep an inline RGBA because there
      are circumstances (mostly when using pictures) where we don't want to
      have to set colors to get default behavior.
      
      For a fairly triangle-heavy thing, this reduces time spent in SetLen
      from something over 10% of execution time to around 2.5% of execution
      time.
      1586e600
  3. May 30, 2017
  4. May 28, 2017
  5. May 27, 2017
  6. May 25, 2017
  7. May 24, 2017
  8. May 21, 2017
  9. May 18, 2017
  10. May 17, 2017
  11. May 14, 2017
  12. May 11, 2017
  13. May 10, 2017
  14. May 09, 2017