Skip to content
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

Remove instruction metrics (except max align) #414

Merged
merged 1 commit into from
Jul 28, 2020
Merged

Conversation

gumb0
Copy link
Collaborator

@gumb0 gumb0 commented Jul 7, 2020

Depends on #403

@codecov
Copy link

codecov bot commented Jul 8, 2020

Codecov Report

Merging #414 into master will increase coverage by 0.02%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #414      +/-   ##
==========================================
+ Coverage   99.33%   99.36%   +0.02%     
==========================================
  Files          50       49       -1     
  Lines       14175    14169       -6     
==========================================
- Hits        14081    14079       -2     
+ Misses         94       90       -4     

@gumb0 gumb0 force-pushed the remove-instr-metrics branch from 36347e2 to 82ef0cb Compare July 8, 2020 08:19
@gumb0 gumb0 changed the base branch from master to validate-types-no-block-br July 13, 2020 10:46
@axic axic force-pushed the validate-types-no-block-br branch 3 times, most recently from 7d2c6c3 to 3adfb02 Compare July 16, 2020 16:02
@gumb0 gumb0 force-pushed the validate-types-no-block-br branch 2 times, most recently from 0d30b02 to 7beb186 Compare July 17, 2020 10:06
Base automatically changed from validate-types-no-block-br to master July 17, 2020 10:13
@gumb0 gumb0 marked this pull request as ready for review July 17, 2020 10:14
@gumb0 gumb0 force-pushed the remove-instr-metrics branch from 82ef0cb to 13f124c Compare July 17, 2020 10:35
@gumb0 gumb0 requested review from chfast and axic July 17, 2020 10:39
@@ -248,7 +248,6 @@ parser_result<Code> parse_expr(const uint8_t* pos, const uint8_t* end, FuncIdx f
std::tie(opcode, pos) = parse_byte(pos, end);

auto& frame = control_stack.top();
const auto& metrics = metrics_table[opcode];
const auto& type = type_table[opcode];
Copy link
Member

Choose a reason for hiding this comment

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

I'd rather have max_align here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Why? It's used only in subset of instructions, which are handled all in one switch case, so why put it into wider scope?

Copy link
Member

@axic axic Jul 17, 2020

Choose a reason for hiding this comment

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

My reasoning is that none of the cases in the switch use the opcode variable and one must go up to the top to find it. Perhaps benchmarking can show which is faster :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Tried to benchmark, it doesn't make any difference.

Copy link
Member

Choose a reason for hiding this comment

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

If there's no speed difference I'd prefer it at the top.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Made max_align variable.

@gumb0 gumb0 force-pushed the remove-instr-metrics branch from 13f124c to 87bea74 Compare July 17, 2020 13:17
@axic axic force-pushed the remove-instr-metrics branch 3 times, most recently from 9b97f70 to a019c4a Compare July 23, 2020 11:53
Copy link
Collaborator

@chfast chfast left a comment

Choose a reason for hiding this comment

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

This is ok, but you can much smaller table using switch only for relevant instructions.

@gumb0 gumb0 force-pushed the remove-instr-metrics branch from a019c4a to 1b71bc7 Compare July 28, 2020 09:39
@gumb0 gumb0 force-pushed the remove-instr-metrics branch from 1b71bc7 to cd1903d Compare July 28, 2020 09:46
@gumb0 gumb0 merged commit 980bbd1 into master Jul 28, 2020
@gumb0 gumb0 deleted the remove-instr-metrics branch July 28, 2020 10:15
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.

3 participants