Skip to content

Instantly share code, notes, and snippets.

./simpleperf record --duration 4 -g -f 8000 --app com.example.your.app

GCC compiler optimization for ARM-based systems

2017-03-03 fm4dd

The gcc compiler can optimize code by taking advantage of CPU specific features. Especially for ARM CPU's, this can have impact on application performance. ARM CPU's, even under the same architecture, could be implemented with different versions of floating point units (FPU). Utilizing full FPU potential improves performance of heavier operating systems such as full Linux distributions.

-mcpu, -march: Defining the CPU type and architecture

These flags can both be used to set the CPU type. Setting one or the other is sufficient.

@etaf
etaf / cpu_type
Created January 10, 2020 05:39
cpu_type
ls /sys/bus/event_source/devices/
@etaf
etaf / check kernel compiled configuration
Created January 6, 2020 09:26
check kernel compiled configuration
busybox zcat /proc/config.gz | grep CONFIG_HW_PERF_EVENTS
@etaf
etaf / cmake_cross_compile.sh
Created December 26, 2019 07:51
cmake_cross_compile
cmake .. -DCMAKE_SYSTEM_NAME=Android -DCMAKE_SYSTEM_VERSION=18 -DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a -DCMAKE_ANDROID_NDK=/ndk/android-ndk-r10e -DCMAKE_ANDROID_STL_TYPE=gnustl_static -DCMAKE_BUILD_TYPE=Release
@etaf
etaf / ssh_socks5.sh
Created September 17, 2019 02:41
ssh - socks5
ssh -o ProxyCommand='nc -x 127.0.0.1:1080 %h %p' user@host
@etaf
etaf / leetcode_category.txt
Last active September 17, 2019 08:38
leetcode category
[interval, segment]
1094: https://leetcode.com/problems/car-pooling/
986 : https://leetcode.com/problems/interval-list-intersections/
1109: https://leetcode.com/problems/corporate-flight-bookings/
[nth-element, priority queue, heap]
973 : https://leetcode.com/problems/k-closest-points-to-origin/
[pure dp]
1143: https://leetcode.com/problems/longest-common-subsequence/
@etaf
etaf / io_speed_up.cpp
Created August 1, 2019 06:12
Leetcode io speedup
const static auto ioSpeedUp = [](){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
return NULL;
}();
@etaf
etaf / python get host ip
Created July 11, 2019 06:13
python get host ip
import socket
def get_host_ip():
try:
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.connect(('8.8.8.8', 80))
ip = s.getsockname()[0]
finally:
s.close()
@etaf
etaf / git config
Created June 28, 2019 01:12
git config
# ~/.gitconfig
[color]
ui = auto
[alias]
lg1 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all
lg2 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all
lg = !"git lg1"
sub = !"git submodule update --init --recursive"
st = !"git status"
showf = !"git show --pretty="" --name-only"