Home / File/ EscapeCsvBenchmark.java — netty Source File

EscapeCsvBenchmark.java — netty Source File

Architecture documentation for EscapeCsvBenchmark.java, a java file in the netty codebase.

Entity Profile

Relationship Graph

Source Code

/*
 * Copyright 2017 The Netty Project
 *
 * The Netty Project licenses this file to you 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:
 *
 *   https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations
 * under the License.
 */
package io.netty.microbench.internal;

import io.netty.microbench.util.AbstractMicrobenchmark;
import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.Measurement;
import org.openjdk.jmh.annotations.OutputTimeUnit;
import org.openjdk.jmh.annotations.Param;
import org.openjdk.jmh.annotations.Threads;
import org.openjdk.jmh.annotations.Warmup;
import org.openjdk.jmh.runner.options.ChainedOptionsBuilder;

import java.util.concurrent.TimeUnit;

import static io.netty.util.internal.ObjectUtil.*;
import static io.netty.util.internal.StringUtil.*;

@Threads(1)
@Warmup(iterations = 3)
@Measurement(iterations = 3)
@OutputTimeUnit(TimeUnit.MICROSECONDS)
public class EscapeCsvBenchmark extends AbstractMicrobenchmark {

    private static final String value1024;
    private static final String value1024commaAtEnd;
    static {
        StringBuilder s1024 = new StringBuilder(1024);
        while (s1024.length() < 1024) {
            s1024.append('A' + s1024.length() % 10);
        }
        value1024 = s1024.toString();
        value1024commaAtEnd = value1024 + ',';
    }

    @Param("netty")
    private String value;

    @Override
    protected ChainedOptionsBuilder newOptionsBuilder() throws Exception {
        return super.newOptionsBuilder()
                    .param("value", "netty")
                    .param("value", "\"123\"", "need\"escape", "need,quotes", "  trim-me  ", "short-comma-ended,")
                    .param("value", value1024)
                    .param("value", value1024commaAtEnd);
    }

// ... (101 more lines)

Domain

Subdomains

Frequently Asked Questions

What does EscapeCsvBenchmark.java do?
EscapeCsvBenchmark.java is a source file in the netty codebase, written in java. It belongs to the Buffer domain, Telemetry subdomain.
Where is EscapeCsvBenchmark.java in the architecture?
EscapeCsvBenchmark.java is located at microbench/src/main/java/io/netty/microbench/internal/EscapeCsvBenchmark.java (domain: Buffer, subdomain: Telemetry, directory: microbench/src/main/java/io/netty/microbench/internal).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free