`

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,通过提前加载数据来提高页面...

    Swifter - 100 个 Swift 必备 Tips

    ### Swifter - 100 个 Swift 必备 Tips #### 1. Currying (柯里化) 在函数式编程中,柯里化是一种将接受多个参数的函数转换为一系列函数链的方法,每个函数都接受一个单一的参数。这种技术在 Swift 中可以用于创建...

    Visual Studio Debug实战教程之基础入门

    Data Tips可以在代码行上悬浮显示变量值,而监视窗口则允许动态观察特定变量的变化。多线程和线程窗口对于调试并发或多进程程序特别有用,可以清晰地查看和控制每个线程的行为。并行调试概览则提供了更宏观的并发...

    Swifter - 100 个Swift 必备Tips (第二版)

    Swift提供了print和debugPrint等工具来帮助开发者调试代码,这些工具在开发过程中非常实用。 以上是书中涵盖的一些关键知识点,通过学习这些技巧,开发者不仅能够提高编程效率,还能写出更加优雅和高效的Swift代码...

    Swifter-100个tips-2018年6月

    根据提供的文件信息,以下是关于“Swifter-100个tips-2018年6月”相关知识点的详细说明: 1. Swift 新元素:Swift 语言自发布以来,不断有新的特性加入,这些新元素可能是语言设计的优化、新语法的引入或者新库的...

    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...

    CodeWarrior 10.x+编译器使用Tips

    - 较高的优化等级虽然能减少代码量,但也可能导致 Debug 过程中出现单步调试代码上下乱跳的现象,这是因为编译器可能会移除它认为不必要的代码段。 - 对于没有特殊优化需求的情况下,建议保持默认设置,以避免调试时...

    100个Swift必备Tips(第二版)1

    38. **打印(debugPrint)**:用于调试的打印函数,比`print`更详尽。 39. **Playground**:Swift的实时测试环境,方便编写、测试代码片段。 这些知识点涵盖了Swift语言的基础、进阶特性以及与其他技术的交互,学习...

    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..........................................

    ios-tips:Cisco IOS 提示

    8. **故障排查**:掌握诊断工具如`ping`、`traceroute`和`debug`命令,以定位和解决网络问题。 9. **安全最佳实践**:理解如何加强设备安全性,如启用SSH代替telnet,设置强壮的密码策略,以及启用AAA...

    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. ...

Global site tag (gtag.js) - Google Analytics