当前位置:网站首页>How to explore large open source software library

How to explore large open source software library

2021-02-22 11:47:12 InfoQ

{"type":"doc","content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" author :Parth Parikh,Kishore Ganesh,Chris Ewald,Cory Massaro,Makrand Rajagopal,Sarthak Kundra"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"italic"},{"type":"color","attrs":{"color":"#333333","name":"user"}},{"type":"strong"}],"text":" This article was originally published in "},{"type":"text","marks":[{"type":"italic"},{"type":"strong"}],"text":"Parth Parikh Of individuals "},{"type":"text","marks":[{"type":"italic"},{"type":"color","attrs":{"color":"#333333","name":"user"}},{"type":"strong"}],"text":" Blog , Authorized by the original author InfoQ Translate and share ."}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":" notes "},{"type":"text","text":": This guide is for us to 2020 In autumn MLH The researchers developed "},{"type":"link","attrs":{"href":"https:\/\/github.com\/MLH-Fellowship\/OSS-Guide","title":null,"type":null},"content":[{"type":"text","text":" Open source software guide "}]},{"type":"text","text":" Part of . But I firmly believe that , This will help anyone new to explore a large code base . If you have any suggestions for this guide , please "},{"type":"link","attrs":{"href":"https:\/\/pncnmnp.github.io\/blogs\/pics\/email.png","title":null,"type":null},"content":[{"type":"text","text":" Contact me "}]},{"type":"text","text":"."}]},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","text":" The content list "}]},{"type":"bulletedlist","content":[{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"color","attrs":{"color":"#494949","name":"user"}}],"text":" Select an item "}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"color","attrs":{"color":"#494949","name":"user"}}],"text":" Start exploring the repository "}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"color","attrs":{"color":"#494949","name":"user"}}],"text":" Use the repository "}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"color","attrs":{"color":"#494949","name":"user"}}],"text":" Check out the initial submission "}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"color","attrs":{"color":"#494949","name":"user"}}],"text":" The test case 、 Specification and build from source code "}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"color","attrs":{"color":"#494949","name":"user"}}],"text":" Use tools to help understand "}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"color","attrs":{"color":"#494949","name":"user"}}],"text":"Git Log Using skills "}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"color","attrs":{"color":"#494949","name":"user"}}],"text":" Search for "}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"color","attrs":{"color":"#494949","name":"user"}}],"text":" Find the problem "}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"color","attrs":{"color":"#494949","name":"user"}}],"text":" plan "}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"color","attrs":{"color":"#494949","name":"user"}}],"text":" Make full use of problem description "}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"color","attrs":{"color":"#494949","name":"user"}}],"text":" Don't try to traverse the entire code base "}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"color","attrs":{"color":"#494949","name":"user"}}],"text":" Figure out what part of you plays in it "}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"color","attrs":{"color":"#494949","name":"user"}}],"text":" Recurring problems "}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"color","attrs":{"color":"#494949","name":"user"}}],"text":" Structural theory "}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"color","attrs":{"color":"#494949","name":"user"}}],"text":" Coding and guidelines "}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"color","attrs":{"color":"#494949","name":"user"}}],"text":" Feedback from mentors and maintenance staff "}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"color","attrs":{"color":"#494949","name":"user"}}],"text":" debugging 、 Logging and performance analysis "}]}]}]},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","text":" Select an item "}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" Your team leader and mentor sent you a list of repositories , List the projects you can participate in . You have to study these repositories and related issues . The most likely is , These repositories are already GitHub Upper MLH-Fellowship There's a fork in the organization , And the project board (project board) Has been associated with these bifurcations :"}]},{"type":"image","attrs":{"src":"https:\/\/static001.geekbang.org\/infoq\/10\/1037ab660746b7c58e6ac2082857b6bf.png","alt":null,"title":null,"style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" The project board is a good place to find problems ."}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" If the repository you choose has not yet created a fork , Or you haven't added a project board yet , Please contact the tutor , Because they need to further improve their work ."}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" perhaps , You may have a very clear vision of what you want to participate in or what you want to do . We encourage team members to be proactive ! Be sure to GitHub Open questions and discuss them on the Internet , To show your intention ."}]},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","text":" Start exploring the repository "}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" Exploring new repositories is undoubtedly a daunting task , There will be many aspects involved —— Be familiar with the language , Understand the tools or frameworks used , How components integrate with each other , What paradigms do developers use , wait . The key points mentioned in this section will provide you with a way to ensure that the journey of repository exploration goes smoothly ."}]},{"type":"heading","attrs":{"align":null,"level":3},"content":[{"type":"text","text":" Use the repository "}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" As in "},{"type":"link","attrs":{"href":"https:\/\/news.ycombinator.com\/item?id=16299125","title":null,"type":null},"content":[{"type":"text","text":" Various discussions "}]},{"type":"text","text":" Mentioned in , The best way to become familiar with any open source project is to use it . Start with a very simple idea about the project you're going to contribute to . then , Use this open source project to make this idea a reality . In the whole process , Make sure you understand the project's dependencies 、 Features and important components \/ class . Try to integrate as many features as possible . remember , Your first goal is to explore the breadth of the project ."}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" If the above process makes you feel passive , Analyze why ? It's because of a tool 、 Language 、 frame , Or something else ? In understanding “ Why? ” after , Observe how the project uses the technology , And read the documentation . If the document is too informative , Please skip to the tutorial , Or watch the author \/ Relevant video demonstration provided by maintenance personnel . If there's still confusion , On the discussion platform of the project (Github discussion、Slack、Discord etc. ) Contact contributors on the Internet ."}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" Last ,MLH-Fellowship Of "},{"type":"text","marks":[{"type":"italic"}],"text":"kickoff hackathon"},{"type":"text","text":", The main purpose is to make researchers widely use the open source projects that they will contribute to the whole scholarship project . So take advantage of this opportunity ."}]},{"type":"heading","attrs":{"align":null,"level":3},"content":[{"type":"text","text":" Check out the initial submission "}]},{"type":"blockquote","content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" Always do the hardest part first . If the hardest part is the impossible task , Why waste time on the easy part ? Once the hardest part is done , And it's done ."}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":"br"}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" Always do the easy part first . The part you thought was easy at first , The result is often the hard part . Once the simple part is done , You can focus all your energy on the difficult part ."}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":"br"}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"—— "},{"type":"text","marks":[{"type":"italic"}],"text":"A. Schapira"}]}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" Usually , The initial submission contains all the key points of the project . By analyzing them , You can see the initial goal of the repository . Here is BentoML The defenders are 2019 year 4 month 2 It's made in Japan "},{"type":"link","attrs":{"href":"https:\/\/github.com\/bentoml\/BentoML\/tree\/09f4bb198f55498a46461f89bba3293a70d69373","title":null,"type":null},"content":[{"type":"text","text":" First submission "}]},{"type":"text","text":"."},{"type":"codeinline","content":[{"type":"text","text":"README"}]},{"type":"text","text":" Pointed out that ,BentoML To achieve three goals —— Simplify deployment workflow , Support the main framework , And built in DevOps practice . This is related to "},{"type":"codeinline","content":[{"type":"text","text":"\/example"}]},{"type":"text","text":"、"},{"type":"codeinline","content":[{"type":"text","text":"\/bentoml\/artifacts"}]},{"type":"text","text":" and "},{"type":"codeinline","content":[{"type":"text","text":"handlers"}]},{"type":"text","text":" Together, they form the main parts of the core components . Besides , In them "},{"type":"link","attrs":{"href":"https:\/\/github.com\/bentoml\/BentoML\/tree\/5aa380fbde98f696c1b1fe1b7f514ae07368c663","title":null,"type":null},"content":[{"type":"text","text":" The first 48 Submission "}]},{"type":"text","text":" when , The documentation has been greatly improved ."}]},{"type":"heading","attrs":{"align":null,"level":3},"content":[{"type":"text","text":" The test case 、 Specification and build from source code "}]},{"type":"blockquote","content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" It's often easier to read test code than application code , This may be because programmers don't do it at night 8 Write the test in a hurry ."}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":"br"}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"—— "},{"type":"link","attrs":{"href":"https:\/\/arandr.github.io\/2015\/01\/17\/how-i-learned-to-stop-worrying-and-debug-other-peoples-code.html","title":null,"type":null},"content":[{"type":"text","text":"arandr"}],"marks":[{"type":"color","attrs":{"color":"#c20000","name":"user"}}]}]}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" Transition from this part to "},{"type":"text","marks":[{"type":"italic"}],"text":" plan "},{"type":"text","text":" It's definitely challenging . To simplify this transformation , Build from source 、 It's very helpful to read test cases and understand specifications ."}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" Testing is considered one of the best forms of documentation . Usually , It gives you an idea of how the author expects to work . Using tests as an example reference is a great way to understand any project . If you plan to write tests for open source projects ,MIT: 6.005 There's a good article "},{"type":"link","attrs":{"href":"https:\/\/ocw.mit.edu\/ans7870\/6\/6.005\/s16\/classes\/03-testing\/index.html","title":null,"type":null},"content":[{"type":"text","text":" Test instructions "}]},{"type":"text","text":". remember —— The purpose of testing is to allow you to refactor and change code with confidence ."}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" If you haven't cloned the project and run it locally yet , Please make sure that "},{"type":"text","marks":[{"type":"italic"}],"text":" plan "},{"type":"text","text":" Finish the work before the next stage . Follow the installation instructions on the project ( Usually in "},{"type":"codeinline","content":[{"type":"text","text":"DEVELOPMENT.md"}]},{"type":"text","text":" in ) Get it running . Usually , When you can run the project's test suite and pass all ( Or most of it ) When testing , We think that this step has been completed ."}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" Studying specifications is another concrete step in understanding large code bases . for example ,"},{"type":"text","marks":[{"type":"italic"}],"text":"Runc"},{"type":"text","text":"( A... For building and running containers CLI Tools ) There is one "},{"type":"codeinline","content":[{"type":"text","text":"SPEC.md"}]},{"type":"text","text":" The document introduces "},{"type":"codeinline","content":[{"type":"text","marks":[{"type":"color","attrs":{"color":"#c20000","name":"user"}}],"text":"libcontainer"}]},{"type":"text","text":" Components , It contains the file system 、 Runtime sum init process 、 Detailed configuration of security, etc ."}]},{"type":"heading","attrs":{"align":null,"level":3},"content":[{"type":"text","text":" Use tools to help understand "}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" Understand what's in the code and where it is , It's usually useful , In this regard , similar UML Pictures and things like that can help . Many project documents include such a high-level architecture diagram , therefore , Be sure to see if there is such a diagram in the project ."}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" This is because they are the most concise representation of the whole project , A good architecture diagram can tell you a lot about how information flows in the code base ."}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" Your project doesn't have UML chart ? Never mind , Because there are tools that make it easier to comb large code bases ."},{"type":"codeinline","content":[{"type":"text","marks":[{"type":"color","attrs":{"color":"#c20000","name":"user"}}],"text":"pyreverse"}]},{"type":"text","text":" It's such a tool , It can be generated automatically for the code base you provide UML Class diagram ."}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" You can still use it "},{"type":"text","marks":[{"type":"italic"}],"text":" Call graph (call graphs)"},{"type":"text","text":" Know which functions are called , And the order in which they are called . They are visual representations of runtime function execution . for example :"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"Plain Textclass WhatNumber: def __init__(self): self.odd_counter = 0 def check(self, number): if number%2==1: self.odd(number) elif number%2==0: self.even(number) def odd(self, number): print(\"{} is odd\".format(number)) self.odd_counter += 1 def even(self, number): print(\"{} is even\".format(number))if __name__ == \"__main__\": obj = WhatNumber() obj.check(2) obj.check(1)"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"image","attrs":{"src":"https:\/\/static001.geekbang.org\/infoq\/f1\/f1ef66e21437dc960ec33d5f3086e4e5.png","alt":null,"title":null,"style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"WhatNumber Code call graph for "}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" Call graph can also contain other useful supplementary information , For example, the time spent on each function call ."}]},{"type":"heading","attrs":{"align":null,"level":3},"content":[{"type":"text","text":"Git Log Using skills "}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" just as "},{"type":"link","attrs":{"href":"https:\/\/news.ycombinator.com\/item?id=16299125","title":null,"type":null},"content":[{"type":"text","text":"Hacker News This post of "}]},{"type":"text","text":" Mentioned in , You can use version control to identify the most frequently edited files in any open source repository . Usually , These are the documents that do all the work (80\/20 The rules ), You may need to understand them ."}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" The corresponding command is as follows :"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"Plain Text# The most frequently edited 10 File git log --pretty=format: --name-only | sort | uniq -c | sort -rg | head -10# file name \/ The directory name contains the word NAME The most frequently edited 50 File git log --pretty=format: --name-only | sort | uniq -c | sort -rg | head -50 | grep NAME"}]},{"type":"heading","attrs":{"align":null,"level":3},"content":[{"type":"text","text":" Search for "}]},{"type":"blockquote","content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" If one wants to think effectively , You have to be willing to put up with anxiety , Suffering from search ."}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":"br"}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"—— J. Dewey"}]}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" Search tools are particularly important when navigating large code bases . If the code is in Github In public , You can navigate to its Repository , Press "},{"type":"codeinline","content":[{"type":"text","text":"\/"}]},{"type":"text","text":" start-up Github Search tools for , Input query , And get the highlighted instant search results ."}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" For local repositories , Use a simple "},{"type":"codeinline","content":[{"type":"text","text":"grep"}]},{"type":"text","text":" Command can do most of the things :"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"Plain Text# For the following command # r - Recursively search the directory # n - Print line number # i - Case sensitive search grep -rni $\"PATTERN\" *# Search for specific extensions grep -rni . --include \\*.EXTENSION"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" for example :"}]},{"type":"image","attrs":{"src":"https:\/\/static001.geekbang.org\/infoq\/3f\/3fe0c851f4d02a29618216b85954d1d3.png","alt":null,"title":null,"style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" Use  "},{"type":"codeinline","content":[{"type":"text","text":"ctags"}]},{"type":"text","text":" And with vim Integration is another way to search large code bases :"}]},{"type":"blockquote","content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" For many popular programming languages ,"},{"type":"link","attrs":{"href":"https:\/\/github.com\/universal-ctags\/ctags","title":null,"type":null},"content":[{"type":"text","text":"Universal"}]},{"type":"link","attrs":{"href":"https:\/\/github.com\/universal-ctags\/ctags","title":null,"type":null},"content":[{"type":"text","text":"Ctags"}]},{"type":"text","text":" Language objects can be found in source files , Generate an index ( Or tags ) file . This index file makes it easy for text editors and other tools to find index entries ."}]}]},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","text":" Find the problem "}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" In the discovery phase , Your goal is to find a set of good problems you want to solve . A good question should satisfy the following conditions :"}]},{"type":"bulletedlist","content":[{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" You are interested in this problem "}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" You already have the skills to solve this problem , Or in the process of programming through appropriate learning can learn ."}]}]}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" Be sure to look for problems in the projects assigned to you .MLH The tutor suggested , The search starts with "},{"type":"codeinline","content":[{"type":"text","text":"help wanted"}]},{"type":"text","text":"、"},{"type":"codeinline","content":[{"type":"text","text":"good first issue"}]},{"type":"text","text":"、"},{"type":"codeinline","content":[{"type":"text","text":"MLH"}]},{"type":"text","text":" or "},{"type":"codeinline","content":[{"type":"text","text":"hacktoberfest"}]},{"type":"text","text":"  The question of labels . Mentors also suggest , In the beginning, start with a relatively simple small problem , And then gradually solve the more complex and difficult problems in the whole learning process ."}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" All in all , choice 3 To 5 A question that meets the above criteria . Write them where you can take notes , And on this basis to carry out ."}]},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","text":" plan "}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" There's a myth on the Internet that comes from Henry Ford Our factory . The background of the story revolves around a large machine in a factory that breaks down , Confused Engineers , And a super genius to save the world . Here's the story : One of the big steam engines at the Ford plant started to break down , Ford's engineers don't know what's going on . But when this genius —— Usually Nikola Tesla or Charles Proteus Steinmetz—— Step in , He segregated the problem into an insignificant part , It just needs a little correction . The final bill is just 1 Thousands of dollars ."}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" Of course , Ford doubts , Because what this person does is just make a difference in the affected area , So genius made a breakdown :"}]},{"type":"bulletedlist","content":[{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"1 The dollar is used to indicate the location ;"}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"9999 The dollar is used to let engineers know how to isolate problems into a part of the system ."}]}]}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" This is the story , When you're faced with a huge code base , When you want to add a small fix , You may find yourself like ikola Tesla equally . Don't be scared , You don't need to be a genius , You just need some basic principles , It allows you to limit the problem to a small part of the code base 、 The controllable part ."}]},{"type":"heading","attrs":{"align":null,"level":3},"content":[{"type":"text","text":" Make full use of problem description "}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" in many instances , You can save exploration work , Because the maintainer of a project usually knows which areas of the code base the fix will involve , And this information is provided in the problem description ."}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" There's no point in starting from scratch , So make sure you've looked at all the information provided in the problem description ."}]},{"type":"heading","attrs":{"align":null,"level":3},"content":[{"type":"text","text":" Don't try to traverse the entire code base "}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" At the beginning , You may try to understand everything . It's not only unnecessary , And it can seriously damage your ability to contribute , Because nine times out of ten you'll feel more confused ."}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" Most repositories have been around for a long time , Many people contribute to and extend the code base , Make it what it is now . in the majority of cases , It's impossible to understand every line of code , You should try to deal with it strategically ."}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" Most good open source projects are well structured , Folder hierarchies and file names are mostly clear at a glance . Usually , These hierarchies follow a top-down approach : The larger subsystem folders contain their subassemblies . Down the folder hierarchy , Step into the subsystem you need to deal with , Final , Your scope of work will be narrowed down to a few files of the project , This is the workspace where you solve this problem ."}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" If you're fixing one Bug, So the problem may originate elsewhere in the system , however , The file you choose is a good starting point , You can try to trace the source of the problem from here . Of course , It's much easier to explore a small part of the code base than to try to grasp all that's going on ."}]},{"type":"heading","attrs":{"align":null,"level":4},"content":[{"type":"text","text":" The principle of paper cutting "}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" If you created the project , You'll know what happened to it . But for other people's projects , How to master the same level ?"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" As mentioned earlier , It is impossible for us to master an important code base in a short time . however , You should know “ The principle of paper cutting ”, The idea is , When you're done with a few small problems in the code base , Your basic understanding of the code base will improve , Until you know something about how everything in the code base works . This is it. “ outsiders ” The way to get familiar with the code , Over time, a small number of people become familiar with the code ."}]},{"type":"heading","attrs":{"align":null,"level":3},"content":[{"type":"text","text":" Figure out what part of you plays in it "}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" Now that you've identified the scope of the repair , So you should think of everything else as a black box . Know what type of input your part of the code will get , How to use them , And what output is expected ."}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" All of this seems abstract , But the basic idea is , If you want to add new content , You don't need to know how all the rest is done . You just have to assume that everything else meets the project specifications , And then try to explore a little bit of the code that you focus on ."}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" Of course , For each change , You may need to look at several different parts of the code base , Many of them have Bug. however , It's just because you've come across a bad software , Usually , You just need to focus on a well-defined aspect of a mature code base ."}]},{"type":"heading","attrs":{"align":null,"level":3},"content":[{"type":"text","text":" Recurring problems "}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" If your job is to eliminate loopholes , So before we plan to fix it , Your first step is undoubtedly to reproduce the problem . In the process , You're going to build projects , Make sure it works , And all the configurations are correct , And then finally reproduce the problem ."}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" There's a simple way to reproduce problems that can help in many ways . It helps accelerate development , You can ( And it should ) Further more , Try writing a test that captures this behavior . such , You can not only run tests quickly , It also ensures that in future versions of the project , This problem won't happen again ."}]},{"type":"heading","attrs":{"align":null,"level":3},"content":[{"type":"text","text":" Structural theory "}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" You've studied the problem , Narrowed the focus , Now it's time to tackle the problem . If you find the root cause of the mistake , Then you can move on to the next step , Make a solution , But if you get stuck , There's one thing that might help you out , That's to think creatively about the underlying causes of problems , And try to verify that each cause really exists ."}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" When you try to come up with a solution , It's helpful to brainstorm around a variety of ways to solve problems , Because you can compare and contrast several methods , And lock in the best one ."}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" When editing files in a huge code base , You could be paralyzed by analysis . There may be a lot of ideas coming to mind , But often , Out of concern about code quality , You just stay where you are , Instead of moving on ."}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" That's why it has to be done in two stages . The first step is to make it work , It's still on your machine right now . Some things can be hard coded , Some parts may also be optimized , But it's important that you have something to work with . Take it from a working state to a robust state , It's much easier than trying to do everything right the first time ."}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" Understand the spirit of iteration , Don't be afraid to change the code . Once the proof of concept is complete , You can continue to improve it ."}]},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","text":" Coding and guidelines "}]},{"type":"heading","attrs":{"align":null,"level":3},"content":[{"type":"text","text":" Feedback from mentors and maintenance staff "}]},{"type":"blockquote","content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" Another effective ( debugging ) Technology is explaining your code to others . Usually , You'll explain this to yourself Bug. Sometimes after a few words , You're embarrassed to say ,“ No problem , I know what's going on . I'm sorry to disturb you .” It's very effective ; You can even have non programmers as listeners . There is a teddy bear in the computer center of a university near the information desk . The students first explained to the bear , Then we can talk to human advisors ."}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":"br"}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"italic"}],"text":"B. Kernighan & D. Pike (《 Programming practice 》)"}]}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" just as "},{"type":"link","attrs":{"href":"https:\/\/arandr.github.io\/2015\/01\/17\/how-i-learned-to-stop-worrying-and-debug-other-peoples-code.html","title":null,"type":null},"content":[{"type":"text","text":"Arandr"}]},{"type":"text","text":" mentioned , Talking to experienced maintainers and explaining your understanding to new contributors is a positive habit . Both methods need to think positively about the code base , Often than “ Trial and error ” Strategy should be quick ."}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" Arrange a meeting , And yours MLH mentor \/ Let's take a look at your plan . Prepare a detailed plan for the meeting . In an ideal situation , A plan is a breakdown of a series of changes , The breakdown here refers to the main steps needed to make this change ? Here's a good rule of thumb : Every verb you use should have its own steps ."}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" Here's a good example of step decomposition :"}]},{"type":"bulletedlist","content":[{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" Create a new class "},{"type":"codeinline","content":[{"type":"text","text":"myApiService.js"}]}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" take "},{"type":"codeinline","content":[{"type":"text","text":"myComponent.js"}]},{"type":"text","text":" Functions in the file "},{"type":"codeinline","content":[{"type":"text","text":"getApiResponse"}]},{"type":"text","text":" The code is extracted into its own class . The common method of this class will be  ……"}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" Write a new test , Coverage is not directed to "},{"type":"codeinline","content":[{"type":"text","text":"xyz"}]},{"type":"text","text":" Use cases where functions pass parameters ."}]}]}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" During the meeting , mentor \/ Defenders will help you clarify and improve the plan . They may ask you to improve some aspects of the plan , Or go straight to the acceptance stage ."}]},{"type":"heading","attrs":{"align":null,"level":3},"content":[{"type":"text","text":" debugging 、 Logging and performance analysis "}]},{"type":"blockquote","content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" Debugging is an art that needs further study .…… The most effective debugging techniques seem to be those that are built into the program at design time —— Now , Many of the best programmers use nearly half of their programs to facilitate debugging the other half ; This part of the program will eventually be discarded , But in the end, the increase in productivity is amazing ."}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":"br"}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" Another good debugging practice is to document every mistake you make . Although it can be embarrassing , But for anyone who studies debugging , This information is very valuable , And it can also help you learn how to reduce the number of mistakes in the future ."}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":"br"}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"D. Knuth (《 Computer programming 》 First volume )"}]}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" The debugger is one of the most powerful tools in every programmer's toolkit . Ideally , To understand some function calls , You should choose a request flow , Make a request , And complete the whole request flow under the guidance of the debugger . When you view different files under the guidance of the debugger , You're using your visual memory . You'll remember how the code is organized and what the files look like . For many debuggers , Such as "},{"type":"codeinline","content":[{"type":"text","text":"gdb"}]},{"type":"text","text":" and "},{"type":"codeinline","content":[{"type":"text","text":"pdb"}]},{"type":"text","text":", The command set is almost the same . Here are the basic commands , You should be familiar with :"}]},{"type":"bulletedlist","content":[{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"codeinline","content":[{"type":"text","text":"l"}]},{"type":"text","text":" —— Displays the current line and the following lines of code "}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"codeinline","content":[{"type":"text","text":"p"}]},{"type":"text","text":" —— Evaluates the expression in the current context and prints its value "}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"codeinline","content":[{"type":"text","text":"s"}]},{"type":"text","text":" —— Step through the code "}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"codeinline","content":[{"type":"text","text":"n"}]},{"type":"text","text":" —— Next line of code ( for example : If you don't want to execute "},{"type":"codeinline","content":[{"type":"text","text":"argsort()"}]},{"type":"text","text":", Want to jump to the next line , You can use "},{"type":"codeinline","content":[{"type":"text","text":"n"}]},{"type":"text","text":")"}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"codeinline","content":[{"type":"text","text":"q"}]},{"type":"text","text":" —— Exit debugger "}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"codeinline","content":[{"type":"text","text":"b"}]},{"type":"text","text":" —— To set breakpoints ( Depends on the parameters provided )"}]}]}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" In some cases , It's good to use data breakpoints . Data breakpoints allow you to interrupt execution when a value stored in a particular memory location changes . for example , Monitoring variables "},{"type":"codeinline","content":[{"type":"text","text":"X"}]},{"type":"text","text":" Turn into "},{"type":"codeinline","content":[{"type":"text","text":"NULL"}]},{"type":"text","text":", Find out who released memory prematurely, causing dangling pointers , Observe the global data access flow , These are some of its use cases ."},{"type":"link","attrs":{"href":"https:\/\/stackoverflow.com\/questions\/621535\/what-are-data-breakpoints","title":null,"type":null},"content":[{"type":"text","text":"Shog9 stay StackOverflow On "}]},{"type":"text","text":" Provides a more comprehensive use case ."}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" At this point , A common problem is ——"},{"type":"text","marks":[{"type":"strong"}],"text":" Isn't it enough to print sentences ?"},{"type":"text","text":" As the case may be !"},{"type":"link","attrs":{"href":"https:\/\/softwareengineering.stackexchange.com\/a\/183903","title":null,"type":null},"content":[{"type":"text","text":"Glen K. Peterson"}]},{"type":"text","text":" That's a good description of the point :"}]},{"type":"blockquote","content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" I find , For pure software problems , Think about the problem and test the system , It's much more useful to know more about this than to execute the code line by line . Use print sentence , I can see everything that happens on the command line or in the log file and reproduce it in my imagination , And it's easier than using the debugger to switch back and forth ."}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":"br"}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" Usually , Solve the most difficult Bug To understand the problem without the computer . Sometimes with a piece of paper or whiteboard , Sometimes the answer comes out when I do something else . The trickiest part Bug You can solve it by looking at the code carefully , It's like playing Where's Waldo. The rest , It seems easy to use print statements or log statements ."}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":"br"}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" Different people have different styles , Different styles suit different tasks .Print Statement is not necessarily a method one level below debugger . It depends on what you do , They could also be better , Especially in languages without native debuggers (Go Has it ?)"}]}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" In some cases , The failure part of the program is very large ; The program adopts nonlinear flow control method ; Programs are multithreaded ; Run in real time ; Or perform destructive operations like writing files —— A better option is to use logging and assertions , May have a look StackOverflow On "},{"type":"link","attrs":{"href":"https:\/\/stackoverflow.com\/a\/29457171","title":null,"type":null},"content":[{"type":"text","text":"slugfilter The explanation given "}]},{"type":"text","text":"."}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" To learn more about debugging , You can read MIT lecturers Robert Miller and Max Goldman For the course "},{"type":"text","marks":[{"type":"italic"}],"text":"6.005: Software architecture "},{"type":"text","text":" Form a complete set of "},{"type":"link","attrs":{"href":"https:\/\/ocw.mit.edu\/ans7870\/6\/6.005\/s16\/classes\/11-debugging\/index.html","title":null,"type":null},"content":[{"type":"text","text":" Reading materials "}]},{"type":"text","text":"."}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" from "},{"type":"link","attrs":{"href":"https:\/\/docs.python.org\/3\/library\/profile.html","title":null,"type":null},"content":[{"type":"text","text":"Python file "}]},{"type":"text","text":" It can be seen that ,Profilers The deterministic performance analysis of the program is provided (deterministic profiling). among , A profile is a set of Statistics , Describe the frequency and time of execution of each part of the program . They will help you understand which parts of the program take up most of the time and \/ Or resources , So you can focus on optimizing these parts . MIT readings "},{"type":"link","attrs":{"href":"https:\/\/missing.csail.mit.edu\/2020\/debugging-profiling\/#profiling","title":null,"type":null},"content":[{"type":"text","text":"Missing Semester"}],"marks":[{"type":"color","attrs":{"color":"#c20000","name":"user"}}]},{"type":"text","text":" It's a wonderful guide to the performance analyzer in detail ."}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" Conclusion :"}]},{"type":"blockquote","content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" For debugging , People tend to be disgusted at first , Reluctant to execute , Show off at the end ."}]}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" Check the English text :"},{"type":"link","attrs":{"href":"https:\/\/pncnmnp.github.io\/blogs\/oss-guide.html","title":null,"type":null},"content":[{"type":"text","text":"General Guide For Exploring Large Open Source Codebases"}]}]}]}

版权声明
本文为[InfoQ]所创,转载请带上原文链接,感谢
https://chowdera.com/2021/02/20210221163651335r.html