-
Notifications
You must be signed in to change notification settings - Fork 483
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
[Builtins] Shove everything into 'BuiltinRuntime' #4514
[Builtins] Shove everything into 'BuiltinRuntime' #4514
Conversation
This reverts commit 19656b6.
…to effectfully/builtins/defer-readKnown-until-full-saturation
/benchmark plutus-benchmark:validation |
BuiltinRuntimeArrow $ \mem arg -> | ||
knownMonoruntime @val @args @res $ do | ||
(exF, f) <- getFs | ||
x <- readKnown (Just ()) arg |
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.
Note to self: don't forget to drop that Just ()
argument once unlifting is changed (I don't feel like it affects performance, it's just silly to have it).
Comparing benchmark results of 'plutus-benchmark:validation' on 'e59ade143' (base) and 'bd7d0763e' (PR)
|
-1.98%. Well, that's not good at all. I'll look at it closely some time later. |
/benchmark plutus-benchmark:validation |
Comparing benchmark results of 'plutus-benchmark:validation' on 'e59ade143' (base) and '1715c99a2' (PR)
|
-4.34%. Better, but not nearly enough. Maybe the other PR does not have as reliable semantics as they are here, will need to check. |
/benchmark plutus-benchmark:validation |
Comparing benchmark results of 'plutus-benchmark:validation' on 'e59ade143' (base) and '85d43fc21' (PR)
|
-6.5%. So some extra safety for costing does cost us some. But it's still worse than -7.18% from the other PR! Even though this one is supposed to be doing less. Not by much, but still should be a bit faster. Not sure if 0.68% of difference is a reliable measurement, though. Core doesn't tell me anything, but it does now contain some join points that I didn't see before and I really should study how those are compiled some time. In any case good to know that the minimal changes are not really worse than the more radical ones. I'll return to both of the PRs once I'm done with doing unlifting both the ways. |
I failed to stop thinking about it and I think I know what's going on. Here's how let {
lvl204_sssh
= \ mem_igXF arg1_igXG ->
join {
$j_sl4A x_igXN
= case (exF43_sl4C mem_igXF) `cast` <Co:7> of nt_igXR
{ __DEFAULT ->
let { lvl205_sm1f = Left x_igXN } in
let {
lvl206_sm1h = (lvl205_sm1f, lvl13_ruuY `cast` <Co:3>) } in
BuiltinRuntimeArrow
(\ mem1_Xhhc _ ->
case (nt_igXR mem1_Xhhc) `cast` <Co:4> of
{ ExBudget ipv2_igXZ ipv3_igY0 ->
BuiltinRuntimeResult
ipv2_igXZ ipv3_igY0 (lvl206_sm1h `cast` <Co:35>)
})
} } in
case arg1_igXG of {
__DEFAULT -> jump $j_sl4A lvl14_ruv0;
VCon val_ijiL ->
case val_ijiL `cast` <Co:8> of { ValueOf uniAct_srPw x_srPx ->
case $fGCompareTYPEDefaultUni_$cgeq
$WDefaultUniInteger (uniAct_srPw `cast` <Co:8>)
of {
Nothing ->
jump $j_sl4A
(ErrorWithCause
(ReadKnownUnliftingError
(typeMismatchError
($fGShowTYPEDefaultUni_$cshowsPrec `cast` <Co:6>)
($WDefaultUniInteger `cast` <Co:9>)
uniAct_srPw))
mayCause_ruuZ);
Just ds2_ihc4 ->
case ds2_ihc4 of { Refl co8_ihc7 ->
case (exF43_sl4C mem_igXF) `cast` <Co:7> of nt_ihc9
{ __DEFAULT ->
BuiltinRuntimeArrow
(\ mem1_ihca arg2_ihcb ->
case arg2_ihcb of {
__DEFAULT ->
case (nt_ihc9 mem1_ihca) `cast` <Co:4> of
{ ExBudget ipv2_ihck ipv3_ihcl ->
BuiltinRuntimeResult
ipv2_ihck ipv3_ihcl (lvl72_ruwg `cast` <Co:35>)
};
VCon val1_XjCF ->
case val1_XjCF `cast` <Co:8> of
{ ValueOf uniAct1_srPD x1_srPE ->
case $fGCompareTYPEDefaultUni_$cgeq
$WDefaultUniInteger
(uniAct1_srPD `cast` <Co:8>)
of {
Nothing ->
case (nt_ihc9 mem1_ihca) `cast` <Co:4> of
{ ExBudget ipv2_ihck ipv3_ihcl ->
BuiltinRuntimeResult
ipv2_ihck
ipv3_ihcl
((Left
(ErrorWithCause
(ReadKnownUnliftingError
(typeMismatchError
($fGShowTYPEDefaultUni_$cshowsPrec
`cast` <Co:6>)
($WDefaultUniInteger
`cast` <Co:9>)
uniAct1_srPD))
mayCause_ruuZ),
lvl13_ruuY `cast` <Co:3>)
`cast` <Co:35>)
};
Just ds3_ihcO ->
case ds3_ihcO of { Refl co12_ihcR ->
case (nt_ihc9 mem1_ihca) `cast` <Co:4> of
{ ExBudget ipv2_ihcU ipv3_ihcV ->
BuiltinRuntimeResult
ipv2_ihcU
ipv3_ihcV
(case plusInteger
(x_srPx `cast` <Co:3>)
(x1_srPE `cast` <Co:3>)
of vx_ihdb
{ __DEFAULT ->
(Right
(VCon
((ValueOf
$s$fMakeKnownInDefaultUniterm(,)4
vx_ihdb)
`cast` <Co:13>)),
lvl13_ruuY `cast` <Co:3>)
`cast` <Co:35>
})
}
}
}
}
})
}
}
}
}
} } in
let { lvl205_srPI = BuiltinRuntimeArrow lvl204_sssh } in Now the difference with what we have in I'm closing this for now, but I'll probably look at it again in future. |
Don't look here yet.
(Haven't looked at the Core yet, might contain infelicities).