Skip to content
Snippets Groups Projects
  1. Jul 05, 2017
  2. Jul 03, 2017
  3. Jul 02, 2017
  4. Jun 15, 2017
  5. Jun 11, 2017
  6. Jun 10, 2017
    • faiface's avatar
      Merge branch 'dev' · 79c5d201
      faiface authored
      79c5d201
    • faiface's avatar
      one more tiny doc change · e6484064
      faiface authored
      e6484064
    • faiface's avatar
      minor doc changes · 3fcad750
      faiface authored
      3fcad750
    • Michal Štrba's avatar
      Merge pull request #38 from seebs/master · 1545bd7a
      Michal Štrba authored
      more performance tweaks
      1545bd7a
    • Seebs's avatar
      Push: Don't convert pixel.RGBA to pixel.RGBA · 0dc27e40
      Seebs authored
      Because that's expensive, even in the case where the conversion
      is trivial. Use type assertion first. Reduces runtime cost of
      imdraw.Push from ~15.3% to 8.4%, so not-quite-50% of runtime
      cost of pushing points.
      
      If you were setting imd.Color to Color objects that aren't RGBA
      every single point, not much help. But if you set it and then
      draw a bunch of points, this will be a big win.
      0dc27e40
    • Seebs's avatar
      Improve normal calculations · f2ef87f1
      Seebs authored
      Soooo. It turns out that the bunch of smallish (~4-5% of runtime)
      loads associated with Len(), Unit(), Rotated(), and so on... Were
      actually more like 15% or more of computational effort. I first
      figured this out by creating:
      
      	func (u Vec) Normal(v Vec) Vec
      
      which gives you a vector normal to u->v. That consumed a lot
      of CPU time, and was followed by .Unit().Scaled(imd.thickness / 2),
      which consumed a bit more CPU time.
      
      After some poking, and in the interests of avoiding UI cruft,
      the final selection is
      	func (u Vec) Normal() Vec
      
      This returns the vector rotated 90 degrees, which turns out to
      be the most common problem.
      f2ef87f1
    • Seebs's avatar
      Slightly clean up normal calculations · ef6a44fe
      Seebs authored
      We never actually need the "normal" value; it's an extra calculation
      we didn't need, because ijNormal is the same value early on. It's
      totally possible that we could further simplify this; there's a lot
      of time going into the normal computations.
      ef6a44fe
    • Seebs's avatar
      don't call Len() when it can't change · 9a6e6066
      Seebs authored
      updateData()'s loops checking gt.Len() turns out to have been costing
      significant computation, not least because each call then in turn
      called gt.vs.Stride().
      9a6e6066
    • faiface's avatar
      switch back to OpenGL 3.3 (OS X issues) · 7ebbf7e9
      faiface authored
      7ebbf7e9
  7. Jun 09, 2017
    • faiface's avatar
      optimize GLTriangles SetLen and Update · 31fc049a
      faiface authored
      31fc049a
    • faiface's avatar
      Merge branch 'master' into gl2.1 · c331fe25
      faiface authored
      c331fe25
    • faiface's avatar
      minor, mostly stylistic, changes · 6b9ea45e
      faiface authored
      6b9ea45e
    • Michal Štrba's avatar
      Merge pull request #36 from seebs/master · 2e4c6018
      Michal Štrba authored
      revised performance tuning pull request
      2e4c6018
    • Seebs's avatar
      Don't duplicate computations in gltriangles.go · 72152655
      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.
      72152655
    • Seebs's avatar
      Reduce copying in fillPolygon · fc858bff
      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.
      fc858bff
    • Seebs's avatar
      smaller imdraw optimizations · 91803189
      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.
      91803189
    • Seebs's avatar
      use point pool · 9a7ab1c6
      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.
      9a7ab1c6
Loading