In order to gen call graph in perf:
-fno-omit-frame-butter
#Generate perf.data for executable perf record -g executable #0.5 is a filter?, caller is inverse the graph callstack perf report -g 'graph,0.5,caller'
Prevent optimizer to remove code:
| ffmpeg -i input.mp4 -vf mpdecimate,setpts=N/FRAME_RATE/TB out.mp4 |
| # Version 1. Unsafe C Style | |
| $cp = [System.CodeDom.Compiler.CompilerParameters]::new() | |
| $cp.CompilerOptions = '/unsafe' | |
| $Display = Add-Type -TypeDefinition @' | |
| using System; | |
| using System.Runtime.InteropServices; | |
| public unsafe class Display | |
| { | |
| [DllImport("User32.dll")] | |
| public static extern bool EnumDisplaySettings( |
| SortedMap.iterableFactory should be Seq instead of Iterable | |
| Add implicits for IterableFactory objects | |
| MapView.values is not lazy |
| Monoid | |
| empty | |
| concat | |
| append | |
| Functor | |
| map: (a -> b) -> f a -> f b | |
| Monad | |
| unit |
| /* Ambiguous | |
| def compare[T1, T2](a: T1, b: T2)(implicit ev: T1 => T2) = compareImpl[T2](ev(a), b) | |
| def compare[T1, T2](a: T1, b: T2)(implicit ev: T2 => T1) = compareImpl[T1](a, ev(b)) | |
| def compareImpl[T](a: T, b: T) = a == b | |
| */ | |
| import scala.reflect.runtime.universe._ | |
| import scala.reflect.macros.blackbox.Context | |
| import scala.language.experimental.macros | |
| import scala.language.implicitConversions |
In order to gen call graph in perf:
-fno-omit-frame-butter
#Generate perf.data for executable perf record -g executable #0.5 is a filter?, caller is inverse the graph callstack perf report -g 'graph,0.5,caller'
Prevent optimizer to remove code:
| -fno-omit-frame-pointer | |
| -std=c++17 | |
| -pedantic |
| std::unordered_map<void*, size_t> *auto_ref_cnt; | |
| template<typename T> | |
| class AutoPtr { | |
| T * data; | |
| public: | |
| AutoPtr() = delete; | |
| AutoPtr(T* data): data(data) { | |
| if(auto_ref_cnt == nullptr) { | |
| auto_ref_cnt = new std::unordered_map<void*, size_t>; |
| #include <iostream> | |
| #include <string> | |
| #include <vector> | |
| #include <functional> | |
| #include <type_traits> | |
| template <typename T, typename = void> | |
| struct is_iterable : std::false_type {}; | |
| template <typename T> |
| //Template Type Check | |
| template<typename T, typename F, | |
| typename = std::enable_if_t<std::is_invocable<F, T>::value> > | |
| void foo() | |
| {} | |
| template<typename T, typename F, | |
| typename = typename std::enable_if<std::is_invocable<F, T>::value>::type > | |
| void foo() | |
| {} |