question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Consider use of Java 8 `LambdaMetafactory` for Afterburner getter/setter access

See original GitHub issue

As per:

https://www.optaplanner.org/blog/2018/01/09/JavaReflectionButMuchFaster.html

it seems like there is a way to actually get near-static access for getters, without (explicit) code generation, using Java 8 added class LambdaMetafactory. Whether it will actually work out or not remains to be seen – and, if it does, could it actually be added in jackson-databind? – but seems like a promising lead. While mechanism is probably not enough to cover all code generation needs (field access, constructor calls), getter/setter access is significant on its own.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

5reactions
stevenschlanskercommented, Aug 19, 2019

Hi @cowtowncoder, I am prototyping a new Afterburner that does this: https://github.com/stevenschlansker/jackson-blackbird

Currently, we run this in production with good results, although obviously the approach is very new and requires additional proving out.

Is this something I could contribute to jackson-modules-base? It would be nice to have the source in-tree so it does not drift from Jackson versions, and it would make release management easier. Some projects have already expressed interest: https://github.com/jhipster/generator-jhipster/issues/9934

0reactions
cowtowncodercommented, Aug 21, 2019

@stevenschlansker That sounds good, I appreciate caution wrt first using it, getting module mature and field-tested. That sounds like a good plan to me. With different maven coordinates can easily publish 2.10 version, and later replace “standard” Afterburner when proven stable.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Method handles and lambda metafactory
Method.invoke() on OpenJDK 8 is 87% slower than direct access. ... change as this new instruction was not used directly by Java just...
Read more >
LambdaMetafactory (Java Platform SE 8 )
Indirect access to the behavior specified by the provided MethodHandle proceeds ... The CallSite can be considered a "factory" for function objects and...
Read more >
Is there a fast approach to reflective field access?
In case of OpendJDK (and JDKs built atop it), the LambdaMetaFactory generates a mostly ordinary class file (just accessing private member(s) ...
Read more >
Java getter/setter used as Lamda's – GhostProgrammer
Once again I'm looking into ways to make coding so much easier. I needed to be able to pass in a Class::get and...
Read more >
JavaScriptReplyProxy crashes every time [159824359]
I think it's not OK to use lambdas in production code. ... W/[truncated packagename redacted]: Accessing hidden method Ljava/lang/invoke/LambdaMetafactory ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found