1. 19 Apr, 2020 2 commits
  2. 16 Apr, 2020 1 commit
    • Eric Myhre's avatar
      Remove finish callback. Much faster. Bench. · 6d31b15f
      Eric Myhre authored
      If you've been following along for a while now, you don't need to see
      the benchmarks to know what's coming.  The long story short is:
      allocations are the root of all evil, and we got rid of some, and now
      things are significantly faster.
      
      Here's the numbers:
      
      basicnode (just for a baseline to compare to):
      
      ```
      BenchmarkMapStrInt_3n_AssembleStandard-8         1988986               588 ns/op             520 B/op          8 allocs/op
      BenchmarkMapStrInt_3n_AssembleEntry-8            2158921               559 ns/op             520 B/op          8 allocs/op
      BenchmarkMapStrInt_3n_Iteration-8               19679841                67.0 ns/op            16 B/op          1 allocs/op
      BenchmarkSpec_Marshal_Map3StrInt-8               1377094               870 ns/op             544 B/op          7 allocs/op
      BenchmarkSpec_Marshal_Map3StrInt_CodecNull-8     4560031               278 ns/op             176 B/op          3 allocs/op
      BenchmarkSpec_Unmarshal_Map3StrInt-8              368763              3239 ns/op            1608 B/op         32 allocs/op
      ```
      
      realgen, previously, using fcb:
      
      ```
      BenchmarkMapStrInt_3n_AssembleStandard-8         4293072               278 ns/op             208 B/op          5 allocs/op
      BenchmarkMapStrInt_3n_AssembleEntry-8            4643892               259 ns/op             208 B/op          5 allocs/op
      BenchmarkMapStrInt_3n_Iteration-8               20307603                59.9 ns/op            16 B/op          1 allocs/op
      BenchmarkSpec_Marshal_Map3StrInt-8               1346115               913 ns/op             544 B/op          7 allocs/op
      BenchmarkSpec_Marshal_Map3StrInt_CodecNull-8     4606304               256 ns/op             176 B/op          3 allocs/op
      BenchmarkSpec_Unmarshal_Map3StrInt-8              425662              2793 ns/op            1160 B/op         27 allocs/op
      ```
      
      realgen, new, improved:
      
      ```
      BenchmarkMapStrInt_3n_AssembleStandard-8         6138765               183 ns/op             129 B/op          3 allocs/op
      BenchmarkMapStrInt_3n_AssembleEntry-8            7276795               176 ns/op             129 B/op          3 allocs/op
      BenchmarkMapStrInt_3n_Iteration-8               19593212                67.2 ns/op            16 B/op          1 allocs/op
      BenchmarkSpec_Marshal_Map3StrInt-8               1309916               912 ns/op             544 B/op          7 allocs/op
      BenchmarkSpec_Marshal_Map3StrInt_CodecNull-8     4579935               257 ns/op             176 B/op          3 allocs/op
      BenchmarkSpec_Unmarshal_Map3StrInt-8              465195              2599 ns/op            1080 B/op         25 allocs/op
      ```
      
      So!  About 150% improvement on assembly between gen with fcb and our new-improved no-callback system.
      
      And about 321% improvement in total now for codegen structs over the basicnode map.
      
      That's the kind of ratio I was looking for :)
      
      As with all of these measurements: these will also get much bigger on bigger corpuses.
      Some of the improvements here are O(n) -> O(1), and some apply even more heartily in deeper trees, etc.
      But it's telling that even on very small corpuses, the impact is already huge.
      6d31b15f
  3. 07 Apr, 2020 1 commit
    • Eric Myhre's avatar
      Support for struct field rename directives. · 5f93c298
      Eric Myhre authored
      Some touches to ImplicitValue came along for the ride, but aren't
      exercised yet.
      
      Tests are getting unwieldy.  I think something must be done about
      this before proceding much further or it's going to start resulting
      in increasingly significant velocity loss.
      5f93c298
  4. 06 Apr, 2020 2 commits
  5. 01 Apr, 2020 8 commits
    • Eric Myhre's avatar
      Tests on gen output; some fixes; working. · 072098e6
      Eric Myhre authored
      I'm almost a little staggered.  We've got structures with maybes
      both using pointers and not, and everything seems fine.
      
      A few fixes were necessary, but they were mostly "d'oh" grade.
      (The finishCallback logic is a bit hairy, but appears correct now.)
      
      More cases for more variations in presence coming up next.
      072098e6
    • Eric Myhre's avatar
      Support maybe implemented using ptr. · 255bbc57
      Eric Myhre authored
      Easier than previous commit message seemed to think.
      
      Since we already have finishCallback functions in play in any scene
      where maybes can also be in play, we can just make those responsible
      for copying out a pointer from the child assembler to the parent value.
      That makes the child assembler able to create a new value late in
      its lifecycle and still expect it can land in a proper home.
      
      Tests needed badly; this is *oodles* of edge cases.
      Unrelated fix needed first.  (Might make that elsewhere and rebase
      this to include that, to reduce the carnage ever so slightly.)
      255bbc57
    • Eric Myhre's avatar
      Fix many issues with maybes; adjunct config for if maybe is implemented using... · 125a2a7f
      Eric Myhre authored
      Fix many issues with maybes; adjunct config for if maybe is implemented using a pointer; attempt the finishCallback system for reusable child assemblers.
      
      This... almost appears to be on a dang nice track.
      
      Except one fairly critical thing.  It doesn't work correctly if your
      maybe IS implemented as containing a pointer.
      
      Because that pointer starts life as nil in the parent structure.
      
      And that's hard to fix.
      
      We can't have a pointer to a pointer in the assembler;
      that'd cause the type bifructation we've been trying to avoid.
      (We can give up and do that of course; it would be correct.
      Just... more code and larger final assembly size.
      And if we did this, a lot of this diff would be rewritten.)
      
      We could have the parent structure allocate a blank of the field,
      and put a pointer to it in the maybe and also in the child assembler.
      Except... this is a wasted allocation if it turns out to be null.
      
      Rock and hard place detected in a paired configuration.
      Might have to back out of this approach entirely.  Not sure.
      125a2a7f
    • Eric Myhre's avatar
      Late night thoughts on reducing gen type count. · 896d0e57
      Eric Myhre authored
      We'll see how this works out.
      896d0e57
    • Eric Myhre's avatar
      ErrInvalidKey type, and use it. · 27873cb0
      Eric Myhre authored
      27873cb0
    • Eric Myhre's avatar
      Checkpoint of codegen'd struct assemblers. · fd94a062
      Eric Myhre authored
      Lots of tasty bitshuffling in this commit.
      
      Remaining: creating, embedding, and returning child value assemblers.
      This might involve a full type per field: doing so would be direct,
      have pretty excellent verbosity in debugging symbols,
      and pointers back to parent suffer no interface indirection;
      overall, it's probably going to have the fastest results.
      However, it would also mean: we can't save resident memory size if we
      have more than one field in a struct that has the same type;
      and we we can't avoid increasing binary size if the same types are used
      as fields in several places.
      Going to pause to think about this for a while.
      fd94a062
    • Eric Myhre's avatar
      Nicely composable NodeBuilderGenerator, +mixins. · 7ff42bd3
      Eric Myhre authored
      This cleans up a lot of stuff and reduces the amount of boilerplate
      content that's just generating monomorphizing error method stubs.
      
      The nodeGenerator mixins now also use the node mixins.  I don't know
      why I failed to do that from the start; I certainly meant to.
      It results in shorter generated code, and the compiler turns it into
      identical assembly.
      7ff42bd3
    • Eric Myhre's avatar
      Checkpoint of struct gen progress. · 80b0ba29
      Eric Myhre authored
      Compiles and runs; but the results don't.
      Some small issues; some big issues.  Just needed a checkpoint.
      
      It's feeling like it's time to deal with breaking down the assembler
      generators in the same way we did for all the node components, which
      is going to be kind of a big shakeup.
      80b0ba29
  6. 29 Mar, 2020 1 commit