Yejun Su

May 15, 2022

Improve performance with functional thinking

There were several server downtimes on May 4th and 5th, my collegues found IOPS burst in database when school clicking the Pending Emails button, which will show the incoming emails one by one for school users to match them with specific students. As the requests are very slow to response, the users keep clicking the button again and a...
Read more

April 16, 2022

Improve performance with scientist gem

“This article is a tour of 使用scientist安全地改进代码.” Schools with large amounts of families complain that when visiting the Families roster, the request is too slow to use and even times out. This is a tour about how we made a performance boost while keeping the functionality work as normal. Bottleneck As the problem is repeatable, the bott...
Read more

March 31, 2022

使用scientist安全地改进代码

Photo by Alex Kondratiev of Unsplash 最近项目中的一个功能有性能问题,改进方案很简单,就是用缓存代替实时计算,但是缓存需要及时更新,不能返回错误的结果。这个过程需要用生产环境的数据来检验,但是又不能破坏现有的功能,正巧前几天读了 Changing Critical Code Paths With Scientist,发现文中提到的 scientist 就是解决这个问题的。 scientist 项目的描述是: “🔬 A Ruby library for carefully refactoring critical paths. ” 这个项目的命名很形象,我们开发者就好比是科学家(scientist),要改进现有的方案,一个稳妥地方法...
Read more

March 30, 2022

3月30日

最近两天根据一个C罗的视频做了几组练习,每组10-15分钟,似乎有点效果,体重下降了一丁点,也可能是没吃夜宵的缘故,还需要再观察观察,坚持一个月锻炼+不吃零食夜宵看看能减几斤。 读了Grokking Simplicity的前三章,这本书光看书名还真不知道原来是讲函数式编程的。书中介绍了一些概念,即使不是函数式编程,也能受用,例如: • 把代码根据稳定性分为三类:Actions, Calculations和Data:• Actions: 带副作用的函数,不同时间不同次数调用会产生不同的结果,比如发邮件; • Calculations:不带副作用的函数,也称为纯函数,输入不变输出就不变,比如计算一个购物清单; • Data:不可变的数据,见形知意,易于传输,比如邮件地址...
Read more

March 26, 2022

3月26日

早上我还在睡梦中,隐隐约约听见阵阵敲门声,我挣扎着从床上爬起来去开门,原来是邻居来通知十点半开始进行核酸检测,我一看时间已经九点多了。 吃了早餐后眼看还有时间,我打开Instapaper,为最近关注的主题创建了文件夹,文件夹名称对应到Roam Research的页面。这样在用Readwise同步笔记后,这些文章就会出现在相应的页面。 最近两周我开始把Roam Research当作主力笔记软件,记录学习笔记、整理思路,用得很顺手。很多人说Roam是web应用,网络不太可靠,以我的经验来看,Roam在本地有缓存,笔记改动后会及时同步到云端,如果网络暂时不可用,只要不关闭页面,本地所做的改动也不会丢失。如果用Google Chrome或Firefox,它还可以定时创建备份...
Read more

March 8, 2022

Manage multiple runtime versions with asdf

“Today I introduced asdf in our team, published here as a backup.” To manage various runtime versions, almost all languages has their own version managers, for example, here is a short list: • Ruby: rvm and rbenv • Python: pyenv and virtualenv • NodeJS: nvm • Erlang: kerl • Elixir: kiex • Go: gvm and goenv If you are using multiple run...
Read more

January 28, 2022

新年小目标:多读几本书

我看书第一遍基本都是从头读到尾,看了这个视频受到了一些启发,分享一下。 1. 追随自己的好奇心 不一定非要把书的每一页都读过,如果内容已经满足了自己的好奇心,就算读完了。 2. 略过一些内容 有些书用很大的篇幅只为表达一个观点,如果已经理解了这个观点,可以略过,读后面的内容。 3. 保持辩证思维 如果觉得一个观点很有意思,就找几本类似的书读一下,看看会不会有不同的解读。 4. 检验自己有没有理解 用自己的语言把读到的内容说给孩子、朋友听,或者写一篇博客、做一个视频。 顺便说一句:我用Mailbrew做了一个Elixir的邮件列表,主要订阅的是官方的博客和一些大V的推,可以看看之前的几期,最近改成了每两天推送一次,对Elixir感兴趣的同学欢迎订阅,提供宝贵意见🙏 -...
Read more

September 1, 2021

Workflows in my daily work

This is the last weekly sharing at my company. I mainly talked about how I handle Jira tickets. Principles 1. Focus on one thing at a time 2. Avoid start from scratch 3. Don't repeat yourself Focus on one thing at a time Notion and Workona are the cornerstones in my workflows. Every time I'm going to process a Jira ticket, I save it to...
Read more

August 23, 2021

Thoughts on note-taking apps

Today I tidy up my digital things into three apps: Notion, Roam Research and Obsidian. In my opinion, they are not mutually exclusive as they have their own focuses: • Notion: write and publish, focus on sharing and coordinating. • Roam Research: my second brain, focus on summarizing and thinking. • Obsidian: save code snippets, focus ...
Read more