Skip to content

Instantly share code, notes, and snippets.

View uttampawar's full-sized avatar

Uttam Pawar uttampawar

  • Intel
  • Portalnd, OR
View GitHub Profile
@uttampawar
uttampawar / gist:2fb6d561cf684df68fd188fc3aa29e53
Created February 15, 2023 22:37
40 - mongodb threads perf report
Children Self Command Shared Object Symbol
+ 12.26% 0.00% swapper [kernel.vmlinux] [k] 0xffffffffb46000d4
+ 12.24% 0.00% swapper [kernel.vmlinux] [k] start_secondary
+ 12.24% 0.04% swapper [kernel.vmlinux] [k] cpu_startup_entry
+ 12.12% 0.34% swapper [kernel.vmlinux] [k] do_idle
+ 7.63% 0.10% swapper [kernel.vmlinux] [k] call_cpuidle
+ 7.53% 0.04% swapper [kernel.vmlinux] [k] cpuidle_enter
+ 7.41% 0.16% swapper [kernel.vmlinux] [k] cpuidle_enter_state
+ 6.80% 0.12% swapper [kernel.vmlinux] [k] acpi_idle_enter
+ 6.67% 6.67% swapper [kernel.vmlinux] [k] acpi_processor_ffh_cstate_enter
@uttampawar
uttampawar / gist:13c5f0c77125c9ac54cb0a406cf68967
Created February 15, 2023 22:13
1-mongodb thread with 1-client thread
Samples: 41K of event 'cycles', Event count (approx.): 571106932626
Overhead Command Shared Object Symbol
9.69% swapper [kernel.vmlinux] [k] acpi_processor_ffh_cstate_
2.07% conn2 mongod [.] __wt_row_search
1.86% conn2 libc-2.31.so [.] __memmove_avx_unaligned_er
0.97% conn2 [kernel.vmlinux] [k] copy_user_enhanced_fast_st
0.94% conn2 mongod [.] __wt_lex_compare_short
0.89% conn2 mongod [.] __config_next
0.88% conn2 mongod [.] __wt_row_leaf_key.constpro
0.87% conn2 mongod [.] __wt_checksum_hw
1)
0.74% 0.19% 0.00% 0.00% 0x28 1 1 1534622 0x7ffff783a29e 1581 1504 625 2450 158 [.] __pthread_mutex_trylock libpthread-2.31.so pthread_mutex_trylock.c:83 0{0,2-39,80,82-119>
|
---__GI___clone (inlined)
start_thread
|
|--60.97%--runFunc (inlined)
| mongo::unique_function<void ()>::operator() (inlined)
| call (inlined)
@uttampawar
uttampawar / node.objdump.txt
Created February 6, 2020 18:16
node binary objdump
00000000012fd660 <Builtins_LoadIC_Megamorphic>:
12fd660: f6 c2 01 test $0x1,%dl
12fd663: 0f 84 5d 0a 00 00 je 12fe0c6 <Builtins_LoadIC_Megamorphic+0xa66>
12fd669: 4c 8b 42 ff mov -0x1(%rdx),%r8
12fd66d: 4d 8b c8 mov %r8,%r9
12fd670: 49 c1 e9 0d shr $0xd,%r9
12fd674: 4d 33 c8 xor %r8,%r9
12fd677: 44 8b 59 07 mov 0x7(%rcx),%r11d
12fd67b: 45 8b c9 mov %r9d,%r9d
12fd67e: 45 03 cb add %r11d,%r9d
@uttampawar
uttampawar / gist:5a18b34644ae1b0cf55b1ea5df074aac
Created January 15, 2020 19:33
how to use realmjs with single instance
https://stackoverflow.com/questions/54962925/react-native-error-when-opening-realm-on-more-than-one-screen
https://github.com/realm/realm-js/tree/master/examples/ReactExample
import React from 'react';
import {
SafeAreaView,
StyleSheet,
ScrollView,
View,
Text,
StatusBar,
Dimensions
@uttampawar
uttampawar / gist:8f6d1ec0c9627d50066cb2e0ca35859a
Created November 27, 2019 20:03
plo build failure log for pgo-label
This file has been truncated, but you can view the full file.
echo "clang version is: 10" > check_environment
if [[ ! -e "stage1/build/CMakeCache.txt" ]]; then mkdir -p stage1/build ; cd stage1/build && cmake -G Ninja -DCMAKE_INSTALL_PREFIX=/mnt/sdb1/upawar/propeller-work/llvm-propeller/plo/stage1/install -DCMAKE_BUILD_TYPE=Release -DLLVM_OPTIMIZED_TABLEGEN=On -DLLVM_TARGETS_TO_BUILD="X86" -DLLVM_USE_LINKER="lld" -DCMAKE_C_COMPILER=/mnt/sdb1/upawar/propeller-work/llvm-propeller/build/bin/clang -DCMAKE_CXX_COMPILER=/mnt/sdb1/upawar/propeller-work/llvm-propeller/build/bin/clang++ -DCMAKE_ASM_COMPILER=/mnt/sdb1/upawar/propeller-work/llvm-propeller/build/bin/clang -DLLVM_ENABLE_PROJECTS="clang;compiler-rt;lld" /mnt/sdb1/upawar/propeller-work/llvm-propeller/llvm; fi
-- The C compiler identification is Clang 10.0.0
-- The CXX compiler identification is Clang 10.0.0
-- The ASM compiler identification is unknown
-- Found assembler: /mnt/sdb1/upawar/propeller-work/llvm-propeller/build/bin/clang
-- Check for working C compiler: /mnt/sdb1/upawar/propeller-work/llvm-propeller/buil
@uttampawar
uttampawar / gist:759078fa749170b6b75815874a81162a
Created November 26, 2019 02:01
LLVM propeller and Node.js with 2 workloads
Compiler LLVM v10.0 (branch: plo-dev, commit id: 2031626e55e6f8cd67aafb53142ada64a97db0d1)
Workload 1: webtooling (https://github.com/v8/web-tooling-benchmark)
Webtooling is simple to run. Only thing you need is to build node binary (Node.js runtime)
node-orignal node-with-propeller with-propeller/orig
score (runs/s) 10.15 9.53 0.939 <---- 7% regression in absolute throughput
binary-size (Bytes) 66,552,488 75,208,088 1.130 <--- size increased
cycles 403,260,331,520 419,827,132,716 1.041 <--- 4% more cycles
instructions 701,961,055,882 700,658,118,964 0.998 <--- instructions fairely remained same
@uttampawar
uttampawar / gist:5407f998bc3f02f58c4b83b0b4dc20fe
Last active March 28, 2020 05:43
llvm-propeller optimization on the included test program.
Hardware information:
OS: 4.15.0-58-generic (uname -r)
VERSION="18.04.3 LTS (Bionic Beaver)"
GCC: gcc version 7.4.0 (Ubuntu 7.4.0-1ubuntu1~18.04.1)
GNU ld (GNU Binutils for Ubuntu) 2.30
$ clang++ -O2 main.cc callee.cc -fpropeller-label -o a.out.labels -fuse-ld=lld
$ perf record -e cycles:u -j any,u -- ./a.out.labels 1000000000 2 >& /dev/null
$LLVM_DIR/llvm-propeller/create_llvm_prof --format=propeller --binary=./a.out.labels --profile=perf.data --out=perf.propeller
$ cat perf.propeller
@a.out.labels
Symbols
1 2b N_start
2 2 N_dl_relocate_static_pie
3 0 Nderegister_tm_clones
4 0 Nregister_tm_clones
5 0 N__do_global_dtors_aux
6 0 Nframe_dummy
7 3d Nmain