Closed wanghenshui closed 8 months ago
constexpr and consteval functions https://biowpn.github.io/bioweapon/2024/02/17/constexpr-consteval-function.html
// This is a pure compile-time function.
// Any evaluation is fully done at compile-time;
// no runtime code will be generated by the compiler, just like `static_assert`.
consteval size_t strlen_ct(const char* s) {
size_t n = 0;
for (; s[n] != '\0'; ++n);
return n;
}
// This is a pure runtime function, which can only be invoked at runtime.
size_t strlen(const char* s);
// This function can be invoked both at both compile-time and at runtime,
// depending on the context.
constexpr size_t strlen_dual(const char* s) {
if consteval {
return strlen_ct(s); // compile-time path
} else {
return strlen(s); // runtime path
}
}
https://johnnysswlab.com/a-story-of-a-very-large-loop-with-a-long-instruction-dependency-chain/
简单来说就是拆循环 loop fission + 降低数据buffur大小,小于l1 cacheline,提升性能
需要复现一下
如何发现是内存子系统的问题(buffer大于cacheline)? 使用likwid 查的。这个实验需要复现一下看看
简单来说就是通过 interleave 拆分任务,来加速,这个和loop fission还不太一样,loop fission就是单纯的拆循环,interleave又不同任务分发调度的感觉
TerensTare/modern_bloom 挑刺儿一下
当我们实现bloom filter都需要注意什么?
https://cnrs.hal.science/hal-04090584/document
音视频领域有个 M x N问题
不同的media processors 在N种平台上导致api复杂度上升不可维护
考虑一种接口设计方法,让代码更简练
琢磨半天结果是concept + boost pfr之类的检测接口/策略模版
https://ossia.io/posts/reflection/
https://github.com/celtera/avendish