Skip to content

Conversation

@recmo
Copy link

@recmo recmo commented Oct 25, 2022

revm/main (i.e. primitive-types):

Hello, world!
elapsed: 37.219964ms
0: 37.392625ms
1: 37.153333ms
2: 37.009916ms
3: 36.769416ms
4: 36.76825ms
5: 36.764166ms
6: 36.758458ms
7: 36.747ms
8: 36.740208ms
9: 36.736666ms
10: 36.7195ms
11: 36.701208ms
12: 36.697458ms
13: 36.678541ms
14: 36.615916ms
15: 36.611208ms
16: 36.609416ms
17: 36.439375ms
18: 36.337541ms
19: 36.033916ms
20: 36.010416ms
21: 36.010083ms
22: 35.956041ms
23: 35.930833ms
24: 35.881125ms
end!

revm/ruint:

Hello, world!
elapsed: 37.030381ms
0: 37.128875ms
1: 36.823583ms
2: 36.773166ms
3: 36.563458ms
4: 36.40775ms
5: 36.315583ms
6: 36.203333ms
7: 36.140208ms
8: 36.137791ms
9: 36.130166ms
10: 36.097166ms
11: 36.0855ms
12: 36.0235ms
13: 35.998541ms
14: 35.965666ms
15: 35.948375ms
16: 35.93625ms
17: 35.92825ms
18: 35.927833ms
19: 35.921041ms
20: 35.920791ms
21: 35.910625ms
22: 35.856333ms
23: 35.852583ms
24: 35.8365ms
end!

~0.5% faster. not much, but it's a start :)

@recmo recmo changed the title Ruint Ruint v1.5.1 Oct 25, 2022
251_u8..=252_u8 => Return::OpcodeNotFound,*/
opcode::STOP => Return::Stop,
opcode::ADD => op2_u256_tuple!(interp, overflowing_add),
opcode::MUL => op2_u256_tuple!(interp, overflowing_mul),
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Computing whether a mul overflows is actually a surprising amount of extra work. Since we don't need that here, better to use the wrapping version. (No extra cost for add/sub, but changing those too for symmetry and to remove all uses of op2_u256_tuple.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants