Skip to content

Commit

Permalink
WIP: table-driven deserialization (#5)
Browse files Browse the repository at this point in the history
This doesn't work yet. It has memory errors because it's not actually
initializing the flattened fields before calling assume_init().
I'm just using this to get a very very rough estimate of the code size
of this approach. tl;dr:

* the .text is getting noticeably smaller
* the serialization path is starting to show up now, in spite of fewer
  types actually getting serialized. This is good news because I can
  put serialization into the same table at a cost of one pointer per
  field.
* the total file size isn't changing! :-( It looks like the non-.text
  sections are basically replacing the .text section's size. I think a
  lot of it is symbol names. Some of it was worse before I added
  #[inline] in a couple spots.

This is currently defining a visitor for each type and then delegating
to the vtable. It's not getting the full benefit that way: each of these
methods still takes up some room, and (perhaps more importantly) still
has to be written to the symbol table.

I think the next step is to eliminate that delegation. (Or, you know,
make it actually work. But whatever.)
  • Loading branch information
scottlamb committed Dec 18, 2021
1 parent 8c95b8a commit b856cb1
Show file tree
Hide file tree
Showing 6 changed files with 343 additions and 258 deletions.
23 changes: 23 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b856cb1

Please sign in to comment.