-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
speed up IO of arrays of mutable yet fixed length objects
- Loading branch information
Shashi Gowda
committed
Oct 4, 2017
1 parent
28c1c04
commit a763f2b
Showing
3 changed files
with
105 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a763f2b
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.
@JeffBezanson would it be fine to adapt this optimization for Base?
It works for mutable structs where fields are other immutable isbits or other similar mutable structs... E.g.
MVector
, and is 10x faster than the default.a763f2b
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 tried to do something related in JuliaLang/julia#14678. The problem is that it skips calling custom
serialize
methods for isbits fields. But I think we could decide we don't care about that. Or, the@generated
function could generate unrolled calls toserialize
instead ofwrite
, which would still help a bit.a763f2b
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.
👍 we could document that custom serializers should override
Array{T}
too.This doesn't mess with types containing
Ptr
...a763f2b
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.
But a special case was needed for
Ptr
. If other isbits types haveserialize
methods, they won't be called.