Skip to content

Instantly share code, notes, and snippets.

View franz1981's full-sized avatar
🏠
Working from home

Francesco Nigro franz1981

🏠
Working from home
View GitHub Profile
============================= C2-compiled nmethod ==============================
----------------------------------- Assembly -----------------------------------
Compiled method (c2) 1259 774 4 red.hat.puzzles.checks.LowerCaseComparison::optimizedContentEqualsIgnoreCase (12 bytes)
total in heap [0x00007f06e5229690,0x00007f06e522a3a0] = 3344
relocation [0x00007f06e52297f0,0x00007f06e5229818] = 40
main code [0x00007f06e5229820,0x00007f06e5229be0] = 960
stub code [0x00007f06e5229be0,0x00007f06e5229bf8] = 24
oops [0x00007f06e5229bf8,0x00007f06e5229c00] = 8
metadata [0x00007f06e5229c00,0x00007f06e5229c30] = 48
============================= C2-compiled nmethod ==============================
----------------------------------- Assembly -----------------------------------
Compiled method (c2) 204 763 4 red.hat.puzzles.checks.LowerCaseComparison::unoptimizedContentEqualsIgnoreCase (12 bytes)
total in heap [0x00007f0279223e90,0x00007f0279224bd8] = 3400
relocation [0x00007f0279223ff0,0x00007f0279224018] = 40
main code [0x00007f0279224020,0x00007f0279224420] = 1024
stub code [0x00007f0279224420,0x00007f0279224438] = 24
oops [0x00007f0279224438,0x00007f0279224440] = 8
metadata [0x00007f0279224440,0x00007f0279224478] = 56
package red.hat.puzzles.concurrent;
import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.BenchmarkMode;
import org.openjdk.jmh.annotations.CompilerControl;
import org.openjdk.jmh.annotations.Fork;
import org.openjdk.jmh.annotations.Measurement;
import org.openjdk.jmh.annotations.Mode;
import org.openjdk.jmh.annotations.OutputTimeUnit;
import org.openjdk.jmh.annotations.Scope;
package red.hat.puzzles.http;
import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.BenchmarkMode;
import org.openjdk.jmh.annotations.CompilerControl;
import org.openjdk.jmh.annotations.Fork;
import org.openjdk.jmh.annotations.Measurement;
import org.openjdk.jmh.annotations.Mode;
import org.openjdk.jmh.annotations.OutputTimeUnit;
import org.openjdk.jmh.annotations.Scope;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
public class Main {
static {
System.out.println("here we go...");
try (ExecutorService executor = Executors.newVirtualThreadPerTaskExecutor()) {
executor.submit(() -> {}).get();
} catch (Exception e) {
@franz1981
franz1981 / ClientMessageAPI.java
Created October 1, 2023 07:41
grpc-examples Low level Vertx Message API
package io.vertx.example.grpc.helloworld;
import com.google.protobuf.Message;
import com.google.protobuf.Struct;
import com.google.protobuf.util.JsonFormat;
import io.vertx.core.AbstractVerticle;
import io.vertx.core.Future;
import io.vertx.core.Launcher;
import io.vertx.core.buffer.Buffer;
import io.vertx.core.net.SocketAddress;
/*
* Copyright 2021 Andrei Pangin
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@franz1981
franz1981 / startup.sh
Created September 18, 2023 16:10
Dummy script for startup
#!/bin/bash
if [ $# -ne 2 ]; then
echo "Usage: $0 <application> <N>"
exit 1
fi
application="$1"
N="$2"
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
public class VThreadCreation {
private static final int TASKS = 1024;
public static void main(String[] args) throws InterruptedException {
long rounds = Long.MAX_VALUE;
if (args.length == 1) {
package red.hat.puzzles.concurrent;
import org.openjdk.jmh.annotations.*;
import org.openjdk.jmh.infra.Blackhole;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
@State(Scope.Benchmark)