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

@Inline feature proposal #1534

Closed
publicocean0 opened this issue Dec 11, 2017 · 4 comments
Closed

@Inline feature proposal #1534

publicocean0 opened this issue Dec 11, 2017 · 4 comments

Comments

@publicocean0
Copy link

Hi i m working in java projects where performace is important.
it is would be very usefull to jave annotation permitting to convert function and custom lambda structure to inline code.

I hope strongly you will do because i need it really in my code. I wont convert all my project in kotlin for doing it. I decided to continue do work with java ... eventually if lombok will not implement it i will develop my plugin... but i think inside lombok could make it more complete.

@FilipMalczak
Copy link

What about synchronized methods? What about stack traces?

This idea seems very un-lombok-y, it doesn't try to reduce boilerplate and automatize common task, but rather changes how the language works.

@randakar
Copy link

randakar commented Mar 18, 2018 via email

@Maaartinus
Copy link
Contributor

@randakar I don't think javac can do any useful inlining. Ever.

Given separate compilation, some static inlining is impossible. What's worse, inlining is limited as it leads to a code bloat. You'd better only inline small methods which actually get called often. And that's what JIT does pretty well (not sure about lambdas). Moreover, it can inline methods, which must not be inlined statically (as they're virtual and may be overridden somewhere - JIT can do it and undo it later, if needed).

Currently, javac does no optimizations at all (string concatenation IMHO doesn't count). That's a good thing, as they'd make JIT optimizations more complicated.

Anyway, Lombok couldn't do much inlining as it'd require resolution.

@randakar
Copy link

randakar commented Mar 19, 2018 via email

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

5 participants