目的
- 了解JAVA程序性能调优的过程、原理以及常见方法;在这方面做到“知道自己不知道”;
- 不用了解太多细节,这些细节的学习需要结合大量实践,只能有机会再深入。
TODO/疑问
- 为什么优化GC时,要按照“确定内存需求" -> "延迟调优" -> "吞吐量调优"的顺序? 是因为这些指标之间存在该顺序表明的依赖关系?
- 如何定义性能需求?
| private static class RemotingInvocationTimeoutScan implements Runnable { | |
| public void run() { | |
| while (true) { | |
| try { | |
| for (DefaultFuture future : FUTURES.values()) { | |
| if (future == null || future.isDone()) { | |
| continue; | |
| } | |
| if (System.currentTimeMillis() - future.getStartTimestamp() > future.getTimeout()) { |
| var CryptoJS = require('crypto-js') | |
| var request = require('request-promise') | |
| /* | |
| * npm install crypto-js request-promise request | |
| * node wx_t1t_hack.js | |
| */ | |
| // export function testEncription(msg, fullKey) { | |
| // var fullKey = fullKey.slice(0, 16) |
| /** Number of CPUS, to place bound on table size */ | |
| static final int NCPU = Runtime.getRuntime().availableProcessors(); | |
| /** | |
| * Table of cells. When non-null, size is a power of 2. | |
| */ | |
| transient volatile Cell[] cells; | |
| /** | |
| * Base value, used mainly when there is no contention, but also as |
| #! /bin/sh | |
| # | |
| # chkconfig: - 55 45 | |
| # description: The memcached daemon is a network memory cache service. | |
| # processname: memcached | |
| # config: /etc/sysconfig/memcached | |
| # pidfile: /var/run/memcached/memcached.pid | |
| # Standard LSB functions | |
| #. /lib/lsb/init-functions |
| package com.air.jmh; | |
| import java.sql.Timestamp; | |
| import java.util.Date; | |
| import java.util.Locale; | |
| import java.util.TimeZone; | |
| import java.util.concurrent.Executors; | |
| import java.util.concurrent.ScheduledExecutorService; | |
| import java.util.concurrent.TimeUnit; |
| 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; |
| 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`.."' |
目的
TODO/疑问
| 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 |
| 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 |