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

feature-idea: add hint when manual change could optimize #12

Open
flocsy opened this issue Mar 18, 2024 · 0 comments
Open

feature-idea: add hint when manual change could optimize #12

flocsy opened this issue Mar 18, 2024 · 0 comments

Comments

@flocsy
Copy link

flocsy commented Mar 18, 2024

Add an option to the settings that when enabled will give warnings/hints for manual edits to improve code.

Sometimes people don't want to use the optimizer that generates the code under optimized/, but would like to learn the tricks how to change their code to make it "better". I sometimes do look at the generated code, take note of a trick (which is not always easy to understand from there), and then I try to keep that in my mind when I write code.

I don't know what things could work, but I think some will be easy to implement, some will be harder. I'll give you an example of what I think of:

function x() {
var a = mX + 3;
var b = 2 * mX +2;
}

This could give a warning that the same non-local variable is referenced more than once in the same function and it could be fetched to a local variable.

I think you get the idea.

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

No branches or pull requests

1 participant