ttomcat-1778514358873.zip-extract/apache-tomcat-11.0.18-src/test/jakarta/el/TesterImportHandlerPerformance.java

Path
ttomcat-1778514358873.zip-extract/apache-tomcat-11.0.18-src/test/jakarta/el/TesterImportHandlerPerformance.java
Status
scanned
Type
file
Name
TesterImportHandlerPerformance.java
Extension
.java
Programming language
Java
Mime type
text/plain
File type
ASCII text, with CRLF line terminators
Tag

      
    
Rootfs path

      
    
Size
2052 (2.0 KB)
MD5
5ee396326f7c8a46089aec323724646b
SHA1
0a032a439e4c290366162a0b704caceb464a4826
SHA256
03e44f947e42f8f5f9f729b6a9feaa06b7290f4bec4a907819d0b87cc58dcf0d
SHA512

      
    
SHA1_git
5b04cfc7b9e3fb5dc39ea8b3616eafbb9f8cb6ae
Is binary

      
    
Is text
True
Is archive

      
    
Is media

      
    
Is legal

      
    
Is manifest

      
    
Is readme

      
    
Is top level

      
    
Is key file

      
    
TesterImportHandlerPerformance.java | 2.0 KB |

/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF 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 * * http://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 jakarta.el; import org.junit.Test; /* * This is an absolute performance test. There is no benefit it running it as part of a standard test run so it is * excluded due to the name starting Tester... */ public class TesterImportHandlerPerformance { /* * This test is looking at the cost of looking up a class when the standard JSP package imports are present: - * java.lang - jakarta.servlet - jakarta.servlet.http - jakarta.servlet.jsp * * Before optimisation, this test took ~4.6s on markt's desktop After optimisation, this test took ~0.05s on markt's * desktop */ @Test public void testBug62453() throws Exception { long totalTime = 0; for (int i = 0; i < 100000; i++) { ImportHandler ih = new ImportHandler(); ih.importPackage("jakarta.servlet"); ih.importPackage("jakarta.servlet.http"); ih.importPackage("jakarta.servlet.jsp"); long start = System.nanoTime(); ih.resolveClass("unknown"); long end = System.nanoTime(); totalTime += (end - start); } System.out.println("Time taken: " + totalTime + "ns"); } }
Detected license expression
apache-2.0
Detected license expression (SPDX)
Apache-2.0
Percentage of license text
45.42
Copyrights

      
    
Holders

      
    
Authors

      
    
License detections License expression License expression SPDX
apache_2_0-4bde3f57-78aa-4201-96bf-531cba09e7de apache-2.0 Apache-2.0
URL Start line End line
http://www.apache.org/licenses/LICENSE-2.0 9 9