博客更新计划
该文档主要阐明后续的博客重点更新方向:
主题 | 进度 | 备注 |
---|---|---|
《二分》 | 规划中 | 二分查找、二分搜索,算法、理论与应用 |
《DFS、BFS》 | 编写中 | 总结DFS、BFS的通用思路,题解举例 |
《动态规划》 | 规划中 | 总结从递归到动态规划、题解 |
该文档主要阐明后续的博客重点更新方向:
主题 | 进度 | 备注 |
---|---|---|
《二分》 | 规划中 | 二分查找、二分搜索,算法、理论与应用 |
《DFS、BFS》 | 编写中 | 总结DFS、BFS的通用思路,题解举例 |
《动态规划》 | 规划中 | 总结从递归到动态规划、题解 |
Reference
This site is built by Vuepress, Vuepress GitHub
A basic tutorial: zero-to-deploy-build-a-documentation-system-with-vue-and-vuepress
Zon of Python By Tim Peters
translated by weigao chen
缓存(Cache)是计算机体系结构中用于加速内存访问的重要组件。本文系统地研究了缓存的基本概念、局部性原理、缓存映射方式、替换策略、缓存未命中处理方法及多处理器环境下的缓存一致性协议。通过分析不同缓存策略对系统性能的影响,我们探讨了如何优化缓存设计,以提高数据访问效率,降低缓存未命中率(Miss Rate),从而提升整体计算机系统的性能。
随着计算机硬件技术的快速发展,处理器(CPU)性能不断提升,但主存(DRAM)访问速度的进步相对较慢,导致“存储墙”问题(Memory Wall)。为了弥补 CPU 和内存之间的速度差异,现代计算机体系结构采用了分层存储结构(Memory Hierarchy),其中缓存(Cache)作为高速缓存存储器,减少了 CPU 直接访问主存的次数,提高了数据访问速度。
CPU 程序员的挑战不只是在 GPU 上获得出色的性能,还有协调系统处理器与 GPU 上的计算调度,以及系统存储器与 GPU 存储器之间的数据传输。
GPU 中的并行:多线程、MIMD、SIMD 和指令级并行。
NVIDIA 将 CUDA 编程定义为 SIMT -- 单指令多线程。
并行执行和线程管理由 GPU 硬件负责,而不是由应用程序或者操作系统完成。详解见 Q1
几种引用类型:
引用类型 | 功能特点 |
---|---|
强引用(Strong Reference) | 被强引用关联的对象永远不会被垃圾收集器回收掉 |
软引用(Soft Reference) | 软引用关联的对象,只有当系统将要发生内存溢出时,才会去回收软引用的对象 |
弱引用(Weak Reference) | 只被弱引用关联的对象,只要发生垃圾收集事件,就会被回收 |
虚引用(Phantom Reference) | 被虚引用关联的对象的唯一作用是能在这个对象被回收时收到一个系统通知 |
JVM 的软件架构如下:
JAVA 内存布局如下图所示:
通过对典型应用的 JVM 内存进行拆解,如下:
Total: reserved=15538605KB, committed=14221757KB
Java Heap (reserved=9601024KB, committed=9601024KB)
Class (reserved=2095827KB, committed=1215827KB)
Metadata (reserved=995328KB, committed=993536KB)
## 每个类的元数据:类名、方法、字段描述
Class space (reserved=1048576KB, committed=170368KB)
## 为类加载器存储的数据预留的空间
Thread (reserved=43505KB, committed=10101KB)
## 包括线程栈和线程本地存储
stack (reserved=43505KB, committed=10101KB)
## 对每个线程分配的栈空间,大小可通过 -Xss 配置
Code (reserved=977086KB, committed=573642KB) # 为 JIT 编译器预留的内存
GC (reserved=495136KB, committed=495136KB) # 为 GC 预留的内存
Compiler (reserved=734KB, committed=734KB)
Internal (reserved=20654KB, committed=20654KB) #JVM 内部使用的内存,依赖于 JVM 的实现
Other (reserved=733088KB, committed=733088KB)
## Native Memory Tracking, Arena Chunk, Logging,
## Arguments, Module,Synchronizer, Safepoint, Wisp, null
JAVA 字符串操作的优化。
Java Char Array | ||
---|---|---|
Head | Mark Word | 4 Bytes |
Class Pointer | 4 Bytes | |
Length of Array | Offset = 8 | |
Instance Data | Data of Array | |
Padding |
On the Advantages and Disadvantages of Marketing Strategy from the Perspective of Enterprise Development
With the rapid development of Internet economy, the marketing amount of enterprises has changed greatly. Over the past decade or so, we have witnessed many micro-enterprises achieve business success through excellent marketing strategies, and many enterprises have been abandoned by the times because of improper marketing. This paper selects several typical enterprises and their landmark marketing strategies to explain how marketing strategies become the key to enterprise success.