Pinboard (jm)
https://pinboard.in/u:jm/public/
recent bookmarks from jmThe Black Magic of (Java) Method Dispatch2023-04-11T21:03:19+00:00
https://shipilev.net/blog/2015/black-magic-method-dispatch/#_cheating_the_runtime_2
jmProgramming languages like Java provide the facilities for subtyping/polymorphism as one of the ways to construct modular and reusable software. This language choice naturally comes at a price, since there is no hardware support for virtual calls, and therefore runtimes have to emulate this behavior. In many, many cases the performance of method dispatch is not important. Actually, in a vast majority of cases, the low-level performance concerns are not the real concerns.
However, there are cases when method dispatch performance is important, and there you need to understand how dispatch works, what runtimes optimize for you, and what you can do to cheat and/or emulate similar behavior in your code. For example, in the course of String Compression work, we were faced with the problem of selecting the coder for a given String. The obvious and highly maintainable approach of creating a Coder interface, a few implementations, and dispatching the virtual calls over it, had met some performance problems on the very tiny benchmarks. Therefore, we needed to contemplate something better. After a few experiments, this post was born as a reference for others who might try to do the same. This post also tangentially touches the inlining of virtual calls, as the natural thing during the optimization.
Discovered via this amazing commit: https://github.com/quarkusio/quarkus/commit/65dd4d43e2644db1c87726139280f9704140167c
]]>optimization performance java oo jit coding polymorphismhttps://pinboard.in/https://pinboard.in/u:jm/b:fcc32a99ea26/Why is Rosetta 2 fast?2022-11-21T11:26:18+00:00
https://dougallj.wordpress.com/2022/11/09/why-is-rosetta-2-fast/
jmapple arm code emulation rosetta jit x86https://pinboard.in/https://pinboard.in/u:jm/b:f5f9996b2833/AdoptOpenJDK/jitwatch2017-08-24T16:22:31+00:00
https://github.com/AdoptOpenJDK/jitwatch
jmLog analyser and visualiser for the HotSpot JIT compiler. Inspect inlining decisions, hot methods, bytecode, and assembly. View results in the JavaFX user interface.
]]>analysis java jvm performance tools debugging optimization jithttps://pinboard.in/https://pinboard.in/u:jm/b:404ca57f5933/Squeezing blood from a stone: small-memory JVM techniques for microservice sidecars2016-06-18T09:46:44+00:00
https://blog.buoyant.io/2016/06/17/small-memory-jvm-techniques-for-microservice-sidecars/
jmWe found two specific techniques to be the most beneficial: turning off one of the two JIT compilers enabled by default (the “C2” compiler), and using a 32-bit, rather than a 64-bit, JVM.
]]>32bit jvm java ops memory tuning jit linkerdhttps://pinboard.in/https://pinboard.in/u:jm/b:ade3b2e45f61/Ag: faster than Ack2015-03-22T09:01:30+00:00
https://github.com/ggreer/the_silver_searcher
jmAg uses Pthreads to take advantage of multiple CPU cores and search files in parallel.
Files are mmap()ed instead of read into a buffer.
Literal string searching uses Boyer-Moore strstr.
Regex searching uses PCRE's JIT compiler (if Ag is built with PCRE >=8.21).
Ag calls pcre_study() before executing the same regex on every file.
Instead of calling fnmatch() on every pattern in your ignore files, non-regex patterns are loaded into arrays and binary searched.
]]>jit cli grep search ack ag unix pcre sljit boyer-moore toolshttps://pinboard.in/https://pinboard.in/u:jm/b:194df299d729/PCRE Performance Project2012-09-18T09:27:44+00:00
http://sljit.sourceforge.net/pcre.html
jmpcre regexps regex performance optimization jit compilation dfa re2 via:akohlihttps://pinboard.in/https://pinboard.in/u:jm/b:39b4a1347ff7/