`

Debug tips

    博客分类:
  • Java
阅读更多
1 add log in third party code

you can create the same class with same package in your source code, then copy it's source to your class, and add log as you like, then compile it and run it, Tomcat will first load your modified class rather than the origin class which is in third party jar file.

2 run the suspicious code multi times to enlarge the different

sometime, the same statement run in one environment is less slower than run in another environment. we can run them in debug environment, but hardly compare them manually especially in debug environment. And no JProfile help, then we can using a For loop to run the statement multi times, e.g. 1000 times, then if in one environment it cost 1.5s, other cost 10s, it's easy for feel the difference.

Another reason for run the suspicious code multi times is to find the sub statement which cause downgrade.

e.g. now we know method A consume 1ms in one environment, and 10ms in other environment. And A contains statement A1-A5, we need deep into these A1-A5 to check which one cause downgrade again. then we can first try run A1 100 times in two environment, other code are same, then run A2 100 times and so on to find is there huge diffierence in two environment, for example, if we run A3 100 times and other code are same, then one environment is 70ms and 1000ms in another one. we can think A3 cause downgrade and deep into A3 again.

there are some limitation in this way: the method must be 1. can be run many time, 2. no side effect after running many times, 3. every time running consume same time, running same logic in the method.

Solving problem need try different ways and sometimes need some lucky, don't give up too early!
分享到:
评论

相关推荐

    Android Debug Tips.ppt

    android入门学习的教程,主要讲调试debug相关的内容,非常的好,适合新手看看

    Android代码-debug_view_kotlin

    推荐项目kotlin_tips,用Kotlin去提高生产力:汇总Kotlin相对于Java的优势,以及怎么用Kotlin去简洁、务实、高效、安全开发的Tips 推荐项目easy_mock_api,给客户端同学的模拟json接口的小工具 推荐项目CompatWebView...

    Mimiron2:基于React的组件库

    调试 npm run debug Tips 在webpack中公用一个entry会导致无法暴露output.library中的元素. 基于ant design V0.12.13. 支持React正常用法, 关于React的两种开发方法请 前端使用babel.browser进行转义, 除了模块管理,...

    Android代码-kotlin_tips

    推荐:Kotlin的实践项目debug_view_kotlin,用Kotlin实现的Android浮层调试控制台,实时的显示内存、FPS、App启动时间、Activity启动时间、文字Log 推荐:数据预加载项目and-load-aot,通过提前加载数据来提高页面...

    TMAX debug

    synopsys TMAX: Tips For Simulation Debug, ATPG Pattern Validation

    ETS364 Programmers_Book_Rev6_READER+COMMENTS.pdf

    APU-12, SPU-100 & debug fundamentals Basics of Pattern based testing pattern based testing of a DUT Groupset accumulator Optimizing a test Introduction to Per Pin digital introduction of digital...

    Django 1.1 Testing and Debugging.pdf

    Tips on asking questions that will get good answers 370 Opening a new ticket to report a problem 372 Summary 374 Chapter 11: When it's Time to Go Live: Moving to Production 375 Developing an ...

    Perl Debugged.pdf

    3.7 Tips for Reducing Complexity....................................................................................26 Chapter 4. Perl Pitfalls..........................................

    Programmers.Guide.to.Drupal.Principles.Practices.and.Pitfalls.2nd.Edition

    Learn programming tips and tools to help you perfect and debug your applications Table of Contents Chapter 1. Overview of Drupal Chapter 2. Drupal Programming Principles Chapter 3. Common Drupal ...

    Java.EE.Development.with.Eclipse.2nd.Edition.178528534

    Develop, debug, test, and troubleshoot Java EE 7 applications rapidly with Eclipse About This Book Go beyond simply learning Java EE APIs and explore the complete workflow of developing enterprise ...

    Writing Windows WDM design drivers

    This well-paced and informative guide offers numerous excellent tips, including how to design device drivers that fit your needs, and a good deal of material on how to test and debug driver code. ...

    [C#] Windows Runtime via C# (英文版)

    And you'll gain practical insights and tips for how to architect, design, optimize, and debug your apps. ☆ 出版信息:☆ [作者信息] Jeffrey Richter , Maarten van de Bospoort [出版机构] Microsoft ...

    【2018新书】Deep Learning Cookbook

    Neural nets are notoriously hard to debug and the tips and tricks in this chapter on how to make them behave will come in handy when going through the more project-oriented recipes in the rest of the...

    Gradle for Android(PACKT,2015)

    You will work with build variants, such as debug and release, paid and free, and even combinations of these things. The book will also help you set up unit and integration testing with different ...

    Learn Angular The Collection

    Chapter 3:Using Angular Augury to Debug Your Code Chapter 4:Top Angular Plugins for Sublime Text Chapter 5:Boosting Your Workflow with Angular 5 Snippets and VS Code Chapter 6:Top 12 Productivity Tips...

    Flex 3 A Beginners Guide

    profile and debug your applications; and manage media assets. Designed for Easy Learning Key Skills & Concepts--Chapter-opening lists of specific skills covered in the chapter Ask the Experts--Q&...

    dos6.22帮助手册

    Debug INTERLNK.EXE SETVER.EXE Defrag International commands Share Del Intersvr Shell Deltree Keyb Shift Device Label SIZER.EXE Device drivers Lastdrive Smartdrv Devicehigh Lh SMARTDRV.EXE Dir ...

    网站抓取精灵

    绉垎 <div class="tip_horn"></div> ...v=1" type="text/javascript" charset="UTF-8"></script><script type="text/javascript">document.getElementById("debuginfo").innerHTML = " Updated at 13:28:30, Proc

    Packtpub.Instant.Firebug.Starter.Jan.2013.pdf

    It is difficult for front end and web developers to debug and fix issues that crop up on client machines. Firebug helps to solve this; it is a wonderful toolkit to help identify and fix issues that ...

    Windows Runtime via C#

    And you'll gain practical insights and tips for how to architect, design, optimize, and debug your apps. With this book, you will: Learn how to consume Windows Runtime APIs from C# Understand the ...

Global site tag (gtag.js) - Google Analytics