Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

casperisfine
Copy link
Contributor

[Feature #19538]

This new peformance warning category is disabled by default. It needs to be specifically enabled via -W:performance or Warning[:performance] = true

cc @nobu @tenderlove

/** Warning is for experimental features. */
RB_WARN_CATEGORY_EXPERIMENTAL,

RB_WARN_CATEGORY_ALL_BITS = (
Copy link
Member

Choose a reason for hiding this comment

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

Since this file is a public header, we may have to keep the name including the new bit.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, I didn't notice that. Thanks, I'll restore the old name.

Copy link
Member

Choose a reason for hiding this comment

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

Sorry, I meant to keep the old name and add the new name for the bits enabled by -w.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh. I'll make another PR.

[Feature #19538]

This new `peformance` warning category is disabled by default.
It needs to be specifically enabled via `-W:performance` or `Warning[:performance] = true`
@byroot byroot merged commit ac123f1 into ruby:master Apr 13, 2023
@eregon
Copy link
Member

eregon commented Apr 13, 2023

Could you add an entry in NEWS for this?
And also document -W:performance e.g. in the man page and docs of Warning.[]?

@byroot
Copy link
Member

byroot commented Apr 13, 2023

Could you add an entry in NEWS for this?

So I wanted to do this, but none of the existing section made sense. Any idea?

@eregon
Copy link
Member

eregon commented Apr 15, 2023

So I wanted to do this, but none of the existing section made sense. Any idea?

#7715 seems fine, could also be under command-line changes or so (I guess older NEWS files must have a way to document those) & Warning.

@casperisfine casperisfine deleted the perf-warning branch April 17, 2023 07:17

def test_max_shape_variation_with_performance_warnings
assert_in_out_err([], <<-INPUT, %w(), /Maximum shapes variations \(8\) reached by Foo, instance variables accesses will be slower\.$/)
$VERBOSE = true
Copy link
Member

Choose a reason for hiding this comment

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

Does it also work with $VERBOSE = false? See #7715 (comment)
If only with $VERBOSE = true, it seems too complicated to enable performance warnings (need to enable two things, very easy to mess up)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe it needs both yes.

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.

4 participants