《1BRC——Java社区的Nerd狙击.pdf》由会员分享,可在线阅读,更多相关《1BRC——Java社区的Nerd狙击.pdf(60页珍藏版)》请在三个皮匠报告上搜索。
1、#1BRC|gunnarmorling Software engineer at Decodable Former project lead of Debezium kcctl,JfrUnit,ModiTect,MapStruct Java Champion 1 Gunnar Morling#1BRC|gunnarmorlingThe GoalsLearn something newHave some fun along the wayInspire others to do the sameis slow?!#1BRC|gunnarmorlingIs It Really a Problem,
2、Though?#1BRC|gunnarmorlingThe RulesJava-only;Version of your choiceNo dependenciesNo caching10K stations,-99.9C-+99.9CCopying allowed#1BRC|gunnarmorlingEvaluation Environment32 core AMD EPYC 7502P(Zen2),8 Cores used128 GB RAMFile on RAM diskFive runs,slowest and fastest discardedImage Joe Haupt http
3、s:/flic.kr/p/2mG3vWA(CC BY-SA 2.0)#1BRC|gunnarmorlingBaseline04:49.679#1BRC|gunnarmorlingThe First SubmissionRoy Van RijnParallelizationOzzy Delaney https:/flic.kr/p/pMsvzE(CC BY-SA 2.0 DEED)#1BRC|gunnarmorlingParallelizationChunking the FileWe Have CoresMany#1BRC|gunnarmorlingParallelization 71 sec
4、.#1BRC|gunnarmorlingJEP 454Foreign Function&Memory APIhttps:/openjdk.org/jeps/454Introduce an API by which Java programs can interoperate with code and data outside of the Java runtime.By efficiently invoking foreign functions(i.e.,code outside the JVM),and by safely accessing foreign memory(i.e.,me
5、mory not managed by the JVM),the API enables Java programs to call native libraries and process native data without the brittleness and danger of JNI.#1BRC|gunnarmorlingParallelizationChunking the File#1BRC|gunnarmorling1BRC Mythbusters#1BRC|gunnarmorling1BRCA Trivial Task?Parsingjjmusgrove https:/f
6、lic.kr/p/2mJbA8S(CC BY 2.0 DEED)#1BRC|gunnarmorlingParsing Byte by Byte#1BRC|gunnarmorlingParsing Byte by Byte 20 sec.#1BRC|gunnarmorlingParsing SIMDSingle Instruction,Multiple Datahttps:/ SWARSIMD Within a Register#1BRC|gunnarmorlingParsing SWARSIMD Within a Register#1BRC|gunnar