-
Notifications
You must be signed in to change notification settings - Fork 615
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support serializing large (> 2 GiB) annotation files #3905
Conversation
Previous API serializing to a String is limited by JVM max size of 2 GiB Strings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* @param out Writer to which the serialized annotations will be written | ||
* @return | ||
*/ | ||
def serializeTry[W <: Writer](annos: Iterable[Annotation], out: W): Try[W] = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An alternative is to make this private
. There is then nothing to actually test here (other than seeing if 2GiB of annotations work... 😓). I'm really questioning if this is necessary to make public.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assumed I'd have to call it from Chisel but ended up not needing to. That being said, the current test is in package firrtlTests
so would have to mess with that. We have already deprecated any import of package firrtl
(via the compiler plugin) so I'm a bit 🤷♀️ about it.
* Support serializing Annotations to a Writer Previous API serializing to a String is limited by JVM max size of 2 GiB Strings. * Serialize to Writer instead of String in WriteOutputAnnotations (cherry picked from commit 736f1a7)
* Support serializing Annotations to a Writer Previous API serializing to a String is limited by JVM max size of 2 GiB Strings. * Serialize to Writer instead of String in WriteOutputAnnotations (cherry picked from commit 736f1a7)
* Support serializing Annotations to a Writer Previous API serializing to a String is limited by JVM max size of 2 GiB Strings. * Serialize to Writer instead of String in WriteOutputAnnotations (cherry picked from commit 736f1a7) Co-authored-by: Jack Koenig <koenig@sifive.com>
* Support serializing Annotations to a Writer Previous API serializing to a String is limited by JVM max size of 2 GiB Strings. * Serialize to Writer instead of String in WriteOutputAnnotations (cherry picked from commit 736f1a7) Co-authored-by: Jack Koenig <koenig@sifive.com>
This probably also improves performance and reduces memory since creating a large String is expensive.
Contributor Checklist
docs/src
?Type of Improvement
Desired Merge Strategy
Release Notes
Reviewer Checklist (only modified by reviewer)
3.6.x
,5.x
, or6.x
depending on impact, API modification or big change:7.0
)?Enable auto-merge (squash)
, clean up the commit message, and label withPlease Merge
.Create a merge commit
.