chore(bench): optimization of compile time for hlapi common bench#3382
chore(bench): optimization of compile time for hlapi common bench#3382SouchonTheo wants to merge 1 commit intomainfrom
Conversation
soonum
left a comment
There was a problem hiding this comment.
Nice build optimization !
Wdyt @IceTDrinker ?
Question is do we want to support closures ? otherwise I think I would update the various Op structs like BinaryOp to force a fn instead of Fn fn is a function, Fn is a trait allowing some type of call, I believe that if closures are not doing crazy stuff they can be coerced into fn (as the added wrapper functions do) So the current solution works and allows to still use closures, if we don't care about closures, I would remove the wrapping and change what we accept in the various Op structs, since it seems it's mostly for auto generated code and all closures get wrapped ? |
|
e.g. impl<FheType, FheRhsType, F, R, EncryptLhsType, EncryptRhsType> BenchmarkOp<FheType>
for BinaryOp<F, EncryptLhsType, EncryptRhsType, FheRhsType>
where
F: Fn(&FheType, &FheRhsType) -> R,
R: BenchWait,the F could be replaced maybe ? unclear I checked quickly |
SouchonTheo
left a comment
There was a problem hiding this comment.
sounds a good idea
I can make a test it would not take so long to do
@SouchonTheo made 1 comment.
Reviewable status: 0 of 3 files reviewed, all discussions resolved.
cb78217 to
e49b07c
Compare
e49b07c to
650a491
Compare
SouchonTheo
left a comment
There was a problem hiding this comment.
the solution was even easier
We only needed to infer the type in benchmark_op
with that we avoid a lot of monomorphization issue
@SouchonTheo made 1 comment.
Reviewable status: 0 of 3 files reviewed, all discussions resolved.
all good for the build ? no issues with the "restriction" ? still fast to build ? |
SouchonTheo
left a comment
There was a problem hiding this comment.
same timing
@SouchonTheo made 1 comment.
Reviewable status: 0 of 4 files reviewed, all discussions resolved.
optimization regarding compile time
went from 4:30 to 2:50 because we wrap the closure
This idea come from the fact that closure generate unique stuff
I ask claude if a workaround is possible and only wrapping was enough
tried it and it was working like a charm
This change is