Replies: 3 comments 3 replies
-
Hi @codepilot. Great observations. It sounds like you want streaming read/write capabilities so that when reading you can stream through the file just once to pluck out the important subset of data (which you would need to copy out of the stream, rather than use zero-copy) without holding the entire message in memory -- is that right? Currently, I think I can see a number of issues:
In our profiles, we've seen Interchange I/O only be a small amount of runtime compared to solving the routing problem, and the Physical Netlist should not consume all that much memory. One thing I have been considering is providing the benchmarks in non-gzipped form so that the entire file can be mmap-ed too. I'm open to be convinced otherwise though. |
Beta Was this translation helpful? Give feedback.
-
Stream to create JSON for example, preorder is perfect for that. I have that working. Canonical embedded in gzip, can stream from the gzip to json to gzip to return in a streaming way from a server for instance. I can try to add to capnproto-java or just make a small standalone java class for the conversion. IDK how quick they accept pull requests. I commented on that issue capnproto/capnproto-java#14 (comment) I am leaning towards a post-processing step in the benchmark-producing code. Also, canonicalization does not need or use the schema, so the code to do it is very short. Only 2 passes are needed, first pass to calculate the sizes of children, second pass streams out to file, no whole-allocation needed. Shouldn't effect nxroute or anything as long as canonical order isn't required from participants. Canonical ordering could remove the use of segments entirely. Relative pointers are limited to 4GB, which would mean consecutive child pointers of a struct would limited to 4GB. It may not be good to adopt this everywhere, but only for interchange output when specially desired. Canonical files that can be mmap-ed would be my ideal, and I would use a stand alone thing in my own code to make such if not provided. Daniel |
Beta Was this translation helpful? Give feedback.
-
Already got a reply capnproto/capnproto-java#14 (comment) Daniel |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Specifically:
https://capnproto.org/encoding.html#canonicalization
RapidWright encodes as a message, with a segment list header, inside of gzip.
I purpose making the files for the contest, or even in general for RapidWright use the canonical encoding. It allows for streaming reading and writing of files with tiny memory usage. Also, it allows for a unique bit representation for the messages, for taking a hash for instance.
The change would be invisible to anyone who doesn't care about the specific encoding as it is a subset of valid encodings.
If consensus forms around this, I volunteer to get it done quickly in Java for RapidWright. I already made the needed encoder/decoder in typescript and c++ for use in browser as JavaScript and Wasm. I will post the repository in a reply to this shortly, probably early next week.
Thanks,
Daniel
Beta Was this translation helpful? Give feedback.
All reactions