摘要: ECS 发展到现在,虽然已经有了十多个年头,但还是没有集大成的教材出现。于是在网络上学习,过程中看众人叽喳,多有困惑。 现在总结下来,我看过的东西里有三篇文章,看透它们,就可以理解 ECS 的想法了。接下来需要一些实践,想想一些以前用传统 OOP 的解法,需要怎样的小修改。 Specs & Legi 阅读全文
posted @ 2021-02-14 14:23 seideun 阅读(146) 评论(0) 推荐(0)
摘要: I found an article that discusses the issue more thoroughly than me. So I’ll make this writing a summary of his. Enumeration components, or polymorphi 阅读全文
posted @ 2021-02-14 14:17 seideun 阅读(149) 评论(0) 推荐(0)
摘要: 首发于知乎:https://www.zhihu.com/question/364980266/answer/1687038599 啊? Rust 的哲学不是「严格限制」,而是 Be explicit。这两者还是有一些细微差别的。 Rust 那么大的 unsafe 和那么大的 memory leak 阅读全文
posted @ 2021-01-20 04:33 seideun 阅读(489) 评论(0) 推荐(0)
摘要: This is a rather big question and I've seen quite a few fragmented discussions about it. This day (11/5/20) I read an article stating: Human mindsets 阅读全文
posted @ 2020-11-05 17:59 seideun 阅读(54) 评论(0) 推荐(0)
摘要: Allocators are discouraged to be stateful. If we want to implement a memory pool or an object pool, we may separate the pool itself from the allocator 阅读全文
posted @ 2020-11-05 17:04 seideun 阅读(58) 评论(0) 推荐(0)
摘要: 我刚才看了两篇博客: 英文原版 CSDN 改编版 这两篇文章生动地展现了原博客和国内垃圾博客的区别。 当然,我是特指充斥泛滥的垃圾博客。国内有很多好的博客,比如陈硕大佬,叶劲峰大佬等,能学到很多东西。这两个大佬是我最早了解到的大佬,不代表我对他们博客质量的排名。 我文首举的国内这篇的例子,抄袭了原博 阅读全文
posted @ 2020-10-07 21:50 seideun 阅读(179) 评论(0) 推荐(0)
摘要: 在网上搜索这个题目,几乎全是那个用贪心做的版本…… 这题用的是 dp。重点在降复杂度的思维上:用一个 w[i][j] 数组记录完全覆盖区间 i..=j 的最小花销。不过这个定义是不严谨的,因为如果 w[1][3] != kInf 并且 w[4][5] != kInf,w[1][5] 还是可能等于 k 阅读全文
posted @ 2020-10-05 10:16 seideun 阅读(180) 评论(0) 推荐(0)
摘要: A comment on The Design Philosophy of the DARPA Internet Protocols (hereafter referred to as DP) and End-to-End Arguments in System Design (hereafter 阅读全文
posted @ 2020-09-22 23:45 seideun 阅读(131) 评论(0) 推荐(0)
摘要: Object Pool 上一篇文章里写了一个内存池。我随后意识到一个问题:为什么我没有给内存池加上类型参数呢?一个内存池可以知晓它所分配的对象的类型,就像 std::allocator 一样。 在重构的过程中,另一个问题浮现出来。如果有类型,那么内存池中的 caching 将被复杂化。原来,只有两种 阅读全文
posted @ 2020-09-06 02:05 seideun 阅读(247) 评论(0) 推荐(0)
摘要: Tags: optimization, memory, memory allocation, memory pool, object pool Why do I want to study memory allocation Virtually all programmers are obsesse 阅读全文
posted @ 2020-09-05 21:46 seideun 阅读(469) 评论(0) 推荐(0)