@@ -0,0 +1,2404 @@
+/*%0A * Licensed to Crate under one or more contributor license agreements.%0A * See the NOTICE file distributed with this work for additional%0A * information regarding copyright ownership.  Crate licenses this file%0A * to you under the Apache License, Version 2.0 (the %22License%22); you may%0A * not use this file except in compliance with the License.  You may%0A * obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or%0A * implied.  See the License for the specific language governing%0A * permissions and limitations under the License.%0A *%0A * However, if you have executed another commercial license agreement%0A * with Crate these terms will supersede the license and you may use the%0A * software solely pursuant to the terms of the relevant commercial%0A * agreement.%0A */%0A%0Apackage io.crate.protocols.postgres;%0A%0Aimport org.openjdk.jmh.annotations.Benchmark;%0Aimport org.openjdk.jmh.annotations.BenchmarkMode;%0Aimport org.openjdk.jmh.annotations.Mode;%0Aimport org.openjdk.jmh.annotations.OutputTimeUnit;%0Aimport org.openjdk.jmh.annotations.Scope;%0Aimport org.openjdk.jmh.annotations.State;%0Aimport org.openjdk.jmh.infra.Blackhole;%0A%0Aimport java.util.List;%0Aimport java.util.concurrent.TimeUnit;%0A%0A@BenchmarkMode(Mode.AverageTime)%0A@OutputTimeUnit(TimeUnit.MILLISECONDS)%0A@State(Scope.Benchmark)%0Apublic class QueryStringSplitterBenchmark %7B%0A%0A    @Benchmark%0A    public void checkSimpleQuery(Blackhole blackhole) %7B%0A        List%3CString%3E queries = QueryStringSplitter.splitQuery(%22select * from users%22);%0A        blackhole.consume(queries);%0A    %7D%0A%0A    @Benchmark%0A    public void checkMultiQuery(Blackhole blackhole) %7B%0A        List%3CString%3E queries = QueryStringSplitter.splitQuery(%22select id from users;%22 +%0A                                                              %22select count(*) from users group by id;%22 +%0A                                                              %22 -- comment %22 +%0A                                                              %22%5Cn select * from users;%22 +%0A                                                              %22/* block commment %5Cn */%22 +%0A                                                              %22select 1%22%0A        );%0A        blackhole.consume(queries);%0A    %7D%0A%7D%0A

Add benchmark for splitting multi-query string