Replies: 4 comments 5 replies
-
I implemented this (only generated serialize.c) and did a modest pass of excludes (if exclude is present on the node it will just not emit -- rough WIP). From those changes the average ratio to source for a simple Rails app drops from 2.44x to 2.21x. Somewhat modest but it lead to another size issue with how we serialize. The node needs a {start, end} but this is generally only derivable from first and last tokens. we need the range to underline or to currently calculate line number but this potentially is storing 16 bytes if there is a clean start/end but potentially more if there are other optional endings. |
Beta Was this translation helpful? Give feedback.
-
I'm going to respond to this in a couple of parts.
|
Beta Was this translation helpful? Give feedback.
-
Nice removing those other tokens now drops the ratio of source to blob to 2.04. I will try and make a PR on this to at least see what I am thinking. |
Beta Was this translation helpful? Give feedback.
-
@enebo I think we could also have separate serializers/deserializers. If you want, you could have |
Beta Was this translation helpful? Give feedback.
-
There are various fields that or of interest for parsing use cases and ones which are of interest for execution. For execution, CallNode
will include a token for opening and closing which are unused and also for message (while I think we only care about name). I used call because it is a common thing and you can see that will expand time and memory of making/processing a serialized blob.
I propose possibly annotating elements with a profile or something to indicate what we want. This could be as simple as an extra field in config.yml:
This would mean some writes in serialize would exclude for the profile specified. There are many ways we could specify this but just excluding these three tokens would reduce each call between 7 (foo 1) and 27 bytes. From a simple analysis of loading a single scaffolded Rails app the serialized to source ratio averages 2.44x. Using a very simple numeric compression scheme I can get that down to 1.44 but I imagine trimming out unneeded elements will be a pretty decent win.
Beta Was this translation helpful? Give feedback.
All reactions