[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-serviceability-dev
Subject:    Integrated: 8255455: Pre-generate ThreadHeapSampler::_log_table
From:       Claes Redestad <redestad () openjdk ! java ! net>
Date:       2020-10-30 18:18:59
Message-ID: PJHxbuD9KvLGb-MxoP7jgz9Gs1knqUpzZPs9zGhI5q8=.ad9c2328-45e1-4af2-b259-3c0d2fb1dd81 () github ! com
[Download RAW message or body]

On Tue, 27 Oct 2020 14:00:34 GMT, Claes Redestad <redestad@openjdk.org> wrote:

> The static `ThreadHeapSampler::_log_table` is currently initialized on JVM \
> bootstrap to an overhead of ~67k instructions (linux-x64). By turning the \
> initialization into a constexpr, we can precalculate the helper table at compile \
> time, which trades a runtime overhead for a small, 8kb, static footprint increase. 
> I compared `fast_log2` with the `log2` builtin with a naive benchmarking \
> experiment[1] (not included in this PR) and show that the `fast_log2` is ~2.5x \
> faster than `log2` on my system. And that without the lookup table we'd be much \
> worse. So I think it makes sense to preserve this optimization, but get rid of the \
> startup overhead: 
> [5.428s][debug][heapsampling] log2, 0.0751173 secs
> [5.457s][debug][heapsampling] fast_log2, 0.0298244 secs
> [5.622s][debug][heapsampling] fast_log2_uncached, 0.1645569 secs
> 
> I've verified that this refactoring does not affect performance in this naive \
> setup. 
> [1] https://github.com/openjdk/jdk/compare/master...cl4es:log2_micro?expand=1

This pull request has now been integrated.

Changeset: 4158567f
Author:    Claes Redestad <redestad@openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/4158567f
Stats:     317 lines in 3 files changed: 296 ins; 10 del; 11 mod

8255455: Pre-generate ThreadHeapSampler::_log_table

Reviewed-by: iklam, sspitsyn

-------------

PR: https://git.openjdk.java.net/jdk/pull/880


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic