Home | History | Annotate | Download | only in regression
      1 /*
      2  * Copyright (C) 2015 Google Inc.
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  * http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 
     17 package benchmarks.regression;
     18 
     19 import java.net.IDN;
     20 
     21 public class IdnBenchmark {
     22 
     23     public void timeToUnicode(int reps) {
     24         for (int i = 0; i < reps; i++) {
     25             IDN.toASCII("fass.de");
     26             IDN.toASCII("fa.de");
     27             IDN.toASCII("f.de");
     28             IDN.toASCII("a\u200Cb");
     29             IDN.toASCII("bb.at");
     30             IDN.toASCII("abc.co.jp");
     31             IDN.toASCII(".co.jp");
     32             IDN.toASCII("x\u0327\u0301.de");
     33             IDN.toASCII(".gr");
     34         }
     35     }
     36 
     37     public void timeToAscii(int reps) {
     38         for (int i = 0; i < reps; i++) {
     39             IDN.toUnicode("xn--fss-qla.de");
     40             IDN.toUnicode("xn--n00d.com");
     41             IDN.toUnicode("xn--bb-eka.at");
     42             IDN.toUnicode("xn--og-09a.de");
     43             IDN.toUnicode("xn--53h.de");
     44             IDN.toUnicode("xn--iny-zx5a.de");
     45             IDN.toUnicode("xn--abc-rs4b422ycvb.co.jp");
     46             IDN.toUnicode("xn--wgv71a.co.jp");
     47             IDN.toUnicode("xn--x-xbb7i.de");
     48             IDN.toUnicode("xn--wxaikc6b.gr");
     49             IDN.toUnicode("xn--wxaikc6b.xn--gr-gtd9a1b0g.de");
     50         }
     51     }
     52 
     53 }
     54