-
Notifications
You must be signed in to change notification settings - Fork 15
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
ByteArrayOutput
should have a customizable initial capacity
#78
Comments
Yes we should allow it, but a quick test with a default value of 32 Kb (instead of 32 bytes) did not speed things up at all. |
Is this on the jvm ? Is there a chance the difference is more notable on native iOS ? |
I ran
which should imho highlight serialization-related performance issues. I noticed too that |
We do serialize (bin+json) at all state transitions now (compared to only bin for some transitions), might explain the longer test time. I guess, if there is no measurable performance improvement, this can be left as-is. |
It should be possible to define a custom initial size for the backing array of
ByteArrayOutput
, like the jdk impl. The initial size of 32B is tiny and results in dozens of reallocation+memcopies in thelightning-kmp
serialization use case (and probably is similar withinbitcoin-kmp
). That can't be good for performance, I wonder how setting a reasonable capacity would reduce the test time.The text was updated successfully, but these errors were encountered: