欢迎投稿,推荐或自荐文章/软件/资源等,评论区留言
本期文章由 黄亮Anthony HNY 不语 赞助
大家新年快乐
boost 新增 charconv https://lists.boost.org/Archives/boost/2024/02/255821.php
把from_chars搬到c++11,我建议放弃c++11 ,2024了bro
文档 https://develop.charconv.cpp.al/
标准委员会动态/ide/编译器信息放在这里
编译器信息最新动态推荐关注hellogcc公众号 本周更新 2024-01-31 第239期
What’s New in vcpkg (January 2024) https://devblogs.microsoft.com/cppblog/whats-new-in-vcpkg-january-2024/
另外有个重写loki的活动哈,有点幽默,感兴趣可以看看 https://cppdepend.com/blog/loki-the-best-c-library-to-learn-design-patterns-lets-modernize-it/
(重写loki不是已经做了吗,folly啊)
brpc 发布了release note,我就不介绍了
大页可以带来性能提升,什么SDDK都在用,不过话说 redis 为啥不用?避免影响rdb生成?COW开销太大?
另外这有个 hugetop命令hugetop
代码这里 https://gitlab.com/procps-ng/procps
群友翻译,非常干活,值得看看
不过异常设计的还是太傻呗了
之前聊到的MLIR 在c/c++上的落地 CIR准备合入到LLVM
感觉clang明显更激进一些,而gcc还是一群老登
傻逼locale问题,虽然你是静态连接libstdcxx-static,但是locale并不static
errno是内核设置还是libc设置?当然是libc
怎么验证?简单来说就是同一个系统调用,调用syscall/通过汇编调用,观察errno变化
asm
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85883
第八行有问题,低版本的gcc (现在低版本gcc指的是7/8了)用大括号绕过即可,为什么列这个呢,因为我遇到了
分支预测非常影响性能。这里介绍了几个branchfree写法并且对比了性能,
代码 https://github.com/ibogosavljevic/johnysswlab/blob/master/2023-12-branches-memory/binary_search.cpp#L53
Array Size (in elements) | Original | Conditional Moves | Arithmetics |
---|---|---|---|
4 K | Runtime: 0.22 sInstr: 434 M CPI: 1.96Mem. Data Volume: 0.45 GB | Runtime: 0.14 sInstr: 785 MCPI: 0.728Mem. Data Volume: 0.25 GB | Runtime: 0.19 sInstr: 1.102 MCPI: 0.69Mem. Data Volume: 0.32 GB |
16 K | Runtime: 0.26 sInstr: 511 MCPI: 2.01Mem. Data Volume: 0.49 GB | Runtime: 0.19 sInstr: 928 MCPI: 0.77Mem. Data Volume: 0.39 GB | Runtime: 0.24 sInstr: 1.308 MCPI: 0.72Mem. Data Volume: 0.46 GB |
64 K | Runtime: 0.32 sInstr: 584 MCPI: 2.143Mem. Data Volume: 0.48 GB | Runtime: 0.24 sInstr: 1.064 MCPI: 0.90Mem. Data Volume: 0.25 GB | Runtime: 0.31Instr: 1.504CPI: 0.82Mem. Data Volume: 0.26 GB |
256 K | Runtime: 0.43 sInstr: 646 MCPI: 2.59Mem. Data Volume: 0.36 GB | Runtime: 0.39 sInstr: 1.199 MCPI: 1.28Mem. Data Volume: 0.32 GB | Runtime: 0.47 sInstr: 1.698 MCPI: 1.09Mem. Data Volume: 0.36 GB |
1 M | Runtime: 0.56 sInstr: 727 MCPI: 3.05Mem. Data Volume: 0.67 GB | Runtime: 0.59 sInstr: 1.333 MCPI: 1.72Mem. Data Volume: 0.59 GB | Runtime: 0.70 sInstr: 1.891 MCPI: 1.42Mem. Data Volume: 0.68 GB |
4 M | Runtime: 1.127 sInstr: 798 MCPI: 4.65Mem. Data Volume: 9.94 GB | Runtime: 1.48 sInstr: 1.467 MCPI: 3.1Mem. Data Volume: 3.75 GB | Runtime: 1.59 sInstr: 2.084 MCPI: 2.45Mem. Data Volume: 3.9 GB |
16 M | Runtime: 1.65 sInstr: 870 MCPI: 6.26Mem. Data Volume: 18.48 GB | Runtime: 2.75 sInstr: 1.601CPI: 4.16Mem. Data Volume: 6.95 GB | Runtime: 2.90 sInstr: 2.277 MCPI: 3.18Mem. Data Volume: 7.05 GB |
课外阅读
快排代码
代码在这里 https://github.com/ibogosavljevic/johnysswlab/blob/master/2022-01-sort/
感觉值得展开讲讲。我找作者要了授权,后面还会继续介绍这个
有句讲句 from_chars接口有点难用
可以用结构化绑定,更好看一点
c++26可以直接这么用
没有std::chrono::parse?
有点意思
cppcon最近更新了几个重量级的工具类视频,重构,分析,我准备本地复现一下,目前就不总结了,单独发