I found an strange consumption of mem and CPU when comparting VALUES on-chain.
If I do the same comparison with my own writing functions I found is more efficient. How could it be?
Everything is detailed here: https://github.com/input-output-hk/plutus/issues/5135
Basically, I run some test evaluations over two different minting policies. One using the (==) operator between VALUES and other using my own function called valueEqualsValue. The results where overwhelming.
With zero tokens my own functions use 12% less of resources and with 19 different tokens they use 32% less than the officials one.
It could be I'm missing some functionality in the comparison, that is implemented in the official one with the (==) operator. I found also benefits like this writing my own version of flattenValue.
How do you compare VALUES online?
Did you notice this unexpected inefficiency in some of other core functionalities of Plutus On Chain Code?
Considering the limited amount of memory that we have to write our smart contracts its very strange for me to realize that even the most basic functionalities they look very inefficient.