目的
- 了解JAVA程序性能调优的过程、原理以及常见方法;在这方面做到“知道自己不知道”;
- 不用了解太多细节,这些细节的学习需要结合大量实践,只能有机会再深入。
TODO/疑问
- 为什么优化GC时,要按照“确定内存需求" -> "延迟调优" -> "吞吐量调优"的顺序? 是因为这些指标之间存在该顺序表明的依赖关系?
- 如何定义性能需求?
<?xml version="1.0" encoding="UTF-8"?> | |
<!-- <configuration debug="true"> 调试模式下,可输出logback的内部日志信息 --> | |
<configuration debug="false"> | |
<!-- 控制台输出 --> | |
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> | |
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"> | |
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符 [%file:%line]日志所在文件及行数 %msg%n消息及换行--> | |
<pattern>%d{yyyy-MM-dd HH:mm:ss} [%level][%thread]:%logger{50} [%method:%line] %msg%n</pattern> |
<?xml version="1.0" encoding="UTF-8"?> | |
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"> | |
<localRepository>/opt/devtools/maven/repo</localRepository> | |
<mirrors> | |
<mirror> | |
<id>maven-aliyun-mirror</id> | |
<name>maven-aliyun-mirror</name> | |
<url>http://maven.aliyun.com/nexus/content/groups/public/</url> |
// --------------------------------------------------- Acceptor Inner Class | |
/** | |
* The background thread that listens for incoming TCP/IP connections and | |
* hands them off to an appropriate processor. | |
*/ | |
protected class Acceptor extends AbstractEndpoint.Acceptor { | |
@Override | |
public void run() { |
/** | |
* The background thread that listens for incoming TCP/IP connections and | |
* hands them off to an appropriate processor. | |
*/ | |
@Override | |
public void run() { | |
// Loop until destroy() is called | |
while (true) { | |
try { | |
// Loop if endpoint is paused |
@Override | |
public AsyncContext startAsync(ServletRequest request, | |
ServletResponse response) { | |
if (!isAsyncSupported()) { | |
throw new IllegalStateException(sm.getString("request.asyncNotSupported")); | |
} | |
if (asyncContext == null) { | |
asyncContext = new AsyncContextImpl(this); | |
} |
wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo | |
yum install apache-maven |
acquire lock on object state | |
while (precondition does not hold) { | |
release lock | |
wait until precondition might hold | |
optional fail if interrupted or timeout expires | |
require lock | |
} | |
perform action | |
release lock |
目的
TODO/疑问
git config --global alias.oa '!zsh -c '\''diff --old-line-format='' --new-line-format='' <(git rev-list --first-parent "${1:-master}") <(git rev-list --first-parent "${2:-HEAD}") | head -1' | |
git config --global alias.branchdiff '!sh -c "git diff `git oa`.."' | |
git config --global alias.branchlog '!sh -c "git log `git oa`.."' |
import com.fasterxml.jackson.annotation.JsonPropertyOrder; | |
import com.fasterxml.jackson.databind.ObjectWriter; | |
import com.fasterxml.jackson.dataformat.csv.CsvMapper; | |
import com.fasterxml.jackson.dataformat.csv.CsvSchema; | |
import java.io.BufferedOutputStream; | |
import java.io.File; | |
import java.io.FileNotFoundException; | |
import java.io.FileOutputStream; | |
import java.io.IOException; | |
import java.io.OutputStreamWriter; |