Skip to content
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

Add support for reading pbf #44

Merged
merged 3 commits into from
Aug 1, 2021
Merged

Add support for reading pbf #44

merged 3 commits into from
Aug 1, 2021

Conversation

blegat
Copy link
Contributor

@blegat blegat commented Jul 11, 2021

See #43

Copy link
Owner

@pszufe pszufe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a great start!
Perhaps we should include the ProtoBuf configuration somewhere (if it is using such file - if I am wrong pls correct me)
Additionally, let's have some unit tests from the beginning (even now just trying to parse some pbf file without actually doing anything).
If there is any way you need help please let me know. Thanks for the effort!


mutable struct Blob <: ProtoType
__protobuf_jl_internal_meta::ProtoMeta
__protobuf_jl_internal_values::Dict{Symbol,Any}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not know whether this is just controlled by ProtoBuf, but if we control it could we, for performance reasons, use some concrete type or a type Union perhaps?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is generated by ProtoBuf.jl, I was also surprised that it would not create concrete type fields instead of a Dict, I thought the whole idea behind ProtoBuf was to generate concrete specialized structs with fields. I suggest we stay with this with this PR and then try to change it to concrete fields and see what's the performance speedup in another PR. This separate PR could be a nice story to report to ProtoBuf.jl if we get a significant speedup

if !isassigned(__meta_Blob)
__meta_Blob[] = target = ProtoMeta(Blob)
fnum = Int[2,1,3,4,5,6,7]
allflds = Pair{Symbol,Union{Type,String}}[:raw_size => Int32, :raw => Vector{UInt8}, :zlib_data => Vector{UInt8}, :lzma_data => Vector{UInt8}, :OBSOLETE_bzip2_data => Vector{UInt8}, :lz4_data => Vector{UInt8}, :zstd_data => Vector{UInt8}]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again I do not use ProtoBuf, but id we control it Union{Type,Symbol} would look better to me.

Copy link
Contributor Author

@blegat blegat Jul 12, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean Pair{Symbol,Type} ?

@blegat blegat changed the title [WIP] Add support for reading pbf Add support for reading pbf Jul 28, 2021
@blegat
Copy link
Contributor Author

blegat commented Jul 28, 2021

The PR is now ready for review. It should be working. The performance may still be improved, e.g. using the suggestions in your comments, but that be done in separate PRs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants