Hi, so I’m generating some code using .protofiles, they are the usual messages etc. - I have some building automation that I’m fairly happy with and everything works as intended:
These proto files can get quite large, and I figure that they might benefit from some pre-emptive precompilation. I was wondering how you might apply this programmatically to the Julia generated like this.
Not knowing anything about protofiles, VLSIR, or precisely what you’re hoping to achieve, I’m going to have to ask you to make your request more explicit. SnoopPrecompile’s purpose is to reduce the latency of Julia code on first execution. Can you give an example of code that is currently slow on first execution that you’re hoping to speed up?
Normal usage of SnoopPrecompile is quite simple, the docs are here: SnoopPrecompile · SnoopCompile. But perhaps you’re hoping to do something a bit outside its usual role?
I am a Julia newbie and I seem to be jumping into the deep end here, so I apologise in advance if my understanding of precompilation is poor!
So, the specifics:
ProtoBuf.jl
is used to parse Protocol Buffers - which are just serialized “intermediate representations” of data between programming languages - into long lists of Julia function/struct definitions which you can see in the linked repository folder’s folders as *_pb.jl
files.
Downstream, we intend to import these structs and functions as needed into more Julia. I can understand how precompilation might work on a piece of ordinary Julia - however, how would it be used across the generate files in _pb.jl
- should everything be put in one big @precompile_setup
block, should precompilation be atomised across the structs/functions, should there be a seperate file which calls all of these structs/functions and then should that be put in a precompile
block?