Open augustin-v opened 2 months ago
The easiest way would be to use python to generate cairo code, like so:
def generate_powers_of_two():
print("pub const POW_2_256: [")
print(" u256")
print(" ; 256] = [")
for i in range(256):
value = 2 ** i
hex_value = f"0x{value:x}"
print(f" {hex_value},")
print("];")
if __name__ == "__main__":
generate_powers_of_two()
Thank you for the review, I'll add a new constant as instructed and try profiling as well!
hi @augustin-v it seems that the changes brought in scope of these PR highlight a memory-management related issue in Cairo Native which crashes our CI runner, thus I will have to keep it open until it is fixed
Hi @enitrat, understood. Thank you for the update, and please let me know if there's anything I can do to assist with resolving the issue
hey @augustin-v i ran some profiling on test_execute_from_outside_eip1559
- which is just an empty execution, so it only performs validation steps:
Before:
After:
It's nearly 10x better :)
@enitrat wow it improved much more than I thought it would, bitshift operations looking good
Pull Request type
Please check the type of change your PR introduces:
What is the current behavior?
The bit shifting operations in the existing implementation are not optimized, leading to potential inefficiencies.
Resolves: #905
What is the new behavior?
Does this introduce a breaking change?
This change is