Pragmatic Engineer

Why performant code matters (but gets widely ignored), with Casey Muratori

2026-08-26 ·

In this Pragmatic Engineer episode, Casey Muratori discusses why performance-oriented programming is often ignored despite its importance, drawing on his decades of game development experience and work on DirectX. He argues developers should understand hardware costs, CPU timings, and lower-level details like assembly enough to reason about performance, rather than accepting slow abstractions, bloated architectures, and dependencies. The conversation also touches on software craft, games, and the uncertain impact of AI coding agents.

本期 Pragmatic Engineer 嘉宾是资深游戏开发者、性能与软件工艺倡导者 Casey Muratori,主题是为什么 performance 重要的代码常被忽视。Muratori 结合自己数十年游戏开发和 DirectX 经历,指出许多开发者缺乏对 hardware、CPU timings、assembly 和数量级成本的直觉,容易接受低效 abstraction、microservices 和 dependency 带来的性能损耗。他认为优秀工程师应理解程序实际需要计算机做什么,并通过 napkin math 和底层知识判断性能瓶颈,而不是只追逐流行技术。对话还涉及 games、live-service 对性能与响应速度的要求,以及 AI coding agents 对软件开发和工程师 burnout 的未知影响。

00:00
00:00
Why do most devs not care about writing performance software? And should we?
为什么大多数 devs 不关心写 performance software?我们该关心吗?
00:04
Today's guest, Casey Moritori, spent the last decade arguing that we should.
今天的嘉宾 Casey Moritori,过去十年一直在主张我们应该这样做。
00:08
He also says that most software out there runs 10 to 100 times slower than it needs to.
他还说,市面上大多数软件运行起来比实际需要的速度慢 10 到 100 倍。
00:12
Today we discuss why the focus on performance took a backseat across the industry
今天我们来讨论为什么整个行业对 performance 的关注退居二线
00:16
and why Casey thinks the tide is finally turning.
以及为什么 Casey 认为潮流终于要转变了。
00:19
Why you'll want to learn reading assembly if you're serious about high performance code
如果你认真对待 high performance code,为什么你会想学读 assembly
00:22
and why it's less scared than it sounds.
以及为什么它听起来吓人,但实际上没那么吓人。
00:24
The saying, premature optimization is the root of all evil.
那句名言:premature optimization is the root of all evil.
00:27
Why Casey says that the majority of people use it to avoid thinking about performance
为什么Casey说大多数人用它是为了不去思考performance,而他们其实应该思考performance。还有很多。
00:31
when they really should. And many more.
如果你想更好地编写更快的软件,并在这个过程中成为更好的工程师,那么这一集就是为你准备的。
00:33
If you want to get better at writing faster software and become a better engineer while doing so,
而如果你是那些在Ryan的帖子上点赞的人之一,想让这一集多讲一些programming而不是AI,那么这一集也是为你准备的。
00:38
then this episode is for you.
本集由Antiscus呈现。
00:39
And if you're one of the people who hit a like on this post by Ryan asking for this episode to be
如果你和agents一起工作,你的工作就不再只是写代码,
00:43
more about programming than about AI, this episode is also for you.
这一集更多讲的是programming,而不是AI,所以也适合你。
00:46
This episode was presented by Antiscus.
本集由Antiscus呈现。
00:48
If you work with agents, your job is no longer just writing code,
如果你和agents一起工作,你的工作就不再只是写代码,
00:51
it's also specifying and testing it.
它同时也在定义和测试它。
00:53
And Antiscus is the most effective method of verifying agentic code today.
而Antiscus是当今验证agentic code最有效的方法。
00:57
This episode is brought to you by Sentry.
本期节目由Sentry赞助播出。
00:59
You probably already know what Sentry is because you are a developer.
你可能已经知道Sentry是什么了,因为你是个开发者。
01:01
If not, just ask a dev and they'll tell you.
如果不知道,随便问个开发者,他们就会告诉你。
01:03
I use Sentry to monitor the back end of the pragmatic engine for any and all events and errors.
我用Sentry来监控Pragmatic Engine的back end,以便捕获任何和所有的events和errors。
01:08
Of course, Sentry doesn't only do errors.
当然,Sentry不仅仅处理errors。
01:09
They also have logs to replace spans, profiles, metrics, and more,
他们还有logs来替代spans、profiles、metrics等等,
01:13
because they're all connected to the same trace.
因为它们都连接到了同一条 trace。
01:15
One new capability Sentry has I'm really liking is its ability to fix errors.
Sentry 有一个我非常喜欢的新功能,就是它修复错误的能力。
01:19
Let me show you.
我来演示一下。
01:19
Here's a list of errors on my admin back end.
这是我 admin 后端上的错误列表。
01:22
There's a recent error on auth that I wanted to check out.
auth 上有一个最近的错误,我想看一下。
01:24
Let's have Sierra run an autofix for us.
让 Sierra 帮我们跑一次 autofix。
01:27
Sierra is Sentry's AID bugging tool.
Sierra 是 Sentry 的 AID bugging 工具。
01:29
First, it generates a root cause analysis.
首先,它会生成一个 root cause analysis。
01:31
It's finding some problem with HTTP versus HTTPS URLs.
它发现 HTTP 与 HTTPS URLs 之间存在一些问题。
01:35
Cool.
不错。
01:36
Now that we know what's going wrong,
现在我们知道问题出在哪里了,
01:38
Sierra can create a plan on how to go about fixing it.
Sierra 可以制定一个计划来着手修复它。
01:40
I could go and edit this plan, but I'm happy with it,
我可以去编辑这个计划,但我觉得它挺好的,
01:43
so let's create the actual code fix.
所以我们来创建实际的 code fix。
01:45
Here's the code fix that Sierra generated.
这是 Sierra 生成的 code fix。
01:47
Assuming it looks good, and in my case, it does,
假设它看起来不错,而在我看来也确实如此,
01:50
let's draft the pull request.
我们来起草 pull request 吧。
01:52
And boom, the PR is created, ready to merge.
然后 boom,PR 就创建好了,可以直接 merge。
01:54
What I love about autofix is how sentry went
我喜欢 autofix 的地方是,Sentry 从
01:56
from showing a list of errors inside my application
展示我应用里的错误列表,
01:59
to offering me a fast way to fix it and close the loop
到提供一种快速修复并 close the loop 的方式,
02:02
while I stay in charge of this bug fix the whole time.
而整个过程中我都掌控着这个 bug fix。
02:05
Debugging it a whole lot faster and a whole lot easier.
debug 它会快很多,也轻松很多。
02:07
Check out Sentry at Sentry.io slash pragmatic
到 Sentry.io/pragmatic 看看 Sentry 吧。
02:10
and start detecting errors,
然后开始检测 errors,
02:11
diagnosing your root causes,
诊断你的 root causes,
02:12
and fixing issues and regressions today.
并且今天就修复 issues 和 regressions。
02:15
All right, Casey, welcome to the podcast.
好的,Casey,欢迎来到播客。
02:17
It's so nice to have you here.
很高兴你能来。
02:19
Thank you so much. It's great to be here.
非常感谢。能在这里真是太好了。
02:20
Thank you for the invitation.
谢谢你的邀请。
02:22
Now, I want to go back when we start to the beginning.
现在,我想回到最开始的时候。
02:25
How did you get into tech programming computers?
你是怎么进入 tech 行业,开始 programming computers 的?
02:28
Well, I guess computers, it's like very, very early on.
嗯,我觉得 computers 吧,是很早很早以前的事了。
02:32
My dad was a programmer at Digital Equipment Corporation,
我爸是 Digital Equipment Corporation 的 programmer,
02:36
which is a company that people will know
就是一家如果你学过 computer history 就会知道的公司,
02:38
if they studied computer history,
但如果你只看今天的行业格局,就不会知道。
02:39
but would not know if you just looked at the landscape today.
他们已经完全消失了,对吧?
02:42
They're completely gone, right?
他们一部分被 Intel 吸收,一部分被 ComPAC 吸收。
02:44
They got absorbed partly by Intel, partly by ComPAC,
他们一部分被Intel吸收,一部分被ComPAC吸收,
02:47
I think there was, you know, they kind of got broken up.
我觉得有,你知道,他们算是被拆分了。
02:51
At that time, it was kind of a really big computer manufacturer.
当时,它算是一个非常大的电脑制造商。
02:55
You know, computers like the PDP 11.
你知道,像PDP 11那样的电脑。
02:57
That's a Digital Equipment Corporation computer.
那是Digital Equipment Corporation的电脑。
02:59
The Vax, like things that you may have heard of in computers.
Vax,就像你可能在电脑领域听说过的那种东西。
03:02
Oh, these were these massive mainframes.
哦,这些是那种巨大的mainframes。
03:05
Yeah, many computers as well.
对,也有很多电脑。
03:07
So like smaller, also sometimes in mainframes,
所以像更小型的,有时候也是mainframes。
03:09
like the kind of next step down, right?
有点像再往下一步的那种,对吧?
03:11
And so in general, that era,
所以总的来说,那个时代,
03:14
my dad was a programmer there.
我爸爸在那里做程序员。
03:16
He would later end up at Intel because,
他后来去了Intel,因为,
03:18
you know, like I said, parts got acquired.
你知道,就像我说的,部分业务被收购了。
03:19
He never actually left his job.
他其实从来没换过工作。
03:20
He just ended up at Intel through kind of digital's eventual demise.
他只是随着Digital最终的衰败,最后到了Intel。
03:24
But as a result,
但结果就是,
03:26
we always had computers at home,
我们家一直都有电脑,
03:28
even though at that time, you know,
尽管在那个时候,你知道,
03:31
that might have been a little bit odd.
那可能有点奇怪。
03:34
You know, I learned a program when I was seven,
你知道吗,我七岁的时候就学了一个程序,
03:37
which would have been like, you know, 1982 or something like that.
那大概是在,嗯,1982年左右吧。
03:42
And so at that time, you know,
所以在那个时候,你知道,
03:43
maybe you might have an Apple or Commodore kind of computer
可能你家里会有一台 Apple 或 Commodore 之类的电脑,
03:47
at home, like some kind of early computer.
就是那种早期的电脑。
03:50
I don't remember the exact dates of those computers.
我不记得那些电脑的确切日期了。
03:53
But most people didn't.
但大多数人都不记得。
03:54
And it was only until a little bit later that you would.
而且直到稍晚一点你才会那样。
03:56
And you probably wouldn't have had a programmer
而且你可能不会有程序员
03:58
in your household to teach you more importantly, right?
在你家里教你,更重要的是,对吧?
04:02
So I learned really early on.
所以我很早就学会了。
04:04
And that's when I got into computers.
那也是我开始接触电脑的时候。
04:06
How I got into games was I ended up randomly
我进入游戏圈的方式是,我最后偶然
04:09
entering at Microsoft.
进入微软的时候。
04:10
And I met people there.
我在那里认识了一些人。
04:11
And like I went and you know,
然后我就,你懂的,
04:13
sort of went off into games through them.
通过他们算是转到了游戏那边。
04:15
That was that was how that happened.
就是这样,事情就是这么发生的。
04:16
If that makes sense.
如果这说得通的话。
04:17
But wait, how is the Microsoft slash games relationship?
但等等,Microsoft 和游戏之间是什么关系?
04:20
That's not kind of a given, right?
这可不是理所当然的吧?
04:22
Microsoft as well.
Microsoft 也是。
04:24
They have one game, right?
他们有一款游戏,对吧?
04:25
A flight simulator.
一款 Flight Simulator。
04:27
Yes, at that time, it would have been very weird.
是的,在当时,那会非常奇怪。
04:30
The reason that happened was a guy called Chris Hacker,
之所以会这样,是因为一个叫 Chris Hacker 的人,
04:33
who a lot of people don't really know his history
而很多人其实不太了解他的过往。
04:37
because there was sort of two waves
因为把游戏带到 Microsoft Windows
04:40
of bringing games to Microsoft Windows.
大概分了两波。
04:43
Because I mean, now it's it's funny to think about now
因为我是说,现在想想这事儿还真挺有意思的。
04:45
because people think of like,
因为大家就会想,比如说,
04:46
what platform are you going to play games on if you have a PC?
如果你有一台 PC,你打算在什么平台上玩游戏?
04:49
Windows is like the default.
Windows 就像是默认的那个。
04:50
Linux is now an insurgent to that.
Linux 现在则是个挑战者。
04:53
But Windows is the default.
但 Windows 才是默认的。
04:54
And so you think about how did that happen?
于是你就会想,这到底是怎么发生的?
04:58
Because that wasn't the case if you were back in the early days,
因为要是你回到早期的时候,情况并不是这样的。
05:02
Microsoft Windows, not a gaming platform.
Microsoft Windows,不是一个游戏平台。
05:04
It's almost nothing on it.
上面几乎什么都没有。
05:05
It's like solitary and mind sweeper.
就像Solitaire和Minesweeper。
05:06
And a few other sort of games didn't happen.
还有其他一些类似的游戏也没能出现。
05:10
So what happened, the reason for this,
那么发生了什么,原因就是,
05:13
this kind of gets into a technological reason.
这就要说到技术原因了。
05:16
The reason for this is that it was very hard to actually produce images
原因在于,当时要真正生成图像
05:20
that could be displayed on the screen quickly.
并能快速显示在屏幕上,是非常困难的。
05:23
And to understand why this is is like its own kind of topic.
而要理解为什么,这本身就是个独立的话题。
05:26
But in general, you can just imagine,
但一般来说,你可以想象一下,
05:28
you have these this operating system running,
你有一个正在运行的 operating system,
05:31
which is Microsoft Windows.
也就是 Microsoft Windows。
05:33
It's controlling the graphics card.
它控制着 graphics card。
05:34
It's often running at a fairly high resolution
它通常以相当高的 resolution 运行,
05:38
compared to what a game might want to run at.
相比游戏可能想要的 resolution 来说。
05:40
You have to negotiate with it in order to display your bitmap.
你必须和它协商,才能显示你的 bitmap。
05:43
In some way that won't destroy all the things that it's trying to display.
以某种不会破坏它试图展示的所有内容的方式。
05:46
So and so forth.
等等等等。
05:48
Early versions of Windows,
早期版本的 Windows,
05:50
up through Windows for Workgroups, let's say,
一直到 Windows for Workgroups,比如说,
05:53
anyone remembers that name.
有人还记得那个名字吗?
05:55
Was that after 3.1?
那是在 3.1 之后吗?
05:56
It's 3.51, I think it's called.
我觉得它叫 3.51。
05:59
Or maybe just 3.1?
或者也许就是 3.1?
06:00
Yeah, there's NT3.51.
对,有 NT3.51。
06:02
No, so I think you're right, 3.1.
不是,所以我觉得你说得对,是 3.1。
06:03
3.1, I don't know, something like this.
3.1,我也不太确定,差不多这样。
06:05
Windows for Workgroups was around that time.
Windows for Workgroups 就是那个时期的东西。
06:09
That version of Windows,
那个版本的 Windows,
06:11
which is in the 3 series,
也就是 3 系列的那个,
06:12
didn't really have a way to quickly use the CPU to fill pixels,
确实没什么办法快速用 CPU 来填充像素,
06:17
which is what games need to do, right?
而游戏需要做的就是这件事,对吧?
06:19
There's no GPU acceleration really at this point.
目前真的没有GPU加速。
06:21
There's a little bit we could talk about,
我们其实可以聊一点,
06:23
but it's not mainstream, it's not in consumer.
但它不是主流,也没用在消费级产品上。
06:25
So they need to be able to do this sort of thing.
所以他们需要能够做到这种事情。
06:27
They need to be do it in a double-buffered way,
他们需要以double-buffered的方式来做这件事,
06:29
so they can draw to a back buffer and then show it to the screen.
这样他们就能绘制到back buffer,然后显示到屏幕上。
06:31
And that has to happen very quickly.
而且这必须非常快。
06:33
And there just wasn't a way to do this in Windows.
而在Windows里就是没有办法做到这一点。
06:35
In Windows, you had to kind of go through this API
在 Windows 上,你得走一遍这种 API,生成一个那种 bitmap,但它不一定符合你当前显示器的格式,然后显示的时候还得把那个 bitmap 转换成另一种格式,诸如此类的一堆事。所以像 Doom 这种游戏,它们是没法直接上 Windows 的吧?
06:37
where you would produce sort of a bitmap
在那里你会生成一种bitmap,
06:40
that wasn't necessarily in the right format
那种bitmap不一定格式正确,
06:42
for the display you were using,
对于你正在使用的显示器来说,
06:43
and then it had to do a translation from that bitmap
然后还得从那个bitmap进行转换。
06:46
to the other one when it displayed it, all this sort of stuff.
当它显示出来的时候,显示到另一个上面,诸如此类的。
06:49
So games on Windows like things like Doom,
所以 Windows 上的游戏,比如 Doom 之类的,
06:51
they're not coming to Windows, right?
它们不会出现在 Windows 上,对吧?
06:53
That kind of future was not in the works for Windows.
那种未来并不是Windows计划中的一部分。
06:57
And that was kind of what some people in Microsoft wanted to change.
而这正是微软内部一些人想要改变的。
07:00
And one of the people who brought this change about
而推动这一改变的人之一
07:02
was a guy named Chris Hecker.
是一个叫Chris Hecker的家伙。
07:04
And he was like, okay,
然后他说,好吧,
07:07
we could actually just make a library
我们其实可以就做一个库
07:10
that did the fast blitz to the screen
专门用来快速blitz到屏幕
07:13
so that we could have a way that people could do these draws
这样我们就能有办法让人们做这些draws
07:16
and get them on the screen quick enough to make gaming viable.
并且让它们足够快地显示到屏幕上,让游戏能跑起来。
07:20
Would it be 100% as fast as DOS?
它会和 DOS 一样快吗?100% 一样快?
07:22
Probably not, but could you actually run some of these new games?
可能不会,但你确实能跑一些这些新游戏吗?
07:27
You know, Wolfenstein 3D, I think,
你知道,我觉得是《Wolfenstein 3D》,
07:28
would have been out at this time.
那时候应该已经出了。
07:30
Doom was kind of on the horizon and that sort of thing, right?
《Doom》差不多也快了,诸如此类,对吧?
07:32
And so he started this project that he was not supposed to do.
于是他开始了一个他本不该做的项目。
07:35
He did not have the authority to do this called WinG,
他并没有权限做这个叫 WinG 的东西。
07:39
which at least never like win graphics or something like that.
至少从来没在 graphics 上赢过之类的。
07:43
Total Skunk Works project, he had cover from his manager.
完全是 Skunk Works 项目,他经理给他打掩护。
07:46
I'm assuming I can say all this stuff now because it's ancient history.
我觉得现在可以说这些了,因为都是老黄历了。
07:49
He had cover from his manager's name,
他经理给他打掩护,名字是,
07:50
guy's name was Michael Edwards.
那哥们儿叫 Michael Edwards。
07:52
And Michael Edwards basically just kind of ran cover for this,
Michael Edwards 基本上就是在给这事儿打掩护。
07:55
which is a thing that probably wasn't going to fly
这事儿大概根本成不了,
07:57
because they were in a division at that time,
因为他们当时在一个部门里。
08:00
which would have been Microsoft Research today.
这放到今天就是 Microsoft Research 了。
08:02
Kind of it was called AT Advanced Technology.
差不多叫 AT Advanced Technology。
08:04
It was the early version of Microsoft Research.
它就是 Microsoft Research 的早期版本。
08:06
You were not supposed to be shipping core libraries for Windows,
你本来不应该去给 Windows 发布 core libraries 的,
08:10
like it had nothing to do with that long story long.
跟那个长长的故事完全没关系。
08:13
What ended up happening is that product did ship WinG,
结果呢,这个产品确实发布了,叫 WinG,
08:17
I guess you wouldn't call it a product.
我猜你不会叫它产品。
08:18
It's an add-on for Windows.
它是 Windows 的一个 add-on。
08:19
It did ship and it was the first step towards DirectX.
它确实发布了,那是迈向DirectX的第一步。
08:24
People forget that.
人们都忘了这点。
08:25
WinG was the first way you did this.
WinG是做这件事的第一种方式。
08:27
And then eventually we had DirectX and Dib sections in Win95
然后最终我们在Win95里有了DirectX和Dib sections。
08:31
and all that sort of stuff.
诸如此类的那些东西。
08:32
When I went to Microsoft, I'm using Lee.
我去微软的时候,用的是Lee这个名字。
08:34
The person I was supposed to be reporting to as an intern
我实习时本该向其汇报的那个人
08:38
was Michael Edwards.
是Michael Edwards。
08:40
When I showed up, first day, along with the other interns,
我第一天到的时候,和其他实习生一起,
08:44
guy named Rudy, guy named Rajiv,
一个叫Rudy,一个叫Rajiv,
08:46
we were all supposed to report to him
我们都要向他报到,
08:48
because you get a couple interns under one, you know,
因为你知道的,一个经理下面会带几个实习生,
08:51
for the manager.
就是给这个经理配的。
08:52
We show up and we're just taken aside,
我们到了之后就被拉到一边,
08:54
you know, after some kind of stupid HR orientation thing
你知道,是在那种很蠢的HR入职培训之后,
08:59
that was, you know, lame as it always is.
那玩意儿你知道的,还是老样子无聊。
09:01
And we get taken aside by somebody, I don't remember the district,
然后有人把我们拉到一边,我不记得是哪个区了,他们说,听着,有点问题。你面试时见的那个人,本来你该向他汇报的,他不在这儿。具体怎么说的我也不太记得了。反正你得去找另一个人,他们会给你找点事做。结果发现 WinG 那事上周就炸了。
09:04
they're like, look, bit of a problem.
他们就说,你看,有点问题。
09:07
The person you interviewed with and were supposed to like report to,
你面试过并且本来应该向其汇报的那个人,
09:11
they aren't here.
那个人不在这里。
09:13
Like, I don't remember exactly how they put it.
就是说,我不太记得对方具体怎么说的了。
09:15
So you're going to go talk to this other guy
所以你要去找另一个人谈。
09:17
and they'll find something for you to do.
然后他们会给你找点事做。
09:19
Turns out the WinG thing had blown up the previous week
原来WinG那事上周就闹大了。
09:23
and Mike Edwards had stormed out of the building
然后Mike Edwards愤然冲出了大楼,
09:26
and had not been seen since.
之后就一直没人再见到他。
09:28
That is what actually happened.
这就是实际发生的情况。
09:30
So that's, I arrive at Microsoft,
所以,就这样,我到了微软,
09:32
the person I was just interned with,
那个刚刚和我一起实习的人,
09:34
he just flamed out and left.
他就那样爆发了一通,然后走了。
09:36
No one knows when he'll be back.
没人知道他什么时候会回来。
09:37
He didn't end up coming back like a week after I got there,
我到了那儿大约一周后,他还是没回来。
09:40
but he was kind of moved over to a different dimension.
但他算是被调到了另一个领域。
09:43
Like, you know, there was a bunch of like triars
就像,你知道,有一堆类似 triars 的人在那儿干活,把它搞起来了。
09:44
worked on there to throw it going on.
所以那就是我的经历。
09:46
So that was my experience.
但总而言之,我当时基本上就在 Windows 游戏的核心地带。
09:48
But suffice to say, it meant that I was right
所以我遇到了 Chris Hecker。
09:50
in sort of like ground zero of games on Windows.
我在那儿和很多人聊过。
09:53
So I met Chris Hecker.
所以我见到了Chris Hecker。
09:54
I got to talk to a bunch of people there.
我在那儿跟不少人聊了聊。
09:55
He actually took me out to see one of my childhood heroes,
他其实带我出去见了我童年时的一位英雄人物,
09:58
Ron Gilbert, who is the guy who did the entry to the engine.
Ron Gilbert,就是那个做了引擎入口的家伙。
10:02
Yeah.
对。
10:02
He knew all these guys because working on WinG
他认识这些人,因为他在做 WinG 的时候
10:04
he had gone out to see a bunch of game developers
他出去见了一大堆游戏开发者,
10:07
and like work with them on this sort of thing.
然后和他们一起做这种事。
10:09
So I got to go to humongous entertainment,
所以我得以去了 humongous entertainment,
10:11
which was Ron's new company.
那是 Ron 的新公司。
10:13
He gave me a secret of monkey island mouse mouse pad,
他给了我一个 The Secret of Monkey Island 的鼠标垫,
10:18
I remember.
我记得。
10:18
So anyway, it was, it was really cool.
总之,那真的很酷。
10:20
And that's how I ended up getting the game industry
我就是这样进入游戏行业的,
10:22
was was through Chris Hecker.
是通过 Chris Hecker。
10:23
And he's kind of an unsung hero of getting games on Windows
他算是让游戏在 Windows 上运行的幕后英雄,
10:26
because, you know, he just, he wasn't out there
因为,你知道,他就是没有站出来
10:29
making his story known, but, but, you know, I am now, I guess.
讲自己的故事,
10:32
It's so interesting to hear these stories.
听这些故事真有意思。
10:34
Obviously now you can share it.
显然现在你可以分享了。
10:36
I'm sure, you know, like for a while,
我敢肯定,你知道,有一阵子,
10:37
this would have been like only within the inner circle.
这事大概只限于核心圈子内部。
10:41
But the fact that, you know, of course,
但事实上,你知道,当然,
10:43
DirectX was a huge success.
DirectX 是个巨大的成功。
10:45
And it did like as far as, you know,
而且它确实,就像,你知道,
10:48
from my vantage point, huge reason why games
从我的角度来看,是游戏……的巨大原因。
10:50
were big on Windows.
他们当时很看好Windows。
10:50
But now he hears someone who just ignored,
但现在他听到有一个人,完全无视别人,
10:53
wasn't asking anything, just was doing something,
什么都不问,只是自己埋头做,
10:56
got into conflict fights and just like pushed an idea.
跟人冲突吵架,然后就这么把一个想法推了出去。
11:00
It's more than you think because there were three people
这比你想的还厉害,因为有三个人
11:03
who really were the core people who pushed DirectX,
真正推动DirectX的核心人物,
11:07
meaning institutionally pushed it.
也就是从制度层面去推。
11:09
There are tons of programmers like Todd Laney
像Todd Laney这样的程序员多得是。
11:11
who did, you know, really important core work.
他做了,你懂的,非常重要的核心工作。
11:13
It never would have shipped without people like him.
没有像他这样的人,它根本发布不了。
11:16
So not on the progress I'm talking about institutional side.
所以不是指进展,我说的是组织层面。
11:18
It's Eisler, Angstrom and Alex St. John.
就是 Eisler、Angstrom 和 Alex St. John。
11:22
I don't remember which one is either Eisler, Angstrom
我不记得是哪个了,Eisler 还是 Angstrom
11:25
was the tester on WinGee.
是 WinGee 的测试员。
11:28
So he came from that team.
所以他是从那个团队过来的。
11:30
So the start of DirectX,
所以 DirectX 的开端,
11:33
one of the core members of DirectX was on the WinGee team.
DirectX的核心成员之一曾在WinGee团队待过。
11:36
So it's a direct lineage.
所以这是直接的血统传承。
11:38
It's not even like an unrelated push.
甚至不像是那种毫无关联的推动。
11:40
So WinGee really was the start of it.
所以WinGee确实是它的起点。
11:42
And then DirectX was kind of the actual full blossoming
然后DirectX大概才是真正完全绽放的阶段,
11:46
into an org with Microsoft's blessing at that point.
当时在微软的支持下发展成了一个组织。
11:49
You know, that actually became powerful internally.
你知道吗,那在内部确实变得很有影响力。
11:52
And then after Microsoft Pinterest
然后在微软Pinterest之后……
11:54
have been getting exposed to all these folks,
一直在接触这些人,
11:56
you actually went and build games tooling.
你实际上去做 games tooling 了。
11:59
You then started your own studio as well, right?
然后你也创办了自己的工作室,对吧?
12:02
So like, how did that sequence?
所以,那个顺序是怎么回事?
12:04
I guess there's a couple of steps in there.
我想中间有好几步。
12:05
I worked at a startup with Chris Hecker
我和 Chris Hecker 在一家创业公司工作过
12:08
that didn't end up doing anything interesting.
最后没做出什么有趣的东西。
12:10
Then I went to a company called Gaspowered Games,
然后我去了一个叫 Gaspowered Games 的公司,
12:13
which was actually a Microsoft,
它实际上是微软的,
12:15
I guess they're not a Microsoft studio,
我猜他们不是微软的工作室,
12:16
but they're publishing deal with this Microsoft.
但跟微软有发行协议。
12:18
And they did a game called Dungeon Siege,
他们做了一款叫 Dungeon Siege 的游戏,
12:22
which is kind of a, you know, I don't know,
算是个,你懂的,我也不太知道,
12:24
it's not a particularly well-known title.
它不算特别有名的作品。
12:26
From there, I went to rad game tools
从那之后,我去了 rad game tools,
12:28
and that's where I stayed for quite some time.
然后我在那儿待了挺长时间。
12:30
I did their character animation system.
他们的 character animation system 是我做的。
12:32
That was a very popular product
那是一个非常受欢迎的产品。
12:34
that ended up getting used in lots, lots of games.
最终被很多很多游戏用上了。
12:36
It's still used to this day, much to my surprise
直到今天还在用,这让我很意外。
12:38
because that's a very, very, I haven't
因为那是一个非常非常——我
12:40
worked on it since 2004.
从2004年就没再做过它了。
12:43
But I guess other people had maintained it
但我想应该是别人在维护。
12:45
and some studios just kind of integrated into their,
而有些工作室就有点像是把它集成到了他们的……
12:47
you could get source licenses.
你可以拿到source licenses。
12:48
So I guess some studios just integrated it into their pipelines
所以我想有些工作室就是把它整合进了他们的pipeline里,
12:51
that have never removed it.
之后就没再移除过。
12:53
And they just maybe keep updating it
他们可能只是一直更新它,
12:55
to keep it working the way that they want.
让它按他们想要的方式运行。
12:58
So anyway, that's what I did there.
总之,我在那里做的就是这些。
13:00
And then afterwards, I've been independent since then,
在那之后,我就一直是独立状态,
13:02
I just have a company called Malay Rocket
我开了个公司叫Malay Rocket。
13:04
where we do various stuff.
我们在那儿做各种杂七杂八的事。
13:05
I've done, you know, contract work for people through that.
你知道,我通过那个接过一些外包活儿。
13:09
We now do like the sub-stack through that
我们现在通过那个做类似Substack的东西。
13:11
where we do educational materials.
就是做教育材料这块。
13:12
So I've kind of just done random stuff since then.
所以从那之后,我就随便做了一些零碎事。
13:16
Although I have done some work on games.
不过我也做过一些游戏相关的工作。
13:18
I noticed you're a checklist, you're talking about the witness.
我注意到你的清单了——你在说The Witness。
13:20
Obviously that one was an actual specific title that I worked on.
显然那是一个我实际参与过的具体作品。
13:24
But that was mostly just because it was a very big project.
但那主要是因为那是个非常大的项目。
13:27
And I was, you know, I'm friends with John
而且我当时,你知道,我和 John 是朋友,所以我就想在旁边写一些有用的代码。
13:29
so I was just trying to do some helpful programming on the side.
我写了一些关于 movement system 如何运作的代码。
13:32
I did some stuff on how the movement system worked.
我觉得那里有些有趣的问题,我们可以为游戏解决。
13:34
I thought there were some interesting problems
所以那是个非常有趣的项目。
13:35
that we could solve there for games.
是啊,然后你现在在做教育类的事情。
13:37
And so that was a really fun project to work on.
所以那真是个很好玩的项目。
13:40
Yeah, and then today you're doing educational stuff
是啊,然后现在你在做教育相关的事情。
13:43
on a bunch of programming performance on your sub-stack.
关于你 Substack 上的一堆 programming performance。
13:46
And what else are you busy with?
那你还在忙什么?
13:48
So we do actually have an unannounced project
其实我们确实有一个还没公布的项目,
13:50
that we've been working on.
我们一直在做的。
13:51
Uses up sort of the rest of the time that I have,
算是把我剩下的时间都用掉了,
13:55
if that makes sense, which is not always so much.
如果这说得通的话——其实也不总是那么多。
13:58
And that we will, we're hoping to announce it sometime soon.
而且我们——我们希望很快能公布它。
14:02
But it's not quite out yet.
但它还没完全出来呢。
14:04
Believe me, I will, you will hear me, I will send you
相信我,我会的,你会听到的,我会发给你
14:06
as soon as we have an actual announcement.
一旦我们真的有正式公告要发布。
14:08
But given the fact that it is kind of like a split time sort
但鉴于这有点像我们得把时间分开来处理的情况,
14:12
of thing for us because we're pretty focused on making sure
因为我们特别专注于确保
14:15
the sub-stack is good and all that sort of stuff,
Substack 那边做好,还有各种诸如此类的事,
14:17
we're trying to keep it fairly tight-lipped
所以我们尽量守口如瓶,
14:20
until we actually know we're mostly done
直到我们真正确定差不多完成了,
14:22
because we don't know how much time we can always devote
因为我们不知道随时能投入多少时间。
14:25
to it if that makes sense.
如果这说得通的话。
14:26
Yeah, no, it's a pretty typical games or really things, right?
对,不,这在游戏或者现实中都挺典型的,对吧?
14:31
Like tight-lipped until you have something for good reasons.
就像守口如瓶,直到你有了真正的东西,而且这很有道理。
14:34
Well, sometimes people play the other game.
好吧,有时候人们会反着来。
14:37
They go like, look, we're going to,
他们会说,听着,我们要,
14:39
day one, we're going to be very loud about this
从第一天起,我们就要非常高调地宣传这件事,
14:41
and try to build a community around the development of the game
并且试着围绕游戏开发建立一个社区,
14:44
and all that sort of stuff.
以及所有类似的东西。
14:45
And that's great.
这太好了。
14:47
So that's another route you can go.
所以那是你可以走的另一条路。
14:50
But if it's not your full-time thing,
但如果这不是你的全职工作,
14:51
if you have other responsibilities,
如果你有其他责任,
14:54
that doesn't seem great, right?
那看起来就不太妙,对吧?
14:55
Because you don't have any insight into how much time
因为你完全不清楚自己实际上
14:58
you will actually be able to devote to it, right?
能在这上面投入多少时间,对吧?
15:00
Yeah.
是啊。
15:01
And on sub-stack, it's called computer enhance
然后在 sub-stack 上,名字叫 computer enhance
15:04
and you started it with performance related topics.
而且你是从 performance 相关的话题开始的。
15:08
And that's how we started to talk,
我们就是这样开始聊起来的,
15:09
I think, about three years ago when you already had a sub-stack.
我想大概三年前吧,那时候你已经有 sub-stack 了。
15:12
And we had a direct message conversation.
我们还进行了一段 direct message 对话。
15:14
I remember you message me saying, hey, Gargay,
我记得你发消息跟我说,嘿,Gargay,
15:16
why do you think in the industry,
你觉得为什么在这个行业里,
15:20
people, software developers just don't really focus on performance?
大家,软件开发者就是不太关注 performance 呢?
15:24
I think you specifically wrote.
我觉得你专门写了这个。
15:26
I did.
对,我写了。
15:27
You were saying how there's little emphasis on performance.
你之前说,现在对 performance 的重视不够。
15:31
There's even though there seems to be overwhelming evidence
这种不够重视确实存在,尽管似乎有压倒性的证据
15:33
that performance is critical to the bottom line of most software.
表明 performance 对大多数软件的最终收益至关重要。
15:37
And I wanted to ask you, we've had a good back and forth on this.
我想问你的是,我们在这个问题上已经有过很好的来回讨论。
15:40
And actually, I think initially, I told you,
其实,我记得一开始就跟你说过,
15:41
like, oh, here's why you don't need to care about performance
就好像,“哦,这就是为什么你不需要在意 performance。”
15:43
when you're building.
当你在构建的时候。
15:44
I don't distribute the systems or, like,
我不会分发这些系统,或者说,
15:46
but since then, what have you learned?
但从那以后,你学到了什么?
15:48
Why do most developers don't care
为什么大多数开发者不关心,
15:50
or even most companies, teams,
甚至大多数公司、团队,
15:52
engineering teams not care about performance all that much?
工程团队都不怎么在意 performance?
15:54
It's a really good question.
这是个很好的问题。
15:55
And I think I do think your answer at the time,
而且我觉得,我当时确实认为你的回答是,
15:59
if I remember it correctly, is certainly an accurate one
如果我没记错的话,肯定是个准确的说法。
16:02
for some subset of industries, which, you know,
对于某些行业,你知道,
16:06
you said something along the lines of,
你当时大致是这么说的,
16:07
look, a lot of these pieces of software that you're seeing,
你看,你看到的很多这些 software,
16:10
the user isn't the purchaser, right?
用户不是购买者,对吧?
16:13
Like, you were like, this is some kind of thing
比如,你当时说,这就是那种情况,
16:16
where, you know, somebody very high up is going to look and say,
就是,你知道,某个高层的人会来看一眼然后说,
16:19
we need software for managing HR.
我们需要管理 HR 的 software。
16:21
They're going to look at the cost of the software.
他们会看 software 的成本。
16:23
They're going to look at the compliance terms of software,
他们会看 software 的 compliance 条款,
16:25
the legal liability, whatever, right?
legal liability 之类的,对吧?
16:27
And then they're just going to make a purchase decision on that sheet.
然后他们就直接根据那张表做购买决定了。
16:30
They're not in there looking to see whether it takes like,
他们不是去看它是不是,比如说,
16:33
you know, whether there's a 30-second pause every time
你知道,每次都有 30 秒的延迟,
16:36
you want to try and access somebody's record, right?
你去访问某人的记录的时候,对吧?
16:38
And I think that's very true.
我觉得确实如此。
16:40
Like, unfortunately, the situation
其实,不幸的是,很多enterprise software的情况
16:42
for a lot of enterprise software probably is that way.
可能就是这样。
16:44
So maybe an individual might well be upset
所以,也许某个人很可能会
16:48
about the performance of that software.
对那个software的performance感到不满。
16:50
And I certainly hear from people all the time
而且我确实总是听到人们
16:51
who are upset about the software that they use.
对自己用的software感到不满。
16:54
They might not be any position to change it.
他们可能没有什么办法去改变它。
16:56
I think that's one thing.
我觉得这是其中一点。
16:57
There's thing two, which is that in a lot of cases,
还有第二点,就是在很多情况下,
17:01
you simply have monopoly effects.
你就是有垄断效应。
17:04
You know, people aren't right now realistically
你知道,现在人们实际上不太会
17:08
going to challenge the social networks
去挑战那些社交网络,
17:10
that currently exist, for example.
目前存在的那些,比如说。
17:12
People have tried, it's very hard.
人们试过,非常难。
17:14
You know, Blue Sky and Threads have tried to assail X
你知道,Blue Sky 和 Threads 都试过攻击 X,
17:18
and, you know, you've got Facebook and Instagram and TikTok
然后,你知道,还有 Facebook、Instagram 和 TikTok。
17:22
and they kind of just own those spaces, right?
他们基本上就占领了那些领域,对吧?
17:25
And it's very hard to push into those
要打进这些领域非常难
17:27
because of these like network effects
因为像 network effects 这样的东西
17:29
and maybe performance could be part of a package
也许 performance 可以作为整体方案的一部分
17:34
where you try to take on one of those players.
用来尝试挑战那些玩家之一。
17:36
Like, hey, look at how much more responsive
比如,嘿,看看我们的东西
17:39
our thing is than theirs might be a nice plus,
比他们的响应速度快多少,这可能是个加分项,
17:42
but that's not going to be sufficient.
但光靠这个是不够的。
17:44
If you just show up with no plan for how you get adoption,
如果你只是冒出来,根本没有计划怎么获得采用,
17:46
no plan how you get big influences over there,
也没有计划怎么在那里获得大的影响力,
17:48
all that sort of stuff, it can't sell a product
所有这些事儿,光靠自己不可能把一个产品
17:51
on its own into a monopoly space, right?
卖进垄断市场的,对吧?
17:53
If you're just talking about apps
如果你只是谈 apps,
17:55
that someone can choose to download,
用户可以自己选择下载的那些 apps,
17:56
and maybe you've got a shot there,
那也许你还有点机会,
17:58
but those are just, they're forming a smaller
但这些只是,它们正在形成一个更小的
17:59
and smaller subset of what software is, right?
以及 software 中更小的 subset,对吧?
18:02
And this bigger and bigger subset
而这个越来越大的 subset
18:03
is like these monopoly platforms you go on to sort of work with.
就像那些垄断性的 platforms,你上去跟它们合作之类的。
18:07
So I say that's another thing.
所以我说,这是另一回事。
18:09
Thing number three is I think now people
第三件事是,我觉得现在人们
18:10
sort of are caring about performance more.
有点变得更在意 performance 了。
18:12
I think over the past decade,
我觉得在过去的十年里,
18:14
the people including myself, but many, many other people
包括我自己在内,还有很多很多其他的人。
18:18
who have been saying that this is a problem
那些一直说这是个问题的人
18:20
have actually had some effect.
实际上产生了一些影响。
18:22
Like, I don't think that it was a waste of time.
就是,我不觉得那是浪费时间。
18:24
I'm seeing a lot of new emphasis on performance,
我看到很多新的重点放在performance上,
18:27
people talking about performance,
大家都在谈论performance,
18:29
people posting benchmarks on things.
人们发布各种benchmarks的结果。
18:31
And so I actually think that the third thing as well,
所以我其实也觉得第三件事也是一样,
18:35
actually it kind of does seem that
确实看起来是这样。
18:37
pointing at this issue and saying
指着这个问题说
18:38
this is something we should be doing better
这是我们应该做得更好的地方
18:40
has not been completely a waste of time.
并不是完全白费功夫
18:43
I do see things as sort of starting to turn around a little bit.
我确实觉得事情开始有点好转了
18:46
I also see people attacking major product categories now
我也看到现在有人开始冲击主要的产品类别
18:50
with performance-based pitches,
用基于性能的推销方式
18:51
things like file pilot or the Blick video editor,
比如 File Pilot 或 Blick 视频编辑器
18:54
things like this that have been coming out lately,
像这些最近冒出来的东西
18:56
where it's like, oh, really performance software
就是那种,哦,真的是特别强调性能的软件
18:58
to try to take on incumbents in a space
想要挑战这个领域的现有玩家
19:01
and they've been getting traction.
而且它们已经取得了一些进展。
19:02
So I think that's also a really good sign.
所以我觉得这也是个非常好的信号。
19:04
Yeah, and I guess on this last category,
对,我觉得在这最后一个类别里,
19:06
a really good example in the developer community
在开发者社区里有个很好的例子
19:08
is bun versus NPM, where bun just said like,
就是 bun 和 NPM 的对比,bun 就说,像是,
19:12
okay, we're like 10X or 20X or 50X faster.
好吧,我们就是快 10X、20X 或 50X。
19:16
And devs are like, what is possible?
然后开发者们就是那种反应——这也能做到?
19:19
And then it was, so there was this outrageous claim.
接着呢,就有那么一个非常离谱的说法。
19:23
I almost, I wonder if like,
我几乎,我在想是不是,比如,
19:24
you need to have these outrageous claims
你得有这些离谱的说法,
19:26
because dev starts to pay attention
因为开发者才会开始关注。
19:27
because it was 10X faster in many categories.
因为它在很多类别上都快 10X。
19:31
You know, linear versus was gyro is also a good example
你知道,linear 对比 was gyro 也是一个好例子,
19:35
where linear have this benchmark of, okay,
其中 linear 有一个 benchmark,就是,好吧,
19:38
they have 300 milliseconds for any action
它们做任何动作只有300毫秒的时间。
19:40
and gyro, of course, we know is just slow
而gyro,当然,我们都知道它就是慢。
19:44
because they have a bunch of complexity.
因为它们有一堆复杂性。
19:45
We can explain why, but it's slow.
我们可以解释为什么,但就是慢。
19:47
It was never built for that.
它本来就不是为这个而设计的。
19:49
Yeah, and you know, if you think about something
对,而且你知道,如果你考虑一个东西,
19:51
like a 300 millisecond budget for an operation,
比如一个操作有300毫秒的预算,
19:53
300 milliseconds is like an eternity in computing, right?
300毫秒在计算领域简直就像永恒,对吧?
19:57
And so if you're talking about like our pitches
所以如果你说的是像我们那些不超过300毫秒的pitch,
20:00
that were not more than 300 milliseconds,
那些不超过300毫秒的,
20:02
that just shows you how the bar was so far past
这就说明了那个标准高得有多离谱,
20:07
where it probably should have been for something.
远远超过了它本应该有的水平。
20:08
And you see it everywhere, you know,
而且你到处都能看到这种情况,你知道,
20:10
you go on to programs and you're waiting
你打开程序,然后要等,
20:12
sometimes seconds for an operation.
有时候一个操作要等好几秒。
20:14
And I don't think people realize just what an eternity
我觉得人们根本意识不到那是一种多么漫长的永恒——
20:16
second is in modern computing, especially
第二点是,在现代计算中,尤其是
20:20
when you're sitting on networking like that has,
当你处于这样的 networking 上,它有着
20:23
you know, sub 10 millisecond ping times sometimes,
你知道,有时候 ping 时间低于 10 毫秒,
20:26
you're talking about this, you know,
也就是说,你懂的,
20:28
the actual packets had to travel physical distance
这些实际的 packets 需要穿越物理距离
20:31
to get to the status center.
才能到达 status center。
20:32
And that was being done far faster than this very simple
而这一过程完成的速度,远比这个非常简单的
20:35
operation that you were failing to do
你都没能完成的操作还要快。
20:37
in a reasonable amount of time,
在合理的时间范围内,
20:38
which is like, we are massively underperforming it.
也就是说,我们远远没能达到这个水平。
20:40
People don't believe it when you say 10X, 100X,
你说10X、100X的时候,人们都不相信,
20:42
but it's actually true.
但事实确实如此。
20:43
And we've seen a lot of proof of it as you point out.
正如你指出的,我们已经看到了很多证据。
20:46
I do wonder if one part of the not really much focus
我确实在想,有一部分原因是我们没怎么关注
20:49
on performances that a lot of developers don't know
performance,因为很多开发者并不知道
20:53
the baseline thing.
baseline 这个东西。
20:54
And I'm reminded by Simon Erickson,
而且我想起了 Simon Erickson,Turbo Buffer 的创始人,他做过一个叫 napkin math 的项目,里面列了一大堆 mostly 都是 networking operations。
20:56
the founder of Turbo Buffer,
比如在两个 AWS 数据中心之间传一个 byte 要多久?
20:57
have this as a project called napkin math,
那一个 gigabyte 要多久?
20:59
where he did a list of mostly networking operations.
那一个 terabyte 要多久?
21:03
How long does it take to transfer one bite
传输一个 byte 需要多长时间,
21:06
between like two AWS data centers?
比如说在两个 AWS data center 之间?
21:08
How much does a gigabyte take?
一个 gigabyte 要占多少?
21:10
How much does a terabyte take?
一个 terabyte 要占多少?
21:12
How much does it take to write an SSD
写一个 SSD 要花多少时间
21:15
to an NVMe and so on?
到 NVMe 之类的呢?
21:18
And so he had these numbers.
于是他有了这些数据。
21:19
And he said that what he found is,
他说他发现的是,
21:22
whenever the inshides Shopify,
每当 Shopify 内部的人,
21:24
they were deciding do we choose vendor A
他们在决定我们选供应商 A
21:26
or vendor B as a database?
还是供应商 B 作为 database?
21:27
They would just run a benchmark
他们就会跑一个 benchmark。
21:30
that they would write themselves
它们会自己写出来
21:32
and they would get like, okay, like I don't know,
然后它们会得到类似,好吧,我不太清楚,
21:33
storing this and this,
存储这个和这个,
21:34
it takes two seconds on this one,
这个花两秒,
21:36
10 seconds on that one,
那个花十秒,
21:37
we will choose the two second one.
我们就选两秒的那个。
21:38
And he looked at it and said like, hey,
然后他看着它说,嘿,
21:40
like this doesn't make sense.
这说不通啊。
21:42
Like the amount to store in the file system,
就像存储在 file system 里的数据量,
21:45
like here's the theoretical limit,
比如这里是理论极限,
21:46
which is I don't 100 milliseconds.
也就是,我不知道,100毫秒。
21:48
Like there's no way that's going to be 10 seconds
就像那绝不可能是10秒,
21:50
and often turns out that he found
而且往往结果是他发现
21:52
that the benchmark was just wrong.
那个 benchmark 就是错的。
21:54
They were benchmarking the wrong thing
他们 benchmark 了错误的东西,
21:55
and they were making decisions.
而他们在做决策。
21:56
So I wonder if there's a thing
所以我就在想,是不是有很多工程师、开发者,可能根本不知道这个东西跟你手上的资源比起来,到底慢得有多离谱。
21:58
where many engineers developers
这就是我说的 sub seconds 的全部意义,对吧?
22:00
are maybe just not aware of how truly
所以你刚才说的完全正确。
22:03
devastatingly slow this thing is
这也是我在 sub stack 上反复强调的。
22:05
versus the resources you have.
相对于你拥有的资源。
22:08
That is the entire point of like my sub seconds, right?
这就是我那些 sub seconds 的全部重点,对吧?
22:11
So what you just said is exactly true.
所以你刚才说的完全正确。
22:14
And it is the thing that I hammer home on the sub stack
而这也是我在 Substack 上反复强调的一点。
22:17
it through all the parts of like the courses on there,
把那里的课程的所有部分都过一遍,
22:19
which is that in general,
也就是说,总的来说,
22:21
there's a misconception about the way
对于这种方式有一种误解,
22:23
that you approach optimization in computer science
就是你在计算机科学中做 optimization 的方式,
22:27
or in whatever software engineering, let's say.
或者在任何软件工程中,比如说。
22:29
And that misconception is that what you do is
而这个误解就是,你所做的是
22:32
you run a profile,
你运行一个 profile,
22:34
you identify where the like, you know,
你找出哪里,就像,你知道,
22:36
big parts of the profile are,
profile 的很大一部分是,你对这些做一些改动,然后测量 statistics,statistics 越好,你知道,你能拿到的 scores 越多越好,然后你看这些 statistics 是否提升了,如果是,那就是一个好的改动,你就继续这么做。
22:38
you make some changes to those
你对这些做一些改动。
22:40
and you measure like statistics,
然后你去测一下 statistics 这类指标。
22:42
the better the statistics,
统计数据越好,
22:44
you know, the more scissors you can get the better
你懂的,你能拿到的剪刀越多越好
22:47
and you look to see if those statistics improved,
然后你看看这些统计数字有没有变好,
22:49
if they have, that was a good change
如果变好了,那这就是个好改动
22:50
and you proceed as such.
然后你就照这个继续做。
22:52
And this is completely not correct.
而且这完全不对。
22:55
That is not how anyone has ever, you know,
你知道,从来没有人那样做过,
22:57
I've worked with many,
我合作过很多
22:58
extremely good optimization people
极其出色的 optimization 人才,
23:00
and that is not how it is done.
而且那不是正确的做法。
23:03
The correct way to do optimization
做 optimization 的正确方式
23:04
is very much like what you just said.
非常像你刚才说的那样。
23:07
You first go, what are the operations
你首先会问,operations 是什么?
23:09
that this system has to perform?
这个 system 需要执行什么?
23:11
What is the underlying hardware capable of doing
底层 hardware 能够做什么
23:14
at its theoretical peak?
在它的 theoretical peak 时?
23:15
And then you measure the delta
然后你测量 delta
23:17
between that theoretical maximum
在 theoretical maximum 和
23:20
and what you have achieved.
你所取得的成果之间
23:22
And then your goal during optimization
然后你在 optimization 期间的目标
23:24
is to shrink that gap to something
是把这个 gap 缩小到某种程度
23:26
that you think could be plausibly explained
你觉得有可能解释得通的
23:28
and hopefully come up with explanations
并且希望能找到一些解释
23:30
of why you aren't at theoretical
来说明为什么你没有达到理论值
23:32
because oftentimes you can't hit theoretical,
因为很多时候你确实达不到理论值,
23:33
that's why we call it theoretical, right?
所以才叫理论值嘛,对吧?
23:35
And it's crucial that you do this
而且这件事很关键,
23:37
because otherwise all you're doing
因为否则的话,你所做的一切
23:39
with that other method is finding a,
用那种方法只是在找一个,
23:41
you know, with the, with the,
你知道,就是,就是,
23:42
I'm just gonna, you know,
我就是想,你知道,
23:43
make something I think might be an optimization
做一个我认为可能是 optimization 的东西,
23:45
and look if my statistics improved.
然后看看我的 statistics 有没有提高。
23:46
All you're doing there is finding a local minima.
你做的只不过是在找 local minima。
23:49
That's all you're doing.
你做的就是这些。
23:50
You're just, you know,
你只是,你知道,
23:51
you've got this shape of your performance
你的 performance 就是这样一个形状。
23:53
and you're finding some little spot
然后你找到某个小角落
23:55
and you're sitting in it.
然后你坐在里面。
23:56
That's not optimization,
那不是optimization,
23:57
that's improvement,
那是improvement,
23:59
but optimization means to make optimal, right?
但optimization的意思是做到optimal,对吧?
24:01
It means we're going to find
意思是我们要找到
24:03
what we actually should be able
我们实际上应该能让
24:04
to get this machine to do.
这台机器做到什么。
24:06
And so, you know,
所以,你知道,
24:08
that's why I emphasize that approach
这就是为什么我强调这种方法
24:09
because it's the one that I've always seen
因为这是我一直以来看到的
24:12
great optimizers take.
那些顶尖的optimizers会采取的。
24:13
That is how they get good performances
这就是他们获得好的performance的方式
24:14
by knowing what the maximum could be.
通过知道maximum可能是什么。
24:17
In addition to that,
除此之外,
24:19
it also is what lets you become better at optimization
它也是让你更擅长optimization的原因。
24:22
because no matter who you are
因为不管你是谁
24:24
and no matter how much you already know,
也不管你已经知道多少,
24:26
when you go to tackle an optimization problem,
当你去解决一个 optimization problem 时,
24:29
there may well be some things
很可能会有一些事情
24:31
in the new way that the system is laid out
在系统的新布局方式中
24:34
that you don't know about.
是你所不知道的。
24:35
New things that people have not figured out
有些人们尚未搞明白的新东西,
24:38
about modern CPUs,
关于现代 CPUs 的。
24:39
new things that are different
新的不同之处
24:40
about the network back plane,
在于 network back plane,
24:42
new things that are different about the GPU drivers.
GPU drivers 方面的新不同之处。
24:44
Who knows, right?
谁知道呢,对吧?
24:45
And if you don't have some theoretical maximum
如果你没有一个理论最大值
24:48
to look at and to measure your delta from,
来参照并据此测量你的 delta,
24:50
you don't know if there's some serious anomaly there.
你就不知道那里是否有严重异常。
24:53
And we, you would be surprised
而且我们,你会惊讶的
24:56
at how many times we find anomalies like this.
像这样的异常,我们发现了多少次。
24:59
Things in CPUs that no one knew about
CPU 里那些没人知道的东西。
25:01
and we, you know, like I've literally had them
而且我们,你知道,我真的遇到过。
25:03
in the course of making the sub-stack.
在制作 sub-stack 的过程中。
25:05
I've been like, what is this thing?
我当时就想,这是什么?
25:06
And I look into it's like, oh, there's this new renaming,
然后我去查,发现,哦,有个新的 renaming。
25:09
this new rat table thing that Intel chip
这个新的 rat table 的东西,Intel 芯片
25:11
seemed to be able to do.
似乎能做到。
25:12
We didn't know about that.
我们之前不知道那件事。
25:14
And that's like a new thing we have to model
而且那是一个我们必须去 model 的新东西,
25:16
when we talk about how to do performance.
当我们讨论如何做 performance 的时候。
25:18
And so that's the other crucial part
所以那是另一个关键部分,
25:20
of I guess what you were calling napkin math.
我猜就是你所说的 napkin math。
25:22
I also call it back of the envelope.
我也叫它 back of the envelope。
25:23
That's the term I've heard used for it
那是我听过的用来指代它的术语。
25:25
oftentimes they're kind of interchangeable, right?
通常它们是可以互换的,对吧?
25:27
Knowing what the theoretical is
知道理论是什么
25:29
is how you learn as well.
这也是你学习的方式。
25:31
How you learn about new hardware
你怎么学习新的 hardware
25:32
and new performance options.
以及新的 performance 选项。
25:34
Interesting.
有意思。
25:35
Plus by doing this, you're just learning,
而且通过这样做,你就是在学习,
25:37
you're becoming better professional.
你会成为更优秀的专业人士。
25:38
You understand more about given hardware
你会更了解给定的 hardware。
25:40
or the inner workings of your computer
或者你电脑的内部运作
25:44
or software, software, kernel, you know,
或者 software、software、kernel,你懂的,
25:47
all the stuff that I guess goes way beyond
所有这些东西,我觉得远远超出了
25:49
the vanilla programming language.
基础的 programming language。
25:52
Like, because you can say,
比如说,因为你可以说,
25:53
I'm an engineer, I'm an software engineer
我是工程师,我是 software 工程师,
25:54
because I know how to use this programming language,
因为我会用这个 programming language,
25:56
but I'd argue you're probably an engineer
但我想说,你大概是个工程师。
25:58
if you can go down the stack and you have the ability.
如果你能深入 stack,而且你有这个能力。
26:01
And you have like a good understanding
并且你对它有一个很好的理解
26:03
of some of it at least, right?
至少对其中一部分,对吧?
26:04
And then you can learn the rest.
然后你就可以学剩下的。
26:06
And I would also say that one of the other things
我还想说,另外有一件事
26:07
that we do in the class is teach how to read assembly language
我们在课堂上会教如何阅读 assembly language
26:10
and people often ask what, like what?
人们经常会问什么,比如什么?
26:12
Like, you know, assembly language
就像,你知道的,assembly language
26:13
what would I ever need that for?
我到底要那个干嘛?
26:15
There's a very good reason for it.
这有个很好的理由。
26:17
And that is that everything else that you might use
那就是,其他一切你可能用到的东西
26:20
doesn't tell you anything about
都告诉不了你任何关于
26:21
what the CPU is actually receiving.
CPU 实际接收了什么。
26:24
You know, if I look at a Java program,
你知道,如果我看一个 Java 程序,
26:26
if I look at a C program,
如果我看一个 C 程序,
26:27
if I look at Haskell, OCaml, whatever, right, Rust.
如果我看 Haskell、OCaml,随便什么,对吧,Rust。
26:31
All I'm seeing is input to a compiler.
我所看到的全是 compiler 的输入。
26:34
I have no idea what the CPU is actually going to be asked to do.
我完全不知道 CPU 实际上会被要求做什么。
26:38
If I look at the assembly language output from that compiler,
如果我看看那个 compiler 输出的 assembly language,
26:41
I know exactly what the CPU is being asked to do.
我就完全清楚 CPU 被要求做什么了。
26:44
And it's not that hard to be able to learn
而且学会读 assembly language 并不难,
26:47
to read assembly language so that you can see very quickly
这样你很快就能看出
26:50
is the CPU being asked to do the things
CPU 被要求做的事情,是不是
26:53
that I think it should be asked to do them
那些我认为它应该被要求做的事。
26:55
and in that way, right?
而这样一来,对吧?
26:57
You don't have to write it hardly ever.
你几乎从来都不用写它。
26:59
It's very rare that you have to write assembly language
你必须写 assembly language 的时候非常少,
27:02
to do anything other than sometimes for test purposes.
除了有时候为了测试目的。
27:05
It's easier to do that.
那样做更容易。
27:06
So you don't have to try and convince the compiler to output something.
所以你不需要试图说服 compiler 去输出什么。
27:08
So if you're just testing something,
所以如果你只是在测试某个东西,
27:10
sometimes it helps to be able to write some assembly language.
有时候能写一些 assembly language 会很有帮助。
27:12
But if you're just talking about the vast majority
但如果你只是说绝大多数
27:16
of tasks you might do an optimization, writing it, no,
的任务,你可能会做一个 optimization,把它写出来?不,
27:18
reading it essential.
阅读它才是关键。
27:20
And it also unlocks this sort of huge world of possibilities
而且它还为你解锁了这种巨大的可能性世界,
27:24
to you because once you know assembly language,
因为一旦你懂 assembly language,
27:27
you can now do things like read those CPU diagrams.
你现在就能做像读那些 CPU diagrams 这样的事。
27:30
Like, you know, when they announce a new processor,
比如,你知道,当他们发布一个新的 processor 时,
27:31
they put up a little diagram.
他们会放出一个小的 diagram。
27:33
That diagram tells you stuff like the fastest
那个图告诉你的东西包括这东西做乘法最快能多快之类的。
27:35
this thing could do multiplication and stuff like that.
它告诉你,如果你懂 assembly language,你直接就能从图表上看出来,对吧?
27:36
It tells you that if you know assembly language,
如果你不懂 assembly language,你拿到那张图就会觉得,我完全不知道自己在看什么,对吧?
27:38
you can read it right off the chart, right?
就像只是一个奇怪的 flow chart,根本告诉不了我任何东西,对吧?
27:40
If you don't know assembly language, you can get that chart
如果你不懂 assembly language,你可以拿到那张图表
27:42
and like, I have no idea what I'm looking at, right?
然后就像,我完全不知道自己在看什么,对吧?
27:44
Like it's just this weird flow chart
就像,它就是个奇怪的流程图。
27:45
that doesn't really tell me anything, right?
那其实说明不了什么,对吧?
27:47
And so one of the really great things about assembly
所以呢,assembly 真正很棒的一点就是
27:49
is it unlocks all of this knowledge for you
它为你解锁了所有这些知识
27:50
because it's the actual input language to the machine
因为它是机器真正使用的输入语言
27:55
and it allows you to figure out how it's operating.
而且能让你搞清楚机器是怎么运作的
27:58
Plus, I guess we should add that assembly language
另外,我觉得我们还得补充一下,assembly language
28:00
is not all that complicated, right?
其实并没有那么复杂,对吧?
28:02
Just by nature.
它天生就是如此
28:04
It's a far simpler language.
它是一种简单得多的语言
28:05
Okay, it's harder to read if you've never seen it,
好,如果你从没见过它,读起来会更难,
28:08
but it's in terms of the number of operations,
但按 operations 的数量来说,
28:11
it's so bare bones because, you know, that's what assembly
它如此精简,因为,你知道,assembly 就是这样,
28:14
is like every single higher level language
每一种 higher-level language
28:16
will have way more keywords, structure, whatever
都会有更多的 keywords、structure,不管
28:19
you name it, right, than assembly.
你列举什么,对吧,都比 assembly 多。
28:20
Massively more, and especially when you consider
多得多,尤其当你考虑
28:22
the subset that are actually used,
实际用到的 subset 的时候。
28:24
if you look at the subset of constructs
如果你看一下那部分结构,
28:27
that you would need to understand
也就是你需要理解的那些,
28:29
to be able to understand, say, just a website from today,
为了能理解,比如说,今天的某个网站,
28:33
all of the JavaScript libraries, all of the JavaScript syntax,
所有的 JavaScript 库,所有的 JavaScript 语法,
28:36
all of the DOM, you know, all of the behavior
所有的 DOM,你知道,所有的行为,
28:39
that's going to go on the CSS, react CSS, right?
那些发生在 CSS 上的,react CSS,对吧?
28:43
All of that assembly language, you know,
所有这些 assembly language,你知道,
28:46
maybe there is 20, 30 instructions
可能也就20、30条指令。
28:48
you might have to learn total
你可能觉得非得全学会不可
28:50
because most things in legacy assembly like x64,
因为 legacy assembly 里的大部分东西,比如 x64,
28:54
most of them are hardly ever output by the compiler.
绝大多数几乎都不会被 compiler 输出。
28:56
So you only need to learn a very small subset
所以你只需要学一个非常小的子集,
28:58
that's the ones that are actually going to be,
就是那些实际会用到的,
29:00
that you're going to be seeing in 90% of the cases.
你在 90% 的情况下都会看到的。
29:02
It's so much simpler.
这样就简单多了。
29:03
And also when you're looking at performance,
而且当你在看 performance 的时候,
29:06
you're typically only looking at a very small part, right?
你通常只盯着很小的一部分,对吧?
29:09
You've kind of understood roughly what's going on,
你大概已经明白是怎么回事了,
29:11
you've seen the basics layouts of your program,
你已经看过 program 的基本布局,
29:13
you've identified what's supposed to be happening
你也确定了应该发生什么,
29:15
and you're just looking to see like, wait,
然后你只是想看看,等等,
29:16
why is this part, which I don't think should be running this
为什么这个部分——我觉得它不应该跑这么慢——为什么它跑这么慢?
29:18
slowly, why is it running this slowly?
而且它只是很小的一块。
29:20
And it's just a very small piece
而且它只是很小的一部分。
29:21
you typically end up having to look at as well.
你通常最后也得去看一下。
29:24
So it's really much easier if you can understand
所以如果你能理解,那会容易得多。
29:26
how to center a div, as they say,
就像他们说的,怎么把一个 div 居中,
29:29
if you can vertically center a div in HTML,
如果你能在 HTML 里垂直居中一个 div,
29:31
then you can probably learn assembly language, I would say.
那我想你大概也能学会 assembly language。
29:34
Okay, at your super passionate about performance optimization,
好的,你对 performance optimization 非常热衷,
29:39
you also have really good educational materials,
你还有非常好的教学材料,
29:40
both free videos, your paid sub stack,
既有免费视频,也有你的付费 Substack。
29:43
the free parts of it, et cetera.
它免费的部分,等等。
29:44
But let me just play devil's advocate.
但让我来唱个反调。
29:46
There's this saying that premature optimizations
有句话叫 premature optimizations
29:49
are root of all evil.
是万恶之源。
29:50
And we typically use it,
我们通常用它,
29:51
or I typically use it so many times
或者我经常用它,
29:53
where like, oh, should we make this performance,
比如,哦,我们要不要提升这个 performance,
29:55
should we optimize this thing?
要不要 optimize 这个东西?
29:56
And like, nah, let's not do that.
然后,算了,别那么做。
29:58
Let's first build it.
我们先把它做出来。
29:59
Let's see if it's good enough for our customers for ourselves.
看看它对我们的客户,对我们自己来说够不够好。
30:01
And if we need to, we can always optimize it.
如果需要的话,我们随时可以 optimize 它。
30:03
I mean, it's not the hardest thing in the world.
我的意思是,这也不是世界上最难的事。
30:06
Okay, maybe not as good as how you mentioned,
好吧,也许没有你提到的那么好,
30:08
because maybe I don't really assembly,
因为我其实不太懂 assembly,
30:09
but that's kind of a thinking of building,
但这有点像是构建的思路。
30:12
like a SaaS software, building software, a big tech.
就像 SaaS software、building software、big tech 那样。
30:15
What is your reply to that?
那你怎么回应这个?
30:17
Because I feel really good
因为我感觉真的很好,
30:19
that I made a really good argument here.
我在这里提出了一个很好的论点。
30:20
So I guess what I would say is the important part about that.
所以我想,关于那个,我要说的重点是,
30:25
And I'll guess I'll divorce it a little bit from the saying,
而且我想我会把这一点和那个说法稍微分开一下,
30:28
I have an entire lecture on that saying, by the way,
顺便说一下,关于那个说法我有整整一个讲座,
30:30
it's like two hours long,
大概两个小时那么长。
30:32
and I gave it a better software conference this year.
而且今年我把它放到了一个更好的软件会议上。
30:35
I believe the bottom of it coming out.
我相信它的根源会水落石出。
30:36
We're linking that with the journals below.
我们正在把它和下面的期刊关联起来。
30:38
Okay, it'll be like a week or two, I think, till it's up.
好的,我想大概一两周后就会上线。
30:40
So it may be right at the same time as this.
所以它可能会和这个同时出来。
30:43
But so if you wanna find out the history of that phrase,
但如果你想了解那句短语的来历,你可以去看看那个。
30:46
you can go look at that.
但我想谈谈它背后的想法。
30:47
But I wanted to talk about the idea behind it
但我想谈谈它背后的想法。
30:50
because I don't want to dismiss it entirely
因为我不想完全否定它
30:54
because it's not entirely false.
因为它也不是完全错误
30:55
And the idea is that, well,
而这个想法是,嗯,
30:57
I'm just gonna delay optimization work.
我就只是推迟 optimization 的工作
30:59
I'm not gonna think about that.
我不会去想那个
31:00
And then I'm just gonna make whatever I'm gonna make.
然后我就做我要做的东西
31:02
And then either myself or maybe I'll just hire
然后要么我自己来,要么我就雇一个
31:05
some performance person to come in
performance 的人进来
31:06
and clean up the mess later, right?
然后之后再收拾烂摊子,对吧?
31:08
So here's the positive side of that first.
所以首先来看看它的积极一面。
31:11
The positive side of that first is for some types of code
首先那个积极的一面是,对于某些类型的 code
31:15
that will work.
那是可行的。
31:16
If you happen to have written some operation poorly
如果你正好把某个 operation 写得很糟糕
31:20
where the optimized version of that operation
而这个 operation 的 optimized 版本
31:23
just looks like someone taking a loop
看起来就像有人拿一个 loop
31:26
and changing the loop from your really naive version
然后把你那个非常 naive 的版本改掉。
31:29
to a really well optimized version.
到一个真正 well optimized 的版本。
31:31
The typical of like I wrote a bubble saw
典型的,就像我写了一个 bubble saw。
31:34
we can later optimize that.
我们之后可以 optimize 它。
31:36
Who knows, right?
谁知道呢,对吧?
31:37
Anything of that form.
任何那种形式的东西。
31:38
Okay, maybe we can just do that.
好吧,也许我们可以就那样做。
31:40
So there are certain times where you do in your head
所以在某些时候,你确实在脑子里
31:44
want to be doing this,
想要做这件事。
31:46
where you want to say, okay,
比如你想说,好吧,
31:47
I could go spend a week researching
我可以花一周时间去研究
31:49
the fastest hash table implementation here.
这里最快的 hash table 实现。
31:52
But part of software engineering is being smart enough
但 software engineering 的一部分就是足够聪明,
31:55
to know it won't matter if I do that now or later.
知道现在做还是以后做都没关系。
31:58
The architecture around this piece won't have to change.
这块代码周围的 architecture 不需要改变。
32:02
I'm quite certain because I understand
我很确定,因为我足够了解
32:04
the problem well enough.
这个问题。
32:05
So it's okay.
所以没问题。
32:06
I can defer that to later.
我可以晚点再处理那个。
32:08
Maybe it's never too slow with the naive one I put in there
也许我放进去的那个 naive 实现永远不会太慢,
32:11
and then we don't have to do any work.
那我们就什么都不用做了。
32:12
Maybe it's too slow later, that's okay.
也许以后会太慢,那也没关系。
32:14
I just target this one hash table implementation
我就只针对这一个 hash table 实现,
32:16
and we'll get as fast as we need, right?
我们就能达到需要的速度,对吧?
32:19
If you're doing that,
如果你在这么做的话,
32:20
if you're applying that true engineering mentality to it,
如果你用真正的 engineering 思维来对待它,
32:23
you don't have a problem.
你就不会有问题。
32:25
The problem comes when you don't know
问题出现在你不知道
32:28
if the choice that you're making
你做的选择
32:30
produces that kind of optimizable hotspot.
是否能产生那种可优化的 hotspot。
32:34
And I'll give you a very simple example
我给你举一个非常简单的例子,
32:36
that usually people have had experience with.
这个例子通常大家都有过经验。
32:39
A very simple example would be we write our entire software thing
一个非常简单的例子就是,我们写整个 software 东西。
32:43
like we just whatever this massive thing
就像我们随便搞一个超大的东西
32:45
that we're imagining doing,
我们想象中要做的那个,
32:46
where we're going to ignore optimization.
然后我们打算忽略 optimization。
32:47
We sit down and we write it and we use a paradigm
我们坐下来写代码,用一种 paradigm,
32:51
where we ask the server for something.
就是向 server 请求一些东西。
32:53
We have like some API that we've built
我们有自己构建的 API,
32:55
for asking servers for things.
用于向 servers 请求东西。
32:57
We ask the server and it returns to us
我们请求 server,它就会返回给我们。
32:59
what the server's response was.
server 的 response 是什么。
33:01
And that's like kind of how we architect this thing.
我们大概就是这样 architect 这个东西的。
33:04
So everyone writes hundreds of thousands
所以每个人都会写几十万
33:06
or millions of lines of code
甚至几百万行的 code。
33:08
and they all look like ask the server something,
而且它们看起来都是先问 server 要个东西,
33:09
do some calculations, ask the server
做点 calculations,再问 server
33:11
for the next thing, do some calculations, right?
要下一个东西,再做点 calculations,对吧?
33:12
Then at the end, you find this is way too slow,
然后最后你会发现这实在是太慢了。
33:15
but that's okay.
不过没关系。
33:16
You weren't worried about that
你当时没担心那个
33:17
because you're like, when it happens at the end,
因为你会想,等最后发生的时候,
33:18
you call in some performance experts
你请来一些性能专家
33:19
to look at and they go,
来检查一下,然后他们说,
33:20
there's nothing we could do for you, sorry.
我们无能为力,抱歉。
33:22
Why?
为什么?
33:23
Well, the reason is because you created
嗯,原因是因为你创建了
33:25
a serial dependency chain.
一条 serial dependency chain。
33:27
All of your code looks like wait for a network request
你所有的 code 看起来都是:等待一个 network request
33:30
to come back, do something, wait for a network request
回来,做点事情,等待一个 network request
33:33
to come back, do something, wait for a network,
回来,做点事情,等待一个 network,
33:35
and that serial dependency chain
而那个 serial dependency chain
33:38
can't really be shortened without just rewriting it.
其实没办法缩短,除非重写。
33:41
If instead you had made the paradigm
反过来,如果你当初设定了 paradigm
33:43
and told your programmers, look,
然后告诉你的程序员们:“听着”
33:45
here's what you need to do.
这就是你需要做的。
33:46
At the top of every operation,
每次操作一开始,
33:47
you need to figure out all the things
你需要弄清楚所有的事情
33:49
you might want to ask the server for.
你可能想向 server 请求的。
33:50
You ask them for all of those things, right?
你向 server 请求所有这些内容,对吧?
33:54
And then you do all of your processing there
然后你在那里做所有的处理
33:55
and you only create a chain of dependencies
并且你只创建一个 dependency chain
33:58
if you absolutely couldn't have determined
如果你根本没法预先确定的话。
34:01
what it was you needed to ask the server for.
你本来需要向服务器要的东西。
34:03
Now you're just in this situation
现在你就陷入这种境地,
34:04
because you didn't tell them to do that,
因为你没有让他们那么做,
34:05
you have to rewrite all your code.
你就得重写所有代码。
34:07
Everyone is now going out, rewriting all the code
现在每个人都在动手重写所有代码,
34:09
if they even can, if it's even possible
如果他们还能做到的话,如果这真的有可能,
34:11
to really do that in a way that's not slower
真的能以不比直接重写那东西更慢的方式做到,
34:15
than just rewriting the thing, right?
对吧?
34:16
So what happened there?
那这是怎么回事?
34:17
Well, again, we talk about this a lot on the sub stack
嗯,还是那句话,我们在 Substack 上经常聊到这个
34:19
but there's this idea of a serial dependency chain.
但就有这么一个概念叫 serial dependency chain。
34:22
It's when you stack things in order, right?
就是按顺序堆叠东西,对吧?
34:24
And the performance of your software
而你的软件性能
34:26
is generally determined by the longest
通常由最长的
34:28
serial dependency chain because it's something
serial dependency chain,因为它是一个
34:30
that cannot be paralyzed.
无法被 parallelized 的东西。
34:31
If I have thing A that then B depends on,
如果我有东西 A,然后 B 依赖它,
34:35
that then C depends on that,
然后 C 又依赖它,
34:36
we cannot shorten that because it has to go in order
我们没法缩短它,因为它必须按顺序来,
34:39
and everything waits for it.
所有东西都得等它。
34:40
We can't multi-thread it because it's dependent,
我们没法 multi-thread 它,因为它是依赖的,
34:42
we can't make it run wide,
我们没法让它 run wide,
34:44
we can't amortize the network request, whatever.
我们没法 amortize 网络请求,之类的。
34:48
That kind of thing can be pervasive in the programming
这类事情在编程里会很普遍。
34:51
and we can't cheaply remove it
而且我们没法低成本地移除它
34:52
because it's not a hotspot.
因为它不是一个 hotspot
34:54
It's a way that you did things.
这是一种做事方式
34:55
That's the part where that kind of thinking breaks down.
这就是那种思维方式行不通的地方
34:58
If every software engineer knew
如果每个软件工程师都知道
35:01
to watch out for false serial dependency chains,
要留意 false serial dependency chains
35:05
things where they were creating series of dependent operations
也就是他们在构建一系列 dependent operations
35:08
that could not be optimized away
这些操作没法被 optimized away
35:09
or other sorts of architectural problems like that
或者其他类似的 architectural 问题
35:12
that cannot be easily fixed,
那种不容易被修复的
35:14
then the world wouldn't look more like
那么世界看起来就不会更像是
35:17
just wait and optimize the hotspot, right?
就只是等着然后优化 hotspot,对吧?
35:19
Yeah, so this is the architecture of the planning, right?
是的,所以这就是 planning 的 architecture,对吧?
35:22
If in that phase you're like, okay,
如果在那个阶段你就像,好吧
35:24
like as this thing grows,
就像随着这个东西增长
35:26
like what would get in the way at performance,
比如在 performance 方面会有什么阻碍?
35:28
what would slow it down?
什么会让它变慢呢?
35:29
Or you can ask all these questions
或者你可以把所有这些问题都问一遍
35:30
or like different flavors of this questions
或者问这些问题的不同变体
35:32
or from the other side and so on.
或者从另一个角度问,等等。
35:34
Yeah, another way to think of it is
对,换个方式想就是
35:35
because hotspots is the way that people talk about that.
因为人们通常用hotspots来讨论这一点。
35:38
It's gonna be hotspot optimization.
那就得做hotspot optimization。
35:40
We've just got a few spikes.
我们只是出现了几个spikes。
35:41
Some will come in and clean up those spikes and we're done, right?
有些人会进来清理那些 spikes,然后就搞定了,对吧?
35:44
The way to think about it is your code base
你要这么想:你的 code base
35:45
will not end up that way by accident
不会偶然变成那样
35:47
in most cases anymore.
在大多数情况下,再也不会了。
35:48
You have to engineer up front for a hotspot code base
你得预先为一个 hotspot code base 做好工程化设计,
35:53
that people can then optimize, right?
这样人们之后才能 optimize,对吧?
35:56
And so that's the crucial takeaway is
所以,最关键的一点是
35:59
everybody on your team
你团队里的每个人。
36:01
who is making architectural decisions,
谁在做 architectural decisions,
36:03
those people must know performance
这些人必须懂 performance,
36:05
and they must make decisions
而且他们必须做出决定,
36:07
that will allow the other people downstream of them
让他们 downstream 的其他人
36:11
to use an architecture which can be optimized later.
能使用一个以后可以优化的 architecture。
36:15
If you don't do that, you're just rolling the dice.
如果你不这么做,那就是在碰运气。
36:18
Casey just talks about how engineers
Casey 刚才说的是,engineers
36:20
making architectural decisions should know about performance.
做 architectural decisions 的人应该了解 performance。
36:22
This is also true when choosing your dependencies
这在选择 dependencies 时也是一样的。
36:24
like which database to use.
比如用哪个 database。
36:26
And this is where I want to mention
而这里我想提一下
36:27
our season sponsor TurboPuffer.
我们本季的赞助商 TurboPuffer。
36:29
You already know how TurboPuffer
你已经知道 TurboPuffer
36:30
is a vector and full-text search engine
是一个 vector 和 full-text search engine,
36:32
but here's an interesting story from linear
但这里有一个来自 Linear 的有趣故事
36:34
on what happens when you stop thinking
关于当你停止思考时会发生什么。
36:36
of TurboPuffer as a search engine
TurboPuffer 作为 search engine 这件事,
36:37
and start using it as a primitive to reduce latency.
然后开始用它作为 primitive 来降低 latency。
36:40
As context, linear is a local first app.
补充一下,linear 是一个 local first app。
36:43
So each client keeps a local database
所以每个 client 都会维护一个 local database,
36:45
and when that client goes back online
当这个 client 重新上线时,
36:47
it needs to catch up with what happened and do it fast.
它需要快速 sync 已经发生的事情。
36:50
Their biggest workspaces generate
他们最大的 workspaces 所产生的,
36:52
around a million interesting actions per day.
大约每天一百万个 interesting actions。
36:54
Doing catchups by reading from Postgres
通过读 Postgres 来做 catchup
36:56
was getting slow for large reads
在大规模读取的时候越来越慢
36:58
so the tail latency got too large
所以 tail latency 变得太大
37:01
and any more applications did not help either.
而且再加多少 applications 也没用
37:03
Linear solve the problem cleverly.
Linear 很聪明地解决了这个问题
37:05
They start using TurboPuffer
他们开始用 TurboPuffer
37:06
as a serving index for each client.
作为每个 client 的 serving index
37:08
This is because TurboPuffer itself
这是因为 TurboPuffer 本身
37:10
is built on top of inverted indexes.
它是基于 inverted indexes 构建的。
37:12
So for every index value
所以对于每一个 index value,
37:13
it stores the documents that the value can be found in.
它会存储包含这个 value 的 documents。
37:16
The lookup costs for such an index is constant.
这种 index 的 lookup 成本是 constant 的。
37:19
So linear took the structure
所以 Linear 采用了这个结构,
37:20
and then each client's index pointed
然后每个 client 的 index 指向了
37:22
the changes that they needed to sync.
它们需要 sync 的 changes。
37:24
As a result, not only did they reduce latency
结果,他们不仅降低了 latency。
37:27
but they kept it constantly low
但他们让它一直保持很低
37:28
no matter how long the change list
无论 change list 有多长
37:30
is synced to the client is.
同步到客户端的是。
37:31
Linear publish a blog post about this refactures
Linear 发布了一篇关于这次 refactoring 的博客文章
37:34
hide all the rebuilding linear delta sync read path,
隐藏所有重建 Linear delta sync read path 的过程,
37:36
check it out.
去看看吧。
37:37
I love this story because it shows how important
我喜欢这个故事,因为它展示了多么重要
37:39
it is to choose the right primitives
选择正确的 primitives 有多重要。
37:41
and how good primitives can improve your system.
以及好的 primitives 如何改进你的系统。
37:43
If you're building systems where you store a lot of data
如果你在构建需要存储大量数据的系统,
37:46
or serve a lot of data,
或者对外提供大量数据,
37:47
TurboPuffer can probably speed things up
TurboPuffer 可能会加速流程,
37:49
or save on your costs.
或者帮你节省成本。
37:50
Learn more at turbopuffer.com slash pragmatic.
了解更多请访问 turbopuffer.com/pragmatic。
37:53
I'd also like to talk about a presenting sponsor
我还想聊一下我们的冠名赞助商,
37:55
and diseases.
以及疾病。
37:56
While Casey delivered it is not use AI coding agents
虽然Casey说他不使用AI coding agents
37:59
for his work, most of us do.
在他的工作中,但大多数人都在用。
38:00
And when you work with coding agents,
而当你和coding agents一起工作时,
38:02
your job is no longer writing code
你的工作不再是写代码,
38:03
it's specifying and testing it.
而是specifying和testing它。
38:05
Antisicis is the most effective method
Antisicis是当前最有效的方法,
38:07
for verifying agent code today.
用于验证agent code。
38:09
Let me explain how it works.
让我解释一下它是如何运作的。
38:10
Antisicis runs your whole system
Antisicis 运行你的整个系统
38:12
in a hostile simulation.
在一个对抗性 simulation 中。
38:13
By doing so, it finds every bug
这样一来,它能找到每一个 bug,
38:15
before your users do.
在你的用户发现之前。
38:16
And because assimilation is fully deterministic
而且因为 assimilation 是完全确定性的,
38:19
and this is it doesn't only find bugs,
所以它不仅仅能找到 bug,
38:20
it gives you a perfect reproduction of every issue.
它还能给你每个问题的完美复现。
38:23
To create such a tool,
要创建这样的工具,
38:24
the Antisicis team needed to invent new kinds
Antisicis 团队需要发明新型的
38:25
of debugging tools as well.
debugging 工具。
38:27
For example, here's what's called
比如,这就是所谓的
38:28
a bug probability graph.
bug probability graph.
38:30
The X axis virtual time and the Y axis is probability.
X 轴是 virtual time,Y 轴是 probability。
38:34
As Antisicis runs a hostile simulation,
当 Antisicis 运行 hostile simulation 时,
38:36
it plots time frames when the bug probably increases
它会绘制出 bug 可能增加的时间段,
38:39
which greatly helps us find the root cause of the bugs.
这极大地帮助我们找到 bug 的 root cause。
38:42
And Antisicis is also as a log visualizer.
而且 Antisicis 也是一个 log visualizer。
38:44
Vertical lines going down represent events
垂直向下的线条代表 events
38:46
branching off from the same state.
从同一个 state 分叉出来。
38:48
And the purple dots are where the bug happens.
紫色的点就是 bug 发生的地方。
38:51
Antisicis is as good as it gets
Antisicis 已经好到极致了,
38:52
in being able to ship agent printing code.
在能够 ship agent printing code 方面。
38:54
It's what teams at James Street fly to Iowa
这正是 James Street 的团队、Fly to Iowa
38:56
and the FCD community use to ship with full confidence.
以及 FCD community 用来满怀信心交付的工具。
38:59
Head to Antisicis.com,
去 Antisicis.com 看看,
39:00
so I've primatic to learn more.
所以我有 primatic 来了解更多。
39:02
And with this, let's get back to Casey
那么,让我们回到 Casey,
39:04
and how if you don't design an architecture
以及如果你不设计一个 architecture,
39:06
that can be performed to optimize later,
它可以在之后执行并 optimize,
39:08
you're just rolling the dice.
你只是在掷骰子。
39:09
And we've seen so many projects,
而且我们见过太多项目了,
39:11
I have an entire video where I go through like,
我有一整个视频,里面专门讲,比如,
39:14
look at all these blog posts of people who like say,
看看所有这些人的博客帖子,他们就好像在说,
39:16
we, you know, it's Facebook, it's Uber,
我们,你知道,是Facebook,是Uber,
39:18
it's everybody, they've got blog posts of,
所有公司都这样,他们都有博客帖子说,
39:20
we had to rewrite this whole thing
我们不得不重写整个系统
39:22
cause the performance was bad.
因为performance太差了。
39:23
If it was always hotspots that made your performance bad,
如果总是hotspots让你的performance变差,
39:25
you'd never have to rewrite the whole thing.
你就永远不会需要重写整个系统。
39:27
So we know that that doesn't work anymore.
所以我们知道那套已经行不通了。
39:29
Why?
为什么?
39:30
Because of the things I just said.
因为我刚才说的那些事情。
39:31
I was at Uber where I was not making decision,
我在Uber的时候,做决定的不是我,
39:34
but the teams next to me were and I saw
而是我旁边的团队在做决定,我看到了,
39:36
or I kind of understood why they were making,
或者说我有点明白他们为什么这么做,
39:38
but typically, and right now it's happening with AI companies.
但通常来说,现在AI公司也是这样。
39:41
Oftentimes it's like, we chose this technology,
很多时候就是,我们选了这项技术,
39:44
which is Python and it's single-threaded
也就是Python,而且它是single-threaded的。
39:46
and it makes sense at the time on the web server.
而且在当时的web server上,这是讲得通的。
39:48
But now we're big and this happened at Uber.
但现在我们规模大了,而这件事在Uber就发生过。
39:50
It was it was Python and Node.js
那会儿是Python和Node.js。
39:52
And then they went to go and job on the back end.
然后他们的后端就换成了Go和Java。
39:55
And now with AI companies, it was Python, open AI,
而现在对于AI公司来说,就是Python和OpenAI。
39:58
and the topic are both going through this right now.
而这两家现在都在经历这个。
40:00
They're both either public about it
它们要么是公开谈论过这件事,
40:02
or I've written with that topic,
要么是我写过相关的话题。
40:04
they share with me, but I put it out there.
他们跟我分享了,但我说出去了。
40:07
They used Python because data scientists
他们用了Python,因为数据科学家
40:09
are AI and machine learning engineers.
都是AI和机器学习工程师。
40:11
New Python, they put in a bunch of web servers,
现在Python,他们放了一堆web servers,
40:13
they had their API run on it.
他们让API跑在上面。
40:14
Initially they just, you know, skills horizontally.
最初他们只是,你知道,横向扩展。
40:16
But now they're like, well, if we move over to Rust,
但现在他们想,嗯,如果我们迁移到Rust,
40:19
they right now they're choosing Rust or Go,
他们现在正在选Rust还是Go。
40:22
but I think it's Rust.
但我觉得是 Rust。
40:23
Well, we can actually have multi-threaded
嗯,我们实际上可以做到 multi-threaded。
40:24
and the same machine can actually handle more connections.
而且同一台机器实际上能处理更多的 connections。
40:28
So cool.
太酷了。
40:29
I came across a lot of that because I think that's easy
我遇到过很多这样的情况,因为我觉得那很容易。
40:32
and safe to communicate because it doesn't look bad on you.
而且谈论它很安全,因为不会让你丢脸。
40:35
But you're right, a lot of times I don't think
但你说得对,很多时候我并不觉得。
40:38
on entering blog posts, you'll get the real reason
进入 blog posts 后你会得到真正的原因。
40:41
that these companies put out there.
这些公司对外发布的内容。
40:43
Like when it's kind of a very kind of, you know,
比如说,当它有点像那种,你知道的,
40:46
easy to own mistake or not mistake,
容易承认的错误,或者不是错误,
40:48
but just the decision, which made sense, they'll tell you.
但只要是合理的决定,他们就会告诉你。
40:51
But if it's something that was an oversight,
但如果那是一个疏忽,
40:53
you're not really going to get that on a public-facing
你不会真的在面向公众的
40:55
entering blog post, except for maybe some startups
工程博客文章上看到,除了一些创业公司也许
40:58
who are really there, but don't forget,
他们真的在那里,但别忘了,
41:00
like a lot of those blog posts are going to help someone
就像很多那些博客文章会帮助某人
41:02
get promoted or get recognized.
获得晋升或得到认可。
41:04
And they will always be way more positive
而且它们总是会乐观得多
41:06
in especially when there's a content writer team,
尤其是在有内容写作团队的时候,
41:09
which large companies do have.
大公司通常都有。
41:10
So it's not quite PR, but it's somewhere midway in between.
所以这不完全是 PR,但介于两者之间。
41:15
And I mean, yes, and also I would just point out the fact
我的意思是,是的,而且我还要指出一个事实
41:18
that like the fact that these things are happening, though,
那就是这些事情确实正在发生。
41:23
is all we really need to know for the signal, right?
这就是我们真正需要知道的 signal,对吧?
41:26
Because in general, this should not be happening.
因为一般来说,这种情况不应该发生。
41:29
If the idea is about activation of a true,
如果这个想法是关于一个真实事物的 activation,
41:32
you'd never have to rewrite something in a language
你就永远不需要用某种语言重写内容
41:34
in a different language, unless you just preferred that language.
用另一种语言,除非你就是更喜欢那种语言。
41:38
It would just, the story would just be,
那就会只是,故事就会是,
41:40
we wrote it in this language
我们用这种语言写的,
41:41
because we wanted to use this new language.
因为我们想用这种新的语言。
41:43
It would never be, or for Rust, it might be just memory safety.
永远不会是,或者说对于 Rust 来说,可能只是 memory safety。
41:46
We see those blog posts, right?
我们看到那些博客文章,对吧?
41:47
Why do we write in Rust?
我们为什么要用 Rust 写?
41:48
It wasn't performance.
不是为了 performance。
41:49
It would just be one of the memory safety or something like that.
也就是 memory safety 之类的。
41:51
If I'm a software engineer programmer,
如果我是一名软件工程师/程序员,
41:55
and I'd like to just get better at writing performance code,
我只是想在写 performance code 方面变得更好,
42:00
I'm interested, you know, it may be after this podcast
我感兴趣,你知道,可能是在这个播客之后。
42:03
or looking to some of the things that you did.
或者看看你做过的一些事情。
42:05
What is a learning path you would follow
你会遵循什么样的学习路径
42:07
outside of your sub stack where you cover a lot of these things?
在你那个写了很多这些内容的 Substack 之外?
42:09
But what are areas that you think are kind of like,
但你觉得哪些领域是那种,有点像,
42:12
you need to understand these things
你需要理解这些东西
42:13
to like get better at writing performer and code?
才能更擅长编写 Performer 和 code?
42:16
I think it's actually very simple
我觉得其实非常简单
42:19
and perhaps a little bit counterintuitive.
而且可能有点反直觉。
42:23
So I'll start with the very good news
那么我先从一个非常好的消息说起
42:27
about learning to write performance software.
就是关于学习编写 performance software 的。
42:30
The good news is that optimization of the kind
好消息是,这种 optimization
42:35
that we sort of talked about, the like hotspot kind,
就是我们之前讨论过的那种,像 hotspot 那类的,
42:38
where it's like, somebody's gonna go in here,
就是说,有人会进入这里面,
42:41
maybe they're gonna even rewrite this routine
甚至可能会重写这个 routine,
42:42
and hand code it assembly
然后手工用 assembly 来编写它,
42:44
or something crazy like this, right?
或者做一些类似这样疯狂的事情,对吧?
42:46
That's very rarely necessary these days.
如今这已经很少有必要了。
42:50
One of the reasons that you don't see hotspot optimization
你不会再把 hotspot optimization 视为
42:54
as a thing that really matters that much anymore
一件很重要的事情的原因之一,
42:56
and one of the reasons I advise
以及我建议
42:58
that architecture and not making bad decisions
architecture 和避免糟糕的决策
43:01
is much more important is because a lot of libraries
之所以更重要,是因为很多你可能用到的 libraries
43:04
already have been optimized for you that you might use.
已经为你优化好了。
43:07
CPUs are incredibly good at taking bad code
CPUs 非常擅长处理糟糕的代码。
43:09
and running it quickly and so on.
然后快速跑起来,等等。
43:11
So typically when we're talking about the causes
所以通常当我们谈论到原因
43:14
of performance, negative performance
关于 performance,也就是负面的 performance
43:16
that aren't squeezing every last little thing
这些原因并不是在榨干每一个最后的小东西
43:18
out of the hardware, but rather just making sure
从 hardware 中,而只是确保
43:20
this thing isn't running like 100 times slower
这个东西不会跑得
43:22
than it should be.
比它应该的要慢 100 倍。
43:23
Usually it's more just about having an awareness again
通常更多只是要再次有这种意识。
43:27
of what the computer should be able to do
关于电脑应该能做什么
43:30
and making sure you're making software architecture choices
并且确保你做的software architecture选择
43:33
that allow it to do that.
能够让电脑做到那一点。
43:35
And if you do those things,
如果你做了这些事情,
43:37
you will generally be within 2X or something
你通常会在2倍以内,或者差不多
43:41
which is 50X better than the people who are 100X away, right?
这比那些差了100倍的人要好上50倍,对吧?
43:45
So the good news is in order to write software
所以好消息是,为了写出software
43:47
that's much better than a lot of the software you use today,
比你现在用的很多software要好得多,
43:49
you don't have to know that much.
你不用懂那么多。
43:52
So what do you have to know?
那你需要知道什么?
43:53
What I argue and what we focus on the sub-sack is
我主张的,也是我们在Substack上关注的,是
43:56
I think you just have to go through the experience once
我觉得你只需要亲身经历一次
44:00
of learning, reading the assembly language,
就是学习、阅读assembly language,
44:02
seeing how the CPU works, seeing the difference,
看看CPU是怎么工作的,看看区别,
44:06
seeing why Python is slow, which we show on the subs.
看看为什么Python很慢,这些我们都在Substack上展示了。
44:08
So one of the first things I show is
所以我最先展示的其中一件事是
44:10
I walk you through the assembly language
我带你过一遍 assembly language
44:12
necessary to execute A plus B in Python.
也就是在 Python 里执行 A plus B 所需的。
44:15
And it's so vast that you don't have to skip most of it.
而且它太庞大了,大部分你都不用跳过。
44:19
It's massive, right?
它非常庞大,对吧?
44:20
It's like this huge.
就是这么大。
44:20
And whereas if you have the equivalent function in C,
而如果你用 C 写一个等价的函数,
44:24
it's one instruction add, right?
它就只是一个 add instruction,对吧?
44:27
So understanding basic things like that,
所以理解像这样的基本概念,
44:30
if you go through, learn to read a assembly language,
如果你去经历一下,学会读 assembly language,
44:33
learn to look at some code,
学会看一些 code,
44:34
learn to do some CPU timings.
学会做一些 CPU timings。
44:36
And you just have that experience,
然后你就有那种经验了,
44:38
just spend a month or two of nights or whatever,
就是花一两个月的晚上或者什么的,
44:42
you want, just understanding some performance stuff
如果你想的话,就是去理解一些 performance 方面的东西,
44:45
and going through a few examples where you play with it
然后再跑几个例子,自己玩一玩,
44:48
and you see the difference.
你就能看到差别。
44:50
And just so I understand you're saying,
所以,为了确认我理解你的意思,
44:53
do this not because, let's say you're doing iOS development
做这个不是因为,比如说你在做 iOS 开发
44:58
or web development, what React,
或者 web 开发,像 React,
45:00
like you will not look at the assembly that the React does.
你不会去看 React 的 assembly。
45:04
But if you do this on a project,
但如果你在一个项目上做这个,
45:06
you will be able to conceptualize
你就能在概念上理解
45:09
what is likely happening, what the layers are.
大概发生了什么,各个层级是什么。
45:12
And you might be able to decide,
而且你也许可以决定,
45:13
do I want this layer or do I want to use, let's say, WebGL,
我是想要这个 layer,还是想要用,比如说,WebGL,
45:17
which if you're a React engineer,
如果你是 React 工程师的话,
45:19
you probably haven't touched it.
你可能根本就没碰过它。
45:20
But again, you can skip a bunch of those things
但话说回来,你可以跳过很多东西,
45:22
and it comes with trade-offs,
而且这会带来一些权衡,
45:23
with maintainability, yada yada.
比如可维护性,等等等等。
45:25
But that now, you will know what you say
但这样一来,你就会知道自己在说什么,
45:29
by keeping this layer or not keeping it and so on.
比如是保留这个 layer 还是不保留,等等。
45:32
Do I get that right?
我理解对了吗?
45:33
Essentially yes.
基本上是这样。
45:34
And the simplest example is the Python example.
而最简单的例子就是 Python 的例子。
45:38
Most people have never internalized the fact
大多数人从来没有真正消化这个事实,
45:41
that it takes maybe on the order of 100 more CPU instructions
在 Python 里做一次加法,比在 C 这样的等效语言里做同样的事,
45:45
to do an add in Python than it does to do it
可能要多花大约 100 条 CPU instructions,
45:48
in an equivalent language like C for the same piece of text,
而且针对的是同一段代码,
45:51
just A plus B compiled in two different languages, right?
就是 A plus B 用两种不同语言编译,对吧?
45:54
And so just understanding even just that
所以,光是理解到这一点
45:58
is enough for you to kind of go like,
就足以让你会觉得,
46:00
oh, okay, A, now I kind of understand
哦,好的,啊,现在我有点明白了
46:03
why if I'm using Python,
为什么如果我用 Python,
46:05
I kind of have to use libraries to do things
我就需要用 libraries 来做事情
46:07
and those libraries were written and C
而那些 libraries 是用 C 写的
46:09
because it's like if I'm ever gonna do any operations
因为就像如果我要对大量的事物
46:12
on a large number of things,
去做任何操作的话,
46:13
I can't do it in this language
用这门语言我做不到
46:15
because the amplification factor is so high on each operation
因为每一步操作的 amplification factor 太高了
46:19
that it just kills the performance immediately
直接就毁掉了 performance
46:22
whereas these other languages don't have that, right?
而这些其他语言就没有这个问题,对吧?
46:24
And so understanding those orders of magnitude
所以,理解这些 orders of magnitude
46:28
and what's actually going on,
以及实际到底在发生什么
46:30
I think that allows the programmer to know,
我觉得这能让程序员知道
46:32
okay, if I think through what I'm doing right now,
好,如果我现在仔细想清楚自己在做的事情
46:35
can I afford the super slow down that I'm going to take?
我能承受我即将面对的超级变慢吗?
46:40
And usually I don't think you have to be a performance expert
而且通常我觉得你不必是 performance 专家
46:43
to make that decision.
就能做这个决定。
46:44
You could usually know like,
你通常能知道,比如说,
46:46
okay, is this a part of the code
好,这是 code 中的一部分,
46:47
that can afford to be a hundred times slower
它能承受比应该速度慢一百倍,
46:49
than it should be or not, right?
还是不能,对吧?
46:51
And you know, most people can I think make
而且你知道,我觉得大多数人都能做到。
46:53
that decision fairly logically
那个决定挺有逻辑的
46:55
and if it's not, then now you know like,
如果不是,那现在你就知道了,就是
46:57
oh, okay, if I'm in Python,
哦,好,如果我在 Python 里
46:58
then what I gotta do is either I gotta go find a library call
那我需要做的要么是去找一个 library call
47:02
that will do these sorts of things
能做这类事情
47:03
and structure around how that library works
然后围绕那个 library 的工作原理来构建
47:06
or I should maybe get something like Sython
或者我可能得弄个像 Sython 这样的东西
47:09
or something where I can do compiled stuff
或者某个能让我搞 compiled 的地方
47:11
inside my Python and make my code work
在我的 Python 里面,让我的代码能跑起来。
47:15
around calls out to that kind of code, you know,
围绕对那种代码的调用,你知道的,
47:18
you now have the tools you need up front
你现在已经提前有了所需的工具,
47:21
to make sure that when you write the program,
来确保当你写程序的时候,
47:23
you've put the parts that needed this
你把这些需要用到它的部分放好了,
47:25
and you've structured the code in such a way
而且你以一种方式去组织代码,
47:28
that you are only paying the hundred X on things
使得你只在那些 hundred X 的事情上付出代价,
47:30
that you know are very infrequent
而你知道那些事情是非常少发生的。
47:32
or happen like only, you know,
或者说,发生的频率只是,你懂的,
47:34
once per every so often things like that, right?
每隔一阵子才发生一次,对吧?
47:37
That's I think the biggest thing is just the knowledge
我觉得最重要的是知识本身
47:40
and once you know, you can start to make much better decisions
一旦你知道了,你就能开始做出更好的决定
47:43
in any language because it doesn't take you very long,
用任何语言都是如此,因为不会花太长时间,
47:46
you know, a simple search or, you know, asking an AI
你知道,一次简单的搜索,或者,你懂的,问一下 AI
47:49
or whatever is the common practice that you're going to do,
或者任何你通常会做的常规操作,
47:53
a simple bit of that once you know what you're asking for
一旦你知道自己要问什么,简单做一下就行了
47:57
will get you this information back very quickly, right?
会非常快地把这个信息返回给你,对吧?
48:00
You just have to know that you should have been thinking
你只需要知道,你早就该想到这件事。
48:03
about it.
那么作为软件工程师,你提到,了解 CPU 的工作原理是件好事,
48:03
Now as a software and you mentioned, it's good to understand
特别是如果你不是做游戏开发的,或者不做 low-level 的东西。
48:06
how the CPU works as a software engineer
这能给我带来什么?因为在大多数情况下,即使在学术界或 computer science 里,你懂的,
48:08
who is not a gamesable or I'm not doing low level stuff.
谁不是玩家,所以我不会做 low-level 的东西。
48:11
What does that give me because for the most part,
这能给我带来什么?因为在大多数情况下,
48:16
even in academia or in computer science, you know,
即使在学术界或计算机科学领域,你知道,
48:19
there is some level of some basic CPU theory taught,
会教一些基础的 CPU 理论,
48:23
but usually we just kind of we stop at the code,
但通常我们就停在 code 那里,
48:26
okay, maybe you look at the assembly
好吧,可能你会看看 assembly,
48:28
but you'd really go further than that.
但你其实得走得更远。
48:30
The folks who, you know, you've taught
你知道,那些你教过、学了这些东西的人,你觉得他们从中得到了什么,是在别处得不到的?
48:34
and they learn these things, what do you see them get out
所以你具体说的是对 CPU 的了解这部分?
48:37
of this that they wouldn't otherwise?
他们原本不会有的那些东西?
48:40
So you're talking about specifically the knowing the CPU part.
所以你说的是特别了解 CPU 的那部分。
48:43
Knowing about the CPU, knowing about the details about the
了解 CPU,了解关于它的细节
48:45
CPU because you mentioned that that's also part of it, right?
CPU,因为你提到那也是其中一部分,对吧?
48:48
It's not necessarily just stopping at assembly.
不一定只是在 assembly 就结束了。
48:50
So the reason for that is more the other way around us.
所以这背后的原因其实是反过来的。
48:54
The reason to learn the assembly language is so that you know
学习 assembly language 的原因是为了让你知道
48:57
what the CPU is doing.
CPU 在做什么。
48:58
So it's the CPU part that's actually important
所以 CPU 这部分才是真正重要的,
49:01
and the part that's important about it
以及它重要的地方。
49:03
is that the CPU is basically,
就是说,CPU 基本上,
49:05
you can think of it as a little machine
你可以把它看作一个小机器,
49:08
whose internal yearings we are not privy to
它的内部想法我们是没法知道的,
49:11
because for the CPUs that we care about,
因为对于我们关心的那些 CPU 来说,
49:14
so, you know, an M-series CPU in a Mac,
所以,你懂的,Mac 里的 M 系列 CPU,
49:17
a Zen core CPU in a server or in a laptop
服务器或者笔记本里的 Zen 核心 CPU,
49:21
or an Intel, you know, core series, those sorts of things.
或者 Intel 的,你懂的,Core 系列,诸如此类。
49:25
These CPUs are not documented at the level
这些 CPU 并没有在……层面上被文档化
49:28
where you're going to be thinking about
你会思考的是
49:29
how each little individual part works.
每一个小部件是如何运作的。
49:31
And to that end, it's unclear that you would have time
而且,总而言之,你不太可能有时间
49:34
to do so anyway because these are massive,
去做这些事,因为这些机器是巨大的、
49:36
very complicated machines that we're talking about, right?
非常复杂的机器,对吧?
49:39
But from a high level, from a more black box perspective,
但从宏观层面,从更 black box 的视角来看,
49:42
they are machines that we can think of
它们是我们可以用
49:44
in relatively straightforward ways,
相对直接的方式去理解的机器。
49:47
once we know kind of what their core instructions are
一旦我们大致知道它们的 core instructions 是什么
49:50
that they tend to execute.
也就是它们往往会执行的内容。
49:53
And they break down into a couple different categories.
然后这些可以分为几个不同的类别。
49:56
There's how does data move into and out of a core.
比如数据是怎么进出 core 的。
50:00
And this is basically how like load store units work,
这基本上就是 load store units 如何工作,
50:03
how the cache levels work, L1, L2, L3,
还有 cache 层级怎么运作,L1、L2、L3,
50:07
some we have L0 now sometimes, things like this.
有些现在还有 L0,诸如此类。
50:10
How does that work and why?
这些是怎么工作的,以及为什么?
50:12
What is the granularity of it?
它的granularity是什么?
50:14
What is the policy?
policy是什么?
50:15
How does the CPU go about actually working with those things?
CPU到底是怎么实际去处理那些东西的?
50:18
Understanding that part of the machine is crucial
理解机器的那个部分非常关键。
50:21
because when you're working with a lot of data,
因为当你处理大量data的时候,
50:23
the difference can be massive.
差别可能会非常大。
50:25
If you structure it in one way,
如果你用一种方式去structure它,
50:27
versus structuring it in another way, right?
而不是用另一种方式去structure它,对吧?
50:28
Again, architectural decisions that have nothing to do
再说,architectural decisions 跟 hotspots 无关,
50:31
with hotspots, they're how all the data is laid out
它们就是所有 data 怎么布局的,
50:32
and what the access pattern is, right?
以及 access pattern 是什么样,对吧?
50:34
Things that are very hard to change sometimes.
这些东西有时候非常难改。
50:36
So that's one part of the machine you want to understand.
所以这是你想了解的机器的一个方面。
50:39
Another part of the machine you want to understand
你想了解的机器的另一部分,
50:40
is how the instructions flow through it.
是 instructions 如何流过它。
50:43
And you know, a lot of people have heard about like
而且你知道,很多人听说过比如
50:45
branch misprediction or things like this.
branch misprediction 或者类似的东西。
50:47
I cache misses, there's words that you might hear,
I cache misses,有些词你可能会听到,
50:50
you're not really sure what they mean.
你并不太确定它们是什么意思。
50:51
They're all actually pretty simple to conceptualize.
它们其实在概念上都很简单。
50:54
They're harder to pin down exactly how they worked
但要确切说清它们是如何工作的就比较难了。
50:56
because branch predictors are getting more and more
因为 branch predictors 变得越来越
50:58
complicated and so on.
复杂,等等。
50:59
But you can still categorize the behavior of them
但你仍然可以对它们的行为进行分类。
51:02
and understand how code flows through it
并且理解 code 是怎么在它里面流动的
51:03
and when you might care and when you won't.
以及你什么时候会在意,什么时候不会。
51:05
And then finally, there's the execution unit scheduling part
然后最后,还有 execution unit scheduling 这部分
51:08
which is about knowing what's the raw sort of throughput
这关乎到你知道那种原始的 throughput 大概是什么样子
51:11
for any particular type of operation.
对于任何特定类型的 operation。
51:13
Floating point multiplies into your additions,
Floating point 乘法、加法,
51:16
division, whatever it is that you might want to know, right?
除法,或者其他你想知道的操作,对吧?
51:18
Once you learn a little bit of assembly language,
一旦你学了一点 assembly language,
51:20
you understand what it's reading.
你明白它在读什么。
51:22
You understand how it turns those assembly language
你明白它如何把那些 assembly language
51:24
instructions into micro opt operations
instructions 转换成 micro opt operations
51:26
which it actually does and how they get distributed
这些操作是它实际执行的,以及它们如何被分配
51:29
through that machine.
通过那台机器。
51:30
That flow chart that they put like basically up
那个流程图,他们基本上就是放上去的
51:32
on the we've announced the new Zen core,
在我们宣布新的 Zen core 的时候
51:35
that flow chart, you can look at it and go,
那个流程图,你看着它就会说,
51:38
I know the performance of this machine roughly, right?
我大概知道这台机器的性能,对吧?
51:41
Not exactly because like I said,
也不完全知道,因为就像我说的,
51:42
there's all these little edge cases
有各种小的 edge cases,
51:44
that if you really want to be a crazy optimizer,
如果你真的想当一个疯狂的 optimizer,
51:46
which again, I don't really advocate people do.
但再说一次,我并不真的建议大家这么做。
51:48
I don't think it's important that they be like
我不认为他们需要成为
51:50
crazy hyper optimizers.
疯狂的 hyper optimizers。
51:51
If you like to do it great, it's a lot of fun,
如果你喜欢这么做,那很好,这很有趣,
51:53
but it's not the important part.
但这并不是重点。
51:55
Just look at this, you're like, okay,
你看看这个,就会想,好吧,
51:57
I see what this CPU should be getting in terms of like
我明白这个CPU应该能达到什么水平,比如说,
51:59
what I could do with this size data load,
对于这种规模的 data load,我能做什么,
52:01
that size data load.
那种规模的 data load。
52:02
This is what I could probably get out of it for
这就是我大概能从中得到的结果,如果
52:04
if I was doing a bunch of like,
我在做一大堆,比如,
52:05
how to do a bunch of like math ops on it.
怎么在上面做一大堆 math ops 之类的。
52:07
And I think that's just something
而且我觉得那应该算是意料之中的事吧,
52:10
that should be kind of par for the car,
所以对搞工程的人来说真是抱歉。
52:11
so sorry for engineering.
你花四年时间在学校学这个,
52:12
You go to school for four years to learn this,
没理由几个月学不会。
52:14
there's no reason you can't learn this in a few months.
这没那么难。
52:17
It's not that hard.
是啊,我觉得从工匠精神的角度来看,
52:18
Yeah, I guess just from a craftsmanship perspective,
我们应该熟悉自己的工具。
52:21
we should know our tools,
我们应该了解我们的工具,
52:22
we should know the machines that we're programming.
我们应该了解我们正在 programming 的机器。
52:24
Obviously, we know that our code will be,
显然,我们知道我们的 code 会是,
52:26
if you're doing web, it'll be running
如果你在做 web,它就会运行
52:27
on all these different things,
在这些不同的东西上,
52:28
or if it's mobile on all these different phones,
或者如果是 mobile,就在所有这些不同的手机上,
52:32
but from a conceptual point of view,
但从概念性的角度来看,
52:34
like we should be able to know what's going on.
我们应该能够知道发生了什么。
52:36
So I feel there's a bit of a pride as well.
所以我觉得这里面也有一点自豪感。
52:38
If nothing else, you would learn a bunch of stuff.
别的先不说,你能学到一大堆东西。
52:40
Like I know some of it,
比如我知道一些,
52:41
but I'm now getting motivation to learn more about it.
但我现在更有动力去深入了解它了。
52:44
I do think there's a craftsmanship angle.
我确实觉得这其中有 craftsmanship 的成分。
52:46
I think there's a large number of people who maybe
我觉得有很多人可能
52:49
don't feel fulfilled
并不感到满足
52:51
when I've certainly heard from lots of people
因为我确实听过很多人说
52:53
who when they write something
他们写东西的时候
52:54
and it's just kind of this amorphous high level thing,
然后它就是一种很模糊的 high level 的东西,
52:57
they don't get as much satisfaction out of it.
他们从中得不到多少满足感。
52:59
And then when they learn how they can look
然后当他们学会了如何更深入地
53:01
more deeply at what's going on,
去看正在发生的事情,
53:03
they feel much more satisfied.
他们会觉得满足得多。
53:05
Even if they didn't change what level they were programming at,
即使他们没有改变自己编程的 level,
53:08
they feel much more satisfied
他们还是会觉得满足得多,
53:09
that now they know what they're doing.
因为现在他们知道自己在做什么了。
53:10
And it's like, oh, I see.
然后就是那种,“哦,我懂了”的感觉。
53:11
And I understand why this thing was happening this way
我明白为什么这件事会这样发展,
53:14
and this thing was happening that way.
而那件事又会那样发展。
53:15
That's very satisfying.
这真的非常令人满足。
53:17
So there's an aspect of that.
所以确实有这方面的原因。
53:18
I also want to emphasize another part,
我还想强调另一部分,
53:20
which is that it's a percentages game.
那就是这其实是个百分比游戏。
53:23
If we convinced enough library maintainers
如果我们说服了足够多的 library 维护者,
53:26
that this stuff was important
这些东西很重要
53:28
and the libraries all get a lot faster,
然后 libraries 全都快了很多,
53:30
all of a sudden all the people using the library's code
突然间所有用 library 的 code 的人
53:33
gets a lot faster and so on and so forth.
也快了很多,等等等等。
53:35
If the API is start changing to make it easier
如果 API 开始改变,让
53:37
to optimize the libraries
优化 libraries 变得更容易
53:39
because people now thought that through,
因为大家现在想明白了,
53:40
it's infectious.
这玩意儿会传染。
53:42
The more people are doing performance,
做 performance 的人越多,
53:44
the less people need to do performance
需要做 performance 的人就越少,
53:46
if that makes it's kind of paradoxical, right?
这听起来有点矛盾,对吧?
53:48
Well, plus I do think that right now
而且,我确实觉得现在
53:51
they're still an edge in just being performed.
仅仅是被做 performance 这件事本身,就还有优势。
53:53
Again, as you mentioned,
就像你说的,
53:54
but there are categories of software
但有些类别的软件
53:55
that is just winning by being much faster.
就是靠快得多来取胜的。
53:58
And to do that, you need to do this.
要做到那一点,你得这么做。
54:00
And if you know how to do this,
而如果你知道怎么做这件事,
54:02
maybe you're going to spot opportunities
也许你就能发现一些机会,
54:03
to software engineer, maybe right now
去做 software engineer,也许现在
54:06
you're not as happy in your position,
你对自己的职位不太满意,
54:07
but maybe start something or do a side project
但也许可以开始做点什么,或者搞个 side project,
54:09
that turned into full-time thing and so on and so forth.
然后把它变成全职的事情,诸如此类。
54:11
So like I feel there's like,
所以我觉得,就像,
54:13
and worst case, you just learn like net new knowledge,
最坏情况下,你也就是学了些全新的知识,
54:16
which will probably not be as outdated with AI,
这些知识可能不会因为AI而过时得那么快,
54:18
which we'll get into later.
这个我们待会再聊。
54:20
But this stuff, it feels,
但这些东西,感觉起来,
54:21
it just feels very interesting, right?
就是非常有意思,对吧?
54:23
That kind of, it moves your brain.
那种感觉,会让你的大脑动起来。
54:24
It does.
确实。
54:25
And thankfully like it's also not that hard
而且还好,它也没那么难。
54:29
to update your knowledge
为了更新你的知识
54:30
because again, you get these presentations
因为再说,你会看到这些演示
54:33
that the CPU companies give
就是CPU公司给的
54:34
and they're like, here's the changes we made.
然后他们就说,这是我们做的改动
54:36
So you kind of are aware every time a new thing gets to,
所以你就会留意到每次有新东西出现
54:39
you know, there's little tiny things that creep in
你知道,总有些细微的东西悄悄混进来
54:41
that you don't, that you know,
你没注意到的,你懂的
54:43
but again, there's people out there
但再说,外面总有人
54:44
who are running lots of micro benchmarks
他们在跑大量的 micro benchmarks
54:46
that you will find out about
你之后会了解到的
54:47
and they often uncover these for you as well, right?
而且他们经常也会帮你发现这些问题,对吧?
54:50
So I want to talk about games.
所以我想聊聊游戏。
54:52
You've been, you've built games for decades at this point.
你到现在已经开发游戏几十年了。
54:57
Can you give an overview for those of us
你能不能给我们这些
55:00
who are not in the games industry?
不在游戏行业的人,简单介绍一下?
55:02
How is a game typically built
一款游戏通常是怎么做出来的?
55:05
from the games that you know of that you've observed
从你知道的、你观察过的那些游戏来看,
55:08
or you worked on, especially trying to compare for,
或者你参与过的,尤其是想对比一下,
55:11
you know, like a typical SaaS or distributed system
你知道,就像一个典型的SaaS或者distributed system,
55:13
or something we're building up a website or a service
或者我们在搭一个网站或服务,
55:16
is kind of you plan this stuff.
就是你要先规划好这些东西。
55:18
You, you know, we'll do an estimate.
你,你知道,我们会做个估算。
55:20
We'll build it in a few months or a few weeks with deploy it.
我们会用几个月或几周时间做出来,然后deploy。
55:23
And then we monitor it
然后我们再monitor。
55:24
and then we keep tweaking it
然后我们一直在 tweak 它
55:25
and then you know, fast forward five years later
然后你知道,五年后快进一下
55:27
it's now this like gigantic thing with microservices
它现在变成了一个用 microservices 搭起来的庞然大物
55:30
but it keeps evolving, right?
但它一直在进化,对吧?
55:31
Like it's, we do this like a lot of prototyping thing.
就像,我们会做很多 prototyping 之类的事儿
55:34
For games, it's pretty obvious, right?
对于游戏来说,这很明显,对吧?
55:36
From the get-go-vators we're talking like there,
从一开始我们就在说,会有一个 launch
55:38
there will be a launch.
会有一个发布。
55:39
But can you, when you're inside
但你能不能,当你在里面的时候
55:41
or when you join a game studio,
或者当你加入一个 game studio 的时候,
55:44
like what would you observe there
你在那里会观察到什么,
55:46
in terms of what the process is like
关于这个过程是怎么样的,
55:47
and how it's different or how it feels weird
以及它有什么不同,或者感觉奇怪的地方,
55:50
compared to like this, I guess I don't,
相比于这个,我想想,我不太确定,
55:51
the traditional software, SaaS software,
传统的 software、SaaS software,
55:53
whatever development that is.
不管那是什么样的开发流程。
55:54
So I guess with what I would say is unfortunately
所以我想,我得说,不幸的是
55:57
I'm probably the wrong one to ask
我可能不是该问的人
55:58
because my knowledge is outdated at this point
因为我的知识现在已经过时了
56:02
because one of the things that has happened
因为最近游戏领域发生的一件事是,我觉得它们变得更接近了
56:04
to games recently is I feel like they've moved closer.
我不想说完全是开发实践上的
56:08
I don't want to necessarily say entirely in development practices
但至少在产品本质上
56:11
but at least in terms of the nature of the product
已经有了相当大的变化
56:16
has changed somewhat dramatically
已经有些戏剧性地改变了。
56:19
to be more like something like SaaS
变得更像某种 SaaS 那种模式
56:22
where if you take some of the most popular things
也就是说,如果你看那些最流行的东西
56:26
that are being, in terms of dollars, let's say.
从收入金额上来说,算是吧
56:28
So I guess maybe popular might be hard to say specifically
所以我觉得“流行”可能不太好具体定义
56:32
but let's just say revenue generating.
不如就说是能产生收入的吧
56:34
So if we were to measure the total games industry revenue
所以如果我们去衡量整个游戏行业的收入
56:37
and you look at what are the largest slices of that,
再看看其中占比最大的几块
56:41
you're seeing things like Fortnite, like Roblox,
你会看到 Fortnite、Roblox 这类东西
56:44
like Grand Theft Auto 5 Online, et cetera, et cetera,
像 Grand Theft Auto 5 Online 啦,等等等等,还有 Minecraft。
56:48
Minecraft.
这些东西开始越来越像那种 always-on live service,就是我们不断给客户推增量功能那种路子。
56:49
These things are starting to look a lot more
所以其实我觉得你问错人了,要从内部看具体是什么样,我并不合适回答。
56:52
like an always on live service
就像一个始终在线的 live service。
56:55
kind of we ship incremental features to our customers
有点像我们向客户交付增量功能。
57:00
kinds of things.
诸如此类的事情。
57:01
And so I would actually say that I'm the wrong one to ask
所以其实要我说,你问我是问错人了。
57:06
about what that actually looks like from the inside
关于这事从内部看到底是什么样子的。
57:08
because I haven't actually gone and worked
因为我没有真的去那些公司工作过
57:10
at one of those companies.
我有朋友在那儿所以会听到一些消息
57:11
I have friends there so I hear things
但我不适合给出准确的描述
57:13
but I'm not the right one to give it an accurate picture of it
不过从我的角度来看我只会指出
57:16
but I just would point out from my perspective
游戏行业的做法现在看起来不一样了
57:19
the game industry practices look different today
比起我当初更深入接触我们在实际造那些东西的时候
57:21
than they did when I have a more intimate sort of experience
比他们当时有更切身体验的时候
57:25
with what we were actually building.
与我们实际建造的东西。
57:27
But can we talk about it when you were building games
但我们可以聊聊你当时做游戏的时候吗?
57:30
which was 10 plus years ago
那是十多年前了。
57:31
when I understand these were the games where they were built,
据我所知,这些游戏是那种做好了之后,
57:35
they were launched, maybe they got a patch or two
上线了,可能打了一两个 patch,
57:38
and then they were kind of the team moved on,
然后团队差不多就继续往前了,
57:40
they were disbanded.
大家就解散了。
57:41
It was the time box thing that was a lot of development,
它就是那种 time box 的开发,开发量巨大,
57:44
a big launch and it was it went big, huge hit
一个大上线,然后就火了,成了巨大的爆款。
57:48
or huge failure right in that the studio was bankrupt.
或者说是个巨大的失败,就是那个工作室破产了。
57:52
So how did that work?
那这怎么行得通?
57:53
Because I feel that's a world where, okay,
因为我觉得那是一个世界,好吧,
57:55
today a bunch of games don't have those constraints
现在的很多游戏都没有那些限制,
57:57
but it has a bunch of constraints
但它有很多限制,
57:58
and I'm interested in what worked in those constraints.
而我对在那些限制下什么能行得通很感兴趣。
58:03
So in the early days,
所以在早期的时候,
58:05
you didn't have licenseable engines.
你还没有 licenseable engines。
58:08
So up until sort of the point like nowadays,
所以差不多到现在这个阶段吧,
58:12
like this is why I say it's a lot different now
这就是为什么我说现在的情况
58:13
than it used to be.
跟以前已经大不一样了。
58:14
Nowadays you think of web development
现在你想到 web development,
58:16
like I'm gonna go grab like a thing like react
就会说我要拿个像 react 这样的东西,
58:18
and I'm gonna make this thing or whatever.
然后做点什么之类的。
58:20
I'm gonna go grab off the shelf database thing,
我会去拿个现成的 database 之类的东西,
58:22
Postgres or Oracle or I don't know
Postgres 或者 Oracle 或者我也不知道了。
58:24
like what would be the thing of choice, right?
比如说,什么会是首选呢,对吧?
58:26
But by the way, just definitely Postgres
但顺便说一句,绝对是 Postgres。
58:27
and not Oracle for most people.
对大多数人来说,不是 Oracle。
58:29
Okay, sorry.
好吧,抱歉。
58:30
Postgres, I didn't want to slight anybody there.
Postgres,我不是想冒犯任何人。
58:32
So I apologize.
所以我道歉。
58:33
So, okay, definitely Postgres, sorry Oracle.
所以,好吧,绝对是 Postgres,抱歉了 Oracle。
58:35
Yeah.
是的。
58:36
So you're gonna go use some kind of a variant
所以你会去用某种变体,
58:39
of one of these off shelf databases and so on.
来自这些现成的 databases 之类的。
58:40
That's more like I said,
那更像是,如我所说,
58:42
what people might be doing nowadays too.
现在人们可能也会这么做。
58:43
They'll grab the Unreal Engine.
他们会直接用 Unreal Engine。
58:45
They're not gonna develop an engine on their own.
他们不会自己去开发一个引擎。
58:46
They'll grab back and server stuff from people.
他们会从别人那里拿 backend 和 server 的东西。
58:49
It might even be Postgres in there, right?
里面甚至可能就有 Postgres,对吧?
58:51
Like who knows?
就像,谁知道呢?
58:52
In the earlier days,
早先的时候,
58:53
none of this stuff existed for games.
游戏领域还完全没这些东西。
58:55
I actually worked like I said in middleware at the time.
我当时其实就像我说的,在做 middleware。
58:58
So I was actually sort of one of the people
所以我算是那批人之一,
59:00
who was working at the time on maybe changing that a little
当时在做的可能就是想稍微改变一下这个现状,
59:03
like producing code that would get reused throughout games
比如产出一些能在不同游戏里复用的 code,
59:05
which was actually fairly rare.
这在当时其实相当少见。
59:07
And so back in the day,
所以說以前啊,
59:08
every game built their own Unreal Engine, for example.
每個遊戲都有自己的 Unreal Engine,比如說。
59:11
Correct.
對。
59:12
And so yeah, yeah, yeah.
所以對對對。
59:14
And so really early on, right?
所以很早的時候,對吧?
59:17
If you rewind the clock far enough,
如果你把時間往回倒得夠遠,
59:20
then yeah, the degree to which people were reusing code
那時候,人們重用 code 的程度,
59:25
for their think for like their rendering engine,
為了他們的東西,像是 rendering engine。
59:27
it'd be like,
就好像是,
59:28
cause I got some code from like Dave or whatever
因为我从比如Dave或者谁那儿搞到一些代码
59:30
who was, or we were both at Atari
他是——或者说我们俩都在Atari
59:33
and somebody wrote this good routine.
然后有人写了个很好的routine。
59:35
So we used it, right?
所以我们就用了,对吧?
59:36
There was that kind of thing,
当时确实有那种事,
59:38
but there wasn't like this sort of set engine.
但没有像这种set engine之类的东西。
59:40
And the time when that sort of maybe you could say
而那时候,那种,也许你可以说
59:43
first started happening a little more widespread
最开始变得更普遍一点
59:46
was with things like what it software did
是在像 id Software 做的事情上
59:49
where they sort of started having like,
他们就开始有点像是
59:51
oh, you know, like someone's gonna build something
哦,你知道,就像有人会搞点东西
59:53
with the Doom engine
用 Doom engine
59:54
or someone's gonna build something with the Quake engine.
或者有人会用 Quake engine 搞点什么
59:56
There was also the build engine at the time
当时还有 build engine
59:59
made by Ken Silverman and some things like that.
是 Ken Silverman 做的,诸如此类
60:00
So there were some early cases where a few people
所以有一些早期的案例,少数几个人
60:04
would make a game,
会做一个游戏,
60:05
but they were making a game very much like that.
但他们做的游戏跟那个非常相似。
60:07
Like if we did the Doom engine,
比如如果我们做了 Doom engine,
60:08
we're gonna make a game very much like Doom.
我们就会做一个很像 Doom 的游戏。
60:10
So it really was the case that for most games,
所以确实,对于大多数游戏来说,
60:12
people were rebuilding most of the things from scratch,
人们基本上是从零开始重建大部分东西,
60:15
at least for their studio.
至少对他们自己的工作室来说是如此。
60:17
And studios often their existing code base
而且工作室往往他们现有的 code base
60:20
was kind of part of the value of the studio too.
也算是工作室价值的一部分。
60:23
Like if you are think blizzard
比如说你想一下 Blizzard,
60:25
and we just built Warcraft One
我们刚做出 Warcraft One,
60:27
while rolling all of that knowledge
然后把所有这些知识
60:29
and code into Warcraft Two is a huge advantage for us
和代码都融进 Warcraft Two,这是很大的优势,
60:33
because everybody else who wants to build a competitor
因为其他任何人想做竞品
60:36
to Warcraft One has to do all of that from scratch.
来跟 Warcraft One 竞争,都得从零开始做这些。
60:39
You have to make the path fine.
你得把路径做好。
60:40
You have to make the level editing tools.
你得把关卡编辑器做出来。
60:41
They have to make the rendering.
他们得搞定渲染。
60:43
They have to make whatever.
他们得搞定其他的东西。
60:44
And so, you know, that was how things were traditionally done.
所以你看,传统上事情就是这么做的。
60:48
No wonder the game's industry is so secretive
难怪游戏行业这么保密,
60:50
compared to the rest of the software
跟其他软件工程行业比起来,真的,太夸张了。
60:52
engineering industry like the seriously.
engineering industry,说真的。
60:54
Used to be.
以前是这样。
60:54
Used to be at least.
至少以前是这样。
60:55
Yeah, maybe now it's changing.
是啊,也许现在在变。
60:57
And so there were two really big risks typically
所以通常有两个很大的风险,
61:00
when you started a game project in those days.
在那时候,你开始一个游戏项目时。
61:03
One was the engine risk.
一个是 engine 风险。
61:05
Would we be able to make something
我们能否做出一个东西,
61:07
that would be technically able to do what we need to do
在技术上能满足我们的需求?
61:11
for this game?
对这个游戏来说?
61:13
And that risk comes in a lot of flavors.
而这种风险有很多种形式。
61:15
One, will it happen at all?
第一,它到底会不会发生?
61:17
Two, will it happen fast enough for us
第二,它会不会发生得足够快,让我们
61:19
to actually reliably build the game on it?
能够真正可靠地基于它来构建游戏?
61:23
Right?
对吧?
61:24
One of the things, I mean, I don't know how detailed
其中之一,我是说,我不知道你想要多详细的
61:26
and answer you're looking for for this question.
回答,针对这个问题。
61:27
So stop me if I'm going down to many tangents.
所以如果我开始扯到很多题外话,你就打断我。
61:29
But one of the things you also have to remember
但你还得记住一点,
61:32
is that at that time, and this is sort of still true today,
那就是在当时——而且今天某种程度上也依然如此——
61:35
but at that time was very important,
但在当时这一点非常重要:
61:37
there was no way to really buy something
你实际上根本买不到
61:40
all that much faster than what you had.
比你手上现有的快得多的东西。
61:42
There was not a huge strata of PCs
当时并没有很多不同档次的 PC,
61:44
that you could, you know, buy or something like that.
能让你,你懂的,去买一台或者什么的。
61:46
So the rendering engine,
所以 rendering engine,
61:48
there wasn't like a way your level designers could like
并没有一种方式让你的 level designers 可以
61:50
be playing on a faster thing
用更快的硬件来玩
61:52
than the consumer would have really.
比消费者实际会有的还要快。
61:54
You can only have the machine that you have now.
你只能用你现在有的这台机器。
61:57
And if this game comes out in a year
如果这个游戏一年后发售,
61:58
that sort of roughly what the consumers might have
那差不多就是消费者可能有的配置
62:00
or a little bit, but, you know,
或者稍微好一点,但是,你懂的。
62:01
so there are people who started doing things
所以有些人开始搞些事情
62:02
like buying SGI workstations
比如买 SGI workstation
62:04
because those were actually faster enough, right?
因为那些机器速度确实够快,对吧?
62:06
And things like that is what, you know,
然后类似的事情就是,你知道,
62:09
you kind of had to do and so on.
你基本上不得不这么做,等等。
62:11
So anyway, so there was a huge engine risk
所以总之,当时有巨大的 engine 风险
62:14
and some games just failed
然后有的游戏就失败了
62:15
because they couldn't produce a thing
因为它们什么都做不出来
62:16
that could technologically do what they needed.
在技术上能做到他们需要的。
62:18
You saw houses who survived on technological prowess.
你看到了靠技术实力存活下来的公司。
62:22
You had id software that was kind of unrivaled
还有 id Software,算是无人能敌。
62:25
at making those kind of first person engines.
在制作那种 first-person engines 上。
62:27
You had bullfrog who had this engine,
还有 Bullfrog,他们有一个引擎,
62:28
those pseudo three engine that they did
就是他们做的那个 pseudo-3D engine,
62:30
for like the race games magic carpet, dungeon keeper,
用来做那些 RTS 游戏,比如《Magic Carpet》《Dungeon Keeper》,
62:32
like they were all based on this, you know, one core attack
它们全都是基于这个,你知道,一个 core attack。
62:35
and all the sorts of things.
还有各种乱七八糟的事情。
62:37
There's that engine risk.
那个engine的风险是存在的。
62:38
That was huge and how do you mitigate it?
那风险特别大,你怎么缓解?
62:40
You did it.
你做到了。
62:41
You were just grit, right?
你就是靠一股韧劲硬扛的,对吧?
62:43
Because there wasn't a way to buy one off the shelf
因为那时候根本没现成的可以买,
62:44
so you were just kind of gritting it to you.
所以你只能硬撑着把它搞出来。
62:46
The other big risk and this one is still so much true today,
另一个大风险,而且直到今天依然非常真实。
62:49
but it's just much less
但就是少得多。
62:50
because you can start, you could do prototyping early.
因为你可以开始,你可以早点做 prototyping。
62:53
The risk is is the game any good?
风险在于,这个游戏到底好不好?
62:55
Like what are we building?
比如说,我们在构建什么?
62:57
Is it interesting? Is it fun?
有趣吗?好玩吗?
62:58
And when you think about this problem of
而且当你思考这个问题时,
63:00
we can't even really run the game as it will be
我们甚至无法真正运行最终版的游戏,
63:02
because we're just building this engine
因为我们只是在构建这个 engine。
63:04
and we don't even really have a way
而且我们其实根本没什么办法
63:05
to test the game super well
把游戏测试得特别好
63:07
and we can't really build much of a final level
而且我们真的做不出多少 final level 的内容
63:09
because we don't have level editing tools yet.
因为我们还没有 level editing tools
63:11
Those are just coming online.
这些工具才刚刚上线
63:12
Trying to guess what you are actually going to be shipping
要猜你实际上会发布什么
63:15
in terms of gameplay is incredibly hard
就 gameplay 而言,这简直太难了
63:17
and there are games, famous games.
而且有些游戏,著名的游戏
63:20
I want to say like thief the dark project.
我想说,比如《Thief: The Dark Project》。
63:22
A very famous game looking glass game
一个非常著名的Looking Glass游戏,
63:25
was formative in the stealth genre,
在潜行类型中具有开创性,
63:26
lobster franchise, which was thief.
龙虾系列,也就是Thief。
63:28
You know, I want to say everything I heard
你知道,我想说,
63:31
from people on that team was that like
我从那个团队的人那里听到的,
63:32
the final core gameplay only sort of came together
就是最终的core gameplay差不多
63:35
like right at the end, right?
到了最后才拼凑到一起,对吧?
63:36
And so the game just could have been a lot more
所以这个游戏本来可以做得更好
63:39
could have been polished a lot more
本来可以打磨得好得多
63:41
but it's just the timing
但问题就在于时机
63:43
of these things coming together was so hard
这些事情要凑到一起太难了
63:44
and so it really was an incredibly different thing
所以这真的是一个非常不一样的东西
63:47
and nobody really had a way around it.
而且没人真正有办法绕开它
63:50
Eventually, there was sort of this push towards something
最后,就有了一种向某个东西推进的势头
63:54
well, it was basically early vertical slice prototyping
嗯,基本上就是早期的 vertical slice prototyping
63:57
where as games started getting bigger
而随着游戏越做越大
63:58
and people were like, we can't keep doing this
大家就觉得,咱不能老这么干
64:00
especially if we're gonna be putting millions of dollars
尤其是要是砸几百万美金进去
64:02
and I'm like, this is not like an option, right?
我就想,这根本不是一个选项,对吧?
64:04
They started to move toward this thing about look.
他们开始转向这样一种思路——听着
64:06
What we're gonna do is we're gonna focus the entire studio
我们要做的就是让整个工作室集中精力
64:09
on building one vertical gameplay slice
去构建一个 vertical gameplay slice
64:11
as fast as we can, as hacky as we can,
能多快就多快,能多 hacky 就多 hacky
64:14
whatever we have to do do that.
不管我们得做什么,就去做。
64:17
Prove that that is engaging to play
证明它玩起来确实有吸引力。
64:20
and then start building out everything else
然后再开始构建其他一切。
64:23
because we simply can't afford to not know what that thing is
因为我们根本承受不起不知道那是什么的后果。
64:27
and then we can start building like spreadsheets
然后我们就能开始做表格之类的。
64:29
and the schedule, what are the assets we need
还有时间表,我们需要哪些 assets。
64:31
because that we actually believe in the thing,
因为那样我们才会真正相信这个东西,
64:34
we can see it running and it fills in all those details, right?
我们能看到它跑起来,然后它会把所有细节都填上,对吧?
64:37
And that I believe, you know, I'm not a game historian
而且我相信,你知道,我不是游戏历史学家
64:40
so take what I'm saying with a huge grain of salt,
所以对我说的这些,你得多打个折扣
64:42
that I believe was a pretty big paradigm shift
我相信那对整个行业来说是一个相当大的 paradigm shift
64:45
for the industry when they started like,
当他们开始,比如说,
64:46
okay, we gotta actually know
好吧,我们得真正搞明白了
64:48
and it became much less seed of the pants after that if you will.
在那之后,事情就变得不那么凭感觉了,可以这么说。
64:52
Now, I'm interested in your observation.
现在,我对你的观察很感兴趣。
64:53
I know you're not a game historian
我知道你不是游戏历史学家
64:55
but you were in the industry and you still remain connected to it.
但你在业内,而且你至今仍和它保持联系。
64:59
What happened when game engines became widespread,
当 game engine 变得普及时,发生了什么?
65:03
they became not only in licenseable
它们变得不仅可授权,
65:06
like we're talking about unreal engine for larger studios
就像我们说的 Unreal Engine 是给大型工作室的,
65:09
but ones like Unity or Go-Dot,
但像 Unity 或 Go-Dot 这类,
65:12
which now amateurs could also afford
现在业余爱好者也负担得起了。
65:14
or I mean, amateurs in the sense that your college kid
或者说,我指的是那种业余,比如你家上大学的孩子,
65:17
or you do some side project
或者你自己做点 side project。
65:19
you can already afford license
你已经能付得起 license 了。
65:21
and you can build stuff because now that risk has gone
而且你可以做东西了,因为那个风险已经没了。
65:23
for clear the studio, so that risk is eliminated.
对于 clear the studio,那个风险就被消除了。
65:26
And it also, I guess it now opened up
而且,我猜,它现在也开放了
65:28
so much more people who can now have a shot at creating a game
给更多现在有机会尝试制作游戏的人。
65:32
because you no longer have to either have this massive amount
因为你不再需要要么有这么大一笔钱
65:35
to license, this super expensive game engine,
去 license 这个超级贵的 game engine,
65:38
you no longer have that risk, the only risk is a fun.
你不再有那个风险了,唯一的风险就是好不好玩。
65:42
What have you observed happened
你观察到发生了什么
65:44
in terms of both for the industry
在行业方面
65:45
for development, pace, those kind of things?
发展速度之类的?
65:49
And the reason I'm asking
我问这个的原因是
65:50
because I wonder if there's gonna be a parallel with AI
因为我想知道会不会和AI有类似情况
65:53
where okay, you know, you need to have an engineer
就是说,你知道,你需要有一个工程师
65:56
who has nailed it, right?
他真正掌握了,对吧?
65:58
I feel games might give us a hint
我觉得游戏可能会给我们一些提示
66:01
of what we might expect at the broader industry.
关于我们在更广泛行业中可以期待什么。
66:03
So that is actually, I would say that's a brilliant analysis
所以这实际上,我得说那是个精彩的分析
66:06
of the situation for not having lived through games
对于没有亲身经历过游戏行业的人来说
66:08
and for noticing that that's impressive.
并且能注意到这一点,真是令人印象深刻。
66:11
I'll say that first.
我首先要这么说。
66:13
And I totally agree with that.
而且我完全同意。
66:15
I've said to people in the past
我过去就对一些人说过
66:17
who have asked about sort of AI impact on games in that sense.
那些问过AI对游戏行业影响的人,就是在这个意义上。
66:22
And I've sort of said as much,
我也算是这么说过,
66:24
I've said like the licenseable engine thing
我说过那个 licenseable engine 的事情,
66:27
kind of was our AI transition already, unfortunately.
其实就已经算是我们的 AI 转型了,不幸的是。
66:31
And I regret to inform you that the news is not
而且我很遗憾地告诉你,这个消息
66:35
probably that positive.
可能不是那么乐观。
66:36
So there are some definite positive things
所以确实有一些正面的东西,
66:40
that happen early on because as you say,
在早期就出现了,因为就像你说的,
66:43
it opens up the ability to make games
它带来了制作游戏的能力。
66:45
to people who could not have
给那些本不可能
66:47
marshaled the technical sort of the technical staff,
组织起那种技术型的技术人员,
66:52
necessary to produce a competitive engine.
是打造有竞争力的 engine 所必需的。
66:55
And so giving them the ability to make games
所以给他们制作游戏的能力
66:58
is a pretty important thing.
是一件非常重要的事。
66:59
And it allows a bunch of people to make sort
而且它让很多人能够做出一些艺术表达,是他们原本根本做不到的。
67:02
of some artistic expressions
确实。
67:03
that made they just wouldn't have been able to do.
这种事情确实还是会偶尔发生。
67:07
Early on that tends to be a net positive
早期这通常利大于弊,
67:09
because you just have some more games coming out.
因为就是会有更多游戏冒出来。
67:12
Maybe some of them aren't that good,
可能有些游戏不怎么样,
67:13
but some of the existing games aren't that good.
但现有的游戏也有不怎样的。
67:16
That's not that different.
其实差不多。
67:17
But then you get some really cool games coming from some sources
但之后你会看到一些很酷的游戏,来自某些来源,
67:19
that just simply wouldn't have been able to do it.
这些来源以前根本不可能做到。
67:21
Thumbs up.
点赞。
67:22
Problem is it rapidly kind of accelerates
问题是它很快就会加速
67:27
into this kind of a nasty scenario
演变成一种很糟糕的局面
67:29
where you just have massive numbers of releases.
就是发行量巨大,游戏数量爆炸。
67:33
And I think at this point, we're at the point
而且我觉得现在我们已经到了这种地步
67:36
where I wanna say steam games are in the like tens of thousands
我想说 Steam 上的游戏大概有成千上万款
67:40
or a hundred thousand per year or something
或者每年十万款左右吧
67:43
like that it's so massive that there is no way
数量大到这种程度,根本不可能
67:48
that your game will be organically noticed
让你的游戏自然地被注意到
67:49
any more pretty much period.
基本上没有了,就这样。
67:51
So essentially it's this really nasty problem
所以本质上这就是个非常麻烦的问题,
67:54
where you just have the market flooded with products.
就是市场被产品淹没了。
67:58
And there used to be that if you made a quality game,
而且以前是,如果你做了一款精品游戏,
68:02
if it was fun, people would find it
如果它好玩,人们就会找到它,
68:05
because there were so few games that someone would play
因为游戏太少了,有人会去玩
68:08
the fun one and tell people about it
那个好玩的,然后告诉别人,
68:10
and it would get purchased, right?
然后它就会被买走,对吧?
68:11
Word of mouth or just exposure on a storefront
口口相传,或者只是在商店橱窗里露个面
68:14
would be all you really needed to get the word out
就足以让大家都知道
68:18
about a game.
一款游戏的存在了。
68:18
You didn't need a huge marketing budget or anything like that.
你根本不需要庞大的营销预算之类的东西。
68:21
Fast forward to today where we have
快进到今天,我们现在有
68:23
this massive influx of games.
海量的游戏涌入。
68:24
Again, pre-AI, it's just because now the barrier
再说一遍,在 pre-AI 时代,就是因为现在的门槛
68:28
to entry is very low.
变得非常低了。
68:31
And you really need a strategy
而且你真的需要一套策略来确保你的游戏能被发现。
68:34
to make sure your game gets found.
有没有可能,有时候一个没有什么营销计划、什么都没有的小独立游戏,会被发现然后成为超级大爆款?
68:36
Is it possible that sometimes a small indie game
绝对可能。
68:41
with no marketing plan or nothing will get discovered
这种情况确实还是偶尔会发生的。
68:45
and become a huge hit?
但你成为那个游戏的几率,基本等于零。
68:46
Absolutely.
你玩那个游戏的几率几乎是零。
68:47
It does still happen once in a while.
人们玩 Minecraft、花时间玩 Minecraft,或者类似的事情,就是他们在这里做的事情。
68:49
The chances that you will be that game are like zero.
你成为那个游戏的几率几乎是零。
68:52
So you kind of now need a marketing strategy,
所以你现在差不多需要一套营销策略,
68:57
a real marketing strategy and going into the market
一个真正的营销策略,然后进入市场,
69:02
for games without one and expecting
对于游戏来说,如果没有营销策略,却指望
69:05
to sell any significant number of copies
卖出任何可观的份数,
69:07
above maybe a few thousand at best is really unwise.
超过可能最多几千份,这真的很不明智。
69:12
If you want to hit reasonable numbers of sales
如果你想达到合理的销量,
69:14
of a game, you have to have an idea
对一个游戏来说,你必须知道
69:16
of how people will find out about this game.
人们会如何发现这个游戏。
69:20
So if I'm getting this right,
所以如果我没理解错的话,
69:22
it sounds like the game itself being good as table stakes
听起来游戏本身做得好只是基本门槛,
69:25
but not enough of its own, right?
但光有它还不够,对吧?
69:27
That distribution of marketing,
营销分发,
69:28
getting people to hear about the game
让大家知道这款游戏,
69:30
is much more of the differentiator
才是更关键的差异化因素。
69:32
because there's just too many good games out there
因为市面上好游戏太多了,
69:35
and now they're easier to create.
而且现在它们也更容易被创作出来。
69:37
I think that's exactly right.
我觉得那完全正确。
69:38
And that's just the unfortunate reality of it now.
而这就是现在无奈的现实。
69:42
Was that a good trade?
那是一笔好交易吗?
69:44
I don't know, but that's what happened.
我不知道,但事实就是这样。
69:46
And so that's where we are in the industry now.
所以这就是我们行业现在的状况。
69:48
There's this other thing that I heard about
还有一件事我听说过,
69:50
which is how new games not only compete
就是新游戏不仅会竞争,
69:52
with other new games but with old games as well, right?
与其他新游戏,还会与老游戏竞争,对吧?
69:56
Like the other day I spent a few hours playing Death Rally
就像前几天我花了几小时玩 Death Rally
69:58
which is a game from the 90s.
那是一款90年代的游戏。
70:00
And every year there's more and more good games to play.
而且每年都有越来越多好游戏可以玩。
70:03
They all take away from the time
它们都会占用时间
70:04
that the new games have.
那些本来属于新游戏的时间。
70:06
Yes and that problem will only get worse
是的,而且这个问题只会更严重
70:09
because one of the things that the game industry
因为游戏行业
70:11
could rely on in the past
过去能依赖的其中一件事
70:13
that is much harder to rely on now
那现在很难依赖了。
70:16
is that older games would look dated technologically
就是老游戏在技术上会显得过时,
70:20
in ways that consumers cared about.
在消费者在意的方面。
70:23
And we have now kind of also crossed the threshold
而且我们现在也算是跨过了那个门槛,
70:26
where there is a segment of the market
市场上有一部分人
70:30
where people really do care about the latest
是真的在意最新的东西,
70:33
like ray traced lighting and all these sorts of things
比如 ray traced lighting 之类的,
70:36
and more photorealistic rendering or whatever it is.
还有更 photorealistic rendering 什么的。
70:39
But a large portion of the gaming market by revenue
但按收入计算,游戏市场的很大一部分
70:43
doesn't really care what the game looked like all that much
其实并不太在意游戏画面看起来怎么样
70:47
in a sense that whatever we're doing today is good enough.
从某种意义上说,我们今天做的已经够好了
70:50
So 10 years from now if the games look much better
所以如果十年后游戏画面好得多
70:54
for some reason, no one will really think of that
出于某种原因,也没人会真把这当成
70:56
as a huge differentiator in terms of sales.
销售上的巨大差异化因素
71:00
You go back to 1995 and technological advances
你回到1995年,技术进步
71:04
where a huge differentiator in terms of sales.
才是销售上的巨大差异化因素
71:06
You come out with something that looks good
你推出一个看起来不错的东西
71:08
that takes advantage of the hardware of that day
充分利用了当时的硬件
71:10
and boy, did it look cooler and feel more responsive
而且,哇,它看起来更酷,用起来也更灵敏
71:13
and all these other things as compared to earlier titles, right?
和之前的游戏相比,还有其他种种优势,对吧?
71:16
And so that's also going to increase the degree
所以这也会提高
71:20
to which the thing that you're talking about will happen.
你所说的事情发生的程度。
71:22
I can go play an older game
我可以去玩一个老游戏
71:23
because it doesn't feel obviously dated
因为它不会让人感觉明显过时
71:26
in an audio visual way.
用视听的方式。
71:27
I don't have to be an appreciator of retro gaming
我不必是复古游戏的爱好者。
71:30
to go play something from 2017.
去玩一个2017年的游戏。
71:33
It just looks fine, probably, right?
它看起来还行,大概吧,对吧?
71:35
So there's that.
所以就是这样。
71:37
The other thing that I'll just mention
还有一件事我想顺便提一下。
71:38
which we kind of already touched on
我们算是已经谈到过一点。
71:39
by the ties directly into your point
通过这种联系直接指向你的观点。
71:41
is that also live service is such a prominent thing now.
是不是因为现在live service真的太突出了。
71:46
People are just logging on and playing Fortnite
人们就是上线玩Fortnite,
71:49
for several hours or something.
一玩就是好几个小时。
71:50
That's also taking away from the possible revenue
这也在蚕食那些本来可能花在买indie game上的收入,
71:54
that might be spent on buying some indie game
甚至是一些新的AAA game。
71:56
or some new AAA game even.
所以就有了这些现存的巨头,
71:58
So you have these sort of incumbents,
人们玩Minecraft,把时间都花在玩Minecraft上,
72:00
people playing Minecraft, spending their time playing Minecraft,
人们玩Minecraft,花时间玩Minecraft,
72:03
spending their time playing League of Legends or Dota
把时间花在打League of Legends或Dota上
72:05
and that's taking up a huge amount of their time.
这占用了他们大量时间。
72:08
That's, it's zero sum, right?
这就是零和,对吧?
72:10
They can only spend their hours in certain places
他们只能把时间花在某些地方
72:13
just like Netflix or anywhere else.
就像Netflix或任何其他地方。
72:15
So they have to start thinking about, you know,
所以他们得开始考虑,你知道,
72:16
they're competing with everyone else for entertainment hours.
他们在和其他人争夺娱乐时间。
72:19
Okay, so I need to ask you this.
好,那我得问你这个问题。
72:21
GTA VI.
GTA VI。
72:22
How is that in 2026 at a time when we have better tools
2026年了,我们拥有比以往更好的工具,
72:26
than we have ever before
比任何时候都强,
72:27
and we can build software and games faster than before.
而且我们开发软件和游戏的速度也比以前更快。
72:30
Like how do games take 10 plus years to develop?
那为什么游戏还要花十年以上来开发?
72:34
Is this some kind of outlier
这算是一种特例,
72:35
or has AAA game development
还是说AAA游戏开发
72:38
taking many, many years just not changed at all?
需要很多很多年这件事,其实根本没变过?
72:40
What do you think is going on here?
你觉得这是怎么回事?
72:42
So from a player's perspective,
所以从玩家的角度来看,
72:44
I can understand why someone would look at it and go,
我能理解为什么有人看到这个会说,
72:46
wow, GTA VI has been in development a long time.
哇,GTA VI 开发了好长时间了。
72:49
How does that make sense or, you know, something like this?
这怎么说得通呢,或者,你懂的,类似这样的想法。
72:53
From a business perspective,
从商业角度来看,
72:54
you have to understand that GTA VI is not a game
你得明白 GTA VI 并不是一个
72:57
that they are selling to players
他们卖给玩家的游戏。
72:58
who are gonna play the game.
谁会来玩这个游戏。
73:00
That's not what it is from a product standpoint, right?
从产品角度来看,不是这样的,对吧?
73:03
Well, Grand Theft Auto VI is from a product standpoint
嗯,从产品角度看,Grand Theft Auto VI
73:06
is a replacement of Grand Theft Auto V.
是Grand Theft Auto V的替代品。
73:09
Grand Theft Auto V at the time was if I'm not mistaken,
如果我没记错的话,当时的Grand Theft Auto V
73:14
by far the most revenue generating entertainment product
绝对是当时收入最高的娱乐产品
73:18
in existence.
有史以来。
73:20
The online part of that game was generating
那款游戏的线上部分当时正在创造
73:23
like billions of dollars.
就像几十亿美元那种规模。
73:25
And like I said, not a game industry historian.
而且我说过,我不是游戏行业的历史学家。
73:28
So, you know, take what I have to say
所以,你知道,对于我说的东西,
73:29
with a huge grain of salt.
你最好打个大大的折扣。
73:31
But Grand Theft Auto V was kind of like Fortnite
但《Grand Theft Auto V》有点像是《Fortnite》
73:34
before Fortnite, if you will.
在《Fortnite》之前的那种形态,如果你要这么说的话。
73:35
They were a huge, huge live service
它们是一个超级庞大的 live service,
73:39
revenue generating product.
一个带来收入的产品。
73:42
So from Rockstar or Take 2's perspective, right?
所以从Rockstar或者Take 2的角度来看,对吧?
73:46
Grand Theft Auto VI is not just,
Grand Theft Auto VI不仅仅是,
73:49
let's try to get out the next Grand Theft Auto
让我们试着尽快推出下一部Grand Theft Auto,
73:51
as soon as we can because we'll make money selling that title.
因为我们能靠卖这款游戏赚钱。
73:54
It's a, we are going to replace the most profitable thing
而是说,我们要用一个新东西去取代
73:58
we have ever built, which is still generating
那个我们曾经打造过的,而且现在还在
74:00
a ton of money for us, with a new thing.
为我们带来源源不断收入的最赚钱的东西。
74:03
And you can better believe that they want to make sure
而且你完全可以相信,他们想要确保
74:06
that they are going to do that right.
他们会把那件事做对的。
74:09
Because the last thing you want to do is ship a new product
因为你最不想做的是推出一款新产品
74:14
that cannibalizes something from your old product
去蚕食你旧产品的市场
74:17
and then is less revenue generating, right?
然后收入还更少,对吧?
74:20
So I'm sure that they're planning around Grand Theft Auto VI
所以我敢肯定,他们在围绕《Grand Theft Auto VI》做规划时
74:23
is not just about trying to produce a Grand Theft Auto
不只是想努力做出一款《Grand Theft Auto》
74:26
that their fans will love and will buy
让粉丝喜爱并愿意购买
74:28
as the original single player gaming experience that it was.
像以往那样作为单人游戏体验。
74:31
I'm sure they care very deeply about that,
我敢肯定他们非常在意这件事,
74:33
just from a reputational and from an artistic standpoint,
光是出于声誉和艺术层面的考虑,
74:36
I'm sure there's a lot of people on those teams
我肯定那些团队里有很多人
74:38
who care about that.
都非常在乎这一点。
74:39
But from a business standpoint,
但从商业角度来看,
74:41
I am sure there's also been a tremendous amount of thought
我确信他们也投入了大量的思考
74:44
and work put into what does the live part look like.
和精力去研究 live 部分应该是什么样子。
74:49
And that's a huge undertaking that I'm sure
而那是一项巨大的工程,我敢肯定
74:53
that they've been planning for quite some time as well.
这也是他们筹划了相当一段时间的事情。
74:55
So it's a massive, massive thing that they're doing here.
所以他们在这里做的是一件非常非常庞大的事情。
74:58
How well will it succeed?
它能取得多大的成功呢?
74:59
I have no idea, but it is not just a new Grand Theft Auto
我不知道,但这不仅仅是又一款新的 Grand Theft Auto
75:02
is I guess the way that I would look at it.
我想这就是我看待它的方式。
75:04
Grand Theft Auto VI, I think, was somewhat
我觉得 Grand Theft Auto VI 有点
75:06
of a surprise to them.
出乎他们的意料。
75:07
I don't think they knew it was going to generate
我觉得他们并不知道它会带来
75:09
that kind of online revenue.
那种线上收入。
75:12
I mean, maybe they had hopes,
我是说,也许他们当时抱有一些希望,
75:13
but I don't think they knew that it would be
但我觉得他们并不知道它会
75:15
that kind of a massive money maker that it was.
成为那样一个巨大的赚钱机器。
75:18
And so this is the first product really
所以这真的是第一个产品
75:21
where they know they will have the audience.
让他们知道自己是会有受众的。
75:23
For Red Dead Redemption, they kind of tried
对于《Red Dead Redemption》,他们也算是一种尝试,
75:25
to do Red Division II, they did a similar thing
去做《Red Division II》,他们做了类似的事情。
75:28
where they tried to have the online thing.
他们试图搞线上功能的那次。
75:29
It didn't, I don't think it hit nearly as big as Grand Theft Auto.
我觉得它没有,没有像 Grand Theft Auto 那样火。
75:32
Grand Theft Auto VI is the first time they're shipping
Grand Theft Auto VI 是他们第一次对自己的旗舰作品推出真正的更新。
75:35
a true update to what is their flagship.
所以这就相当于重新发布 Google search,或者类似的事情,他们现在干的就是这个。
75:38
And so it's equivalent to a relaunch of Google search
所以如果我是那个项目的负责人,我会紧张得冒汗。
75:44
or something like that is what they are doing here.
或者类似的事情就是他们在这里做的。
75:47
And so if I was in charge of that project,
所以如果我是那个项目的负责人,
75:50
I would be sweating bullets.
我肯定会紧张到不行。
75:52
So I'm sure that they are putting a lot of thought into it
所以我确信他们在这上面花了很多心思。
75:55
and it's a very massive undertaking, I'm sure.
而且我敢肯定这是一个非常庞大的工程。
75:57
I'd like to switch gears to software craft.
我想换个话题,聊聊software craft。
76:00
You made this video titled Clean Code Horrible Performance
你做了个视频,标题是 Clean Code Horrible Performance,
76:03
and S.A. Slash Video,
还有 S.A. Slash Video,
76:05
showing how Uncle Bob Martin's polymorphism-based
展示了 Uncle Bob Martin 的基于 polymorphism 的
76:08
refactoring pattern runs about 1.5 to 50-ticed lower
refactoring 模式运行起来大约要低 1.5 到 50 倍,
76:12
than a plain table switch version.
比普通的 table switch 版本。
76:15
Can we talk about the responses to this piece?
我们能聊聊大家对这个作品的回应吗?
76:17
Well, I guess I can put that in context.
嗯,我想我可以先提供一下背景。
76:19
So that is sort of from that course on the sub-stack.
所以,那个其实是来自 sub-stack 上的那个课程。
76:22
So it kind of goes with a bunch of other videos
所以它算是和其他一些视频配套的,
76:25
that are part of the sub-stack thing.
都是 sub-stack 那套东西的一部分。
76:27
I guess the first thing I'd say is,
我想我首先要说的是,
76:29
I feel like the response to it was very positive.
我觉得大家对它的反响非常正面。
76:32
I was kind of surprised.
我有点惊讶。
76:34
There are plenty of people who didn't like it,
有很多人并不喜欢它,
76:35
don't get me wrong.
别误会。
76:36
It's controversial to be sure,
确实有争议,
76:38
but I was surprised at just how many people were enthusiastic
但我也很惊讶,居然有那么多人都非常热情,
76:41
about it as well.
对它也是如此。
76:42
But what I would say is,
但我想说的是,
76:43
it's really, I don't really think it should be so controversial
真的,我不觉得这应该这么有争议,
76:49
because there's one thing where people want
因为有一件事,人们想要...
76:52
to just use the term Clean Code to mean code
就用 Clean Code 这个说法来指代 code
76:55
that they like or think is written properly.
他们喜欢或者认为写得对的 code。
76:58
And that's not something you can argue against, right?
这个你没法反驳,对吧?
77:01
Because that's just, you know,
因为那只是,你知道的,
77:02
I probably have a version of what I think is Clean Code
我大概有一个我自认为是 Clean Code 的版本。
77:05
and obviously I don't think that's bad, right?
而且显然我不觉得那有什么不好的,对吧?
77:08
Like it's my idea of what good code looks like.
就好比那是我心中好的 code 应该有的样子。
77:11
So if your idea of Clean Code is just whatever you want it,
所以如果你对 Clean Code 的想法就是你想让它是什么就是什么的话,
77:14
you know, whatever you happen to think are good program practices,
你知道,不管你觉得什么样的 program practices 是好的,
77:17
I might agree with those program practices.
我也许会同意那些 program practices。
77:18
I don't know.
我不知道。
77:19
So in this particular video I was talking specifically
所以在这个视频里,我专门谈的是
77:22
about the things that were advocated
那些被倡导的东西,
77:23
that are like very specific things that are set,
就是那种非常具体、被定死的东西,
77:26
like don't have functions over a particular length
比如不要有超过特定长度的 functions,
77:28
or these sorts of things, right?
或者诸如此类的东西,对吧?
77:31
Things should not know the type at runtime or whatever, right?
东西不应该在 runtime 知道 type 什么的,对吧?
77:33
Like there's all these kind of rules about it,
就像关于这事有一堆规则,
77:35
preferring polymorphism always, right?
总是优先用 polymorphism,对吧?
77:37
If you look at those things,
如果你看看那些东西,
77:39
they're kind of just bad programming practices.
它们其实也就是一些糟糕的编程实践。
77:42
I mean, I don't really know how else to say them.
我是说,我真的不知道还能怎么说它们。
77:44
They don't mesh well when you put them together.
你把这些放在一起的时候,它们就不是很搭。
77:47
In isolation, some of them might be fine.
单独来看,有些可能还行。
77:49
So for example, if you really prefer lots of small functions,
比如说,如果你真的更喜欢很多小的 functions,
77:53
that's actually fine if the compiler can see all those functions
只要 compiler 能看到所有这些 functions,
77:57
and know that it can safely inline them
并且知道它可以安全地 inline 它们,
77:59
and collapse them as necessary.
然后在必要时 collapse 它们。
78:01
This is a part a lot of people missed about the video,
这是这个视频里很多人忽略的一点,
78:04
I guess because it's a pretty short video,
我猜是因为这个视频很短,
78:05
so I didn't explain anything in detail,
所以我没有详细解释任何东西,
78:06
but a lot of redundant code happens
但确实会产生很多 redundant code。
78:09
when you have lots of tiny, you know,
当你有好多好多很小的,你知道,
78:11
little, these little tiny functions
很小的,这些 tiny functions
78:13
and if they're all virtual functions and see plus plus,
而且如果它们都是 C++ 里的 virtual functions,
78:15
let's say the compiler can't know for sure
比如说 compiler 没法确切知道
78:17
which ones of them are being called and so on.
其中哪些会被调用,等等。
78:19
Even if you put things like vinyl in them
即使你在里面加了像 final 这样的东西,
78:21
and there's all, people have a lot of weird beliefs
而且呢,人们有很多奇怪的信念
78:25
about how the code works.
关于代码是怎么工作的。
78:26
You can just go do this testing.
你就直接去做这个 testing。
78:28
When you have lots of these little functions,
当你有好多这种小的 functions 的时候,
78:30
if they're all like statically defined
如果它们都是 statically defined 的,
78:32
and aren't virtual calls,
而且不是 virtual calls,
78:33
if they're just known calls, like or just member functions,
如果它们只是 known calls,比如说是 member functions,
78:36
if I say static, I kind of mean just known
如果我说 static,我其实就是指 known,
78:37
to the translation unit, not external.
对 translation unit 来说是 known 的,不是 external 的。
78:40
The compiler can put those together,
编译器可以把这些拼在一起。
78:41
collapse all of the redundant code
把所有冗余的 code 都合并掉
78:43
and actually produce something reasonable
然后真正生成一个像样的东西
78:44
that will run pretty fast out of that.
让它跑得非常快。
78:46
It can also do things like widen the code path
它还能做一些像拓宽 code path 这类事情
78:49
if it needs to vectorize to like run and send and stuff.
如果需要 vectorize 来做像运行和发送之类的操作。
78:52
The compiler has all these options to take
compiler 有所有这些选项,可以
78:54
what is fundamentally not particularly great code
拿那些本质上并不特别好的 code,
78:58
in terms of how you would want it to run it runtime,
就你希望它在 runtime 如何运行而言。
79:00
but it might be able to turn it into that
但它也许能把它变成那样
79:02
because compiler optimizing,
因为 compiler 优化,
79:04
optimizing compilers are pretty heroic these days
现在的 optimizing compilers 相当厉害
79:06
and the sorts of things they can do.
以及它们能做到的各种事情。
79:08
If instead you use all of these things
如果你反而用了所有这些
79:11
that were recommended,
被推荐的东西,
79:12
you completely block out the compiler
你就完全把 compiler 挡在外面
79:14
from being able to do those things.
让它没法做那些事情。
79:16
Because if it can't tell what it's doing at runtime,
因为如果它在runtime时无法知道自己在做什么,
79:18
if it has to leave open the possibility
如果它必须保留这种可能性,
79:20
that you substituted in a different class here
即你在这里替换了一个不同的class,
79:22
or something like that,
或者类似的情况,
79:23
then you end up in a situation
那么你最终会遇到一种情况,
79:25
where the compiler can't do any of that work.
即compiler无法做任何这些工作。
79:27
And people mistakenly think that this is just
而人们错误地认为这只是因为
79:29
because like virtual function calls cost too much
比如像virtual function call开销太大。
79:31
or something like that, that's not what it is.
或者类似的说法,但并不是那么回事。
79:33
It's not the cost of the virtual function call.
这不是 virtual function call 的开销。
79:35
We could talk about that as a separate thing
我们可以把那当作另一件事来谈。
79:38
because you can analyze that cost as well.
因为你也可以分析那个开销。
79:41
It doesn't have much to do with specifically
具体来说,
79:43
whether it's virtual or not.
它跟是不是 virtual 关系不大。
79:44
It has to do with a lot of things like branch prediction
它和很多事情有关,比如 branch prediction。
79:45
and how much stuff is going to push
以及要 push 多少东西。
79:46
on the stack and whatever else, right?
on the stack 还有其他什么的,对吧?
79:48
But it's the cost of the compiler
但这就是 compiler 无法做任何 optimization 的代价。
79:50
not being able to do any optimizations.
这才是真正的 cost。
79:52
That's the actual cost.
而这个 cost 可能非常严重。
79:54
And that cost can be severe.
我展示的只是,我觉得算是相当轻微的 degradation,跟 production 里你实际会看到的相比——如果真有大量东西这么干的话。
79:55
I showed only, I think a pretty mild degradation
我展示出来的,我觉得只是很轻微的degradation,
79:59
compared to what you would actually see in production
相比你在production里实际会看到的,
80:01
if you really had a huge number of things doing this.
如果你真的有特别多东西同时在跑的话。
80:04
And I think it landed pretty well.
而且我觉得反响还不错。
80:07
It's a very widely viewed video
这是一个观看量很高的视频,
80:09
and a lot of people seem to really like it.
很多人似乎都很喜欢。
80:10
I thought it would be probably even more controversial
我原本以为它会更有争议性
80:13
than it was.
一些。
80:14
So I was pleased with that.
所以对此我很满意。
80:16
But yeah, all that stuff remains true today,
不过,是的,那些内容到今天依然成立,
80:19
I guess is what I'd say.
我想这就是我要说的。
80:20
And I think it's good for people to hear
而且我觉得这值得人们听一听
80:21
because they need to hear opposing viewpoints.
因为他们需要听到对立的观点。
80:23
I think you can write code that is maintainable
我认为你可以写出可维护且易读的 code,
80:28
and easy to read that doesn't follow
这种 code 并不以那种方式
80:31
those principles in that way,
遵循那些原则,
80:33
and that doesn't have those problems.
也不会有那些问题。
80:35
I don't think you have to do those things.
我不认为你必须那样做。
80:37
So I think it's worth exploring other options
所以我觉得值得探索其他选项。
80:39
that are still maintainable, that are good code,
仍然可维护,是好的代码,
80:42
but that allow the compiler to do the right thing.
但又能让 compiler 做正确的事情。
80:45
What is your take on test driven development?
你对 test driven development 怎么看?
80:48
When you write the tests first,
当你先写 tests,
80:50
then you write the business logic.
然后再写 business logic。
80:51
You've talked a little about this as well
你之前也谈到过这个,
80:54
because it's a practice that used to be super popular
因为这是一种曾经非常流行的做法,
80:57
in the, especially when you're building services
尤其是在构建 services 的时候。
81:00
and all those things, especially on the 2000s,
以及所有这些,尤其是在2000年代,
81:02
kind of got a little bit out of fashion
有点过时了
81:04
and now it's unclear if it'll come back or not
现在还不清楚它是否会回来
81:06
with agents or not.
是否和agents一起。
81:08
I don't have that much of a spice you take on that one.
我对此没有太多看法。
81:10
My take is very pragmatic,
我的看法非常务实,
81:12
which is that if you can identify tests
也就是说,如果你能识别出一些测试
81:15
that will save time in total,
总体上能节省时间的话,
81:19
that's usually what I try to emphasize.
这通常就是我想强调的。
81:20
In other words, if the amount of time it takes
换句话说,如果所花的时间
81:23
to create and maintain the tests
来创建和维护这些 tests
81:25
will actually save us total development time
确实能节省我们的总开发时间
81:28
because they will identify bugs
因为它们能找出 bugs
81:29
that would be hard for us to find in production
而那些 bugs 在 production 中很难发现
81:32
or in, or would be very costly to get to,
或者说,去处理它们的代价会非常高
81:35
if they got out, then great.
如果它们真的流出去了,那就太好了。
81:37
And I've used them before,
而且我以前用过它们,
81:38
like I talked about working at Rad Game Tools.
就像我说过在 Rad Game Tools 工作的时候。
81:40
I had a regression tester that I ran
我有一个 regression tester,
81:43
on like the core libraries there that I had written
用来跑那里的核心 libraries,那些我写的,
81:45
for, they're not what we call libraries,
因为,它们不算是我们所说的 libraries,
81:47
but the core like routines to make sure
而是核心的 routines,用来确保
81:49
that anything that I could be testing
任何我能测试的东西,
81:51
for our customers I sort of was.
为了我们的客户,我基本上都在测。
81:54
And so I think there's good times for testing.
所以我觉得,确实有适合 testing 的时候。
81:57
I would say the part that I don't like
我想说的是,我不喜欢的部分
81:59
about test driven development is the test driven part.
是 test driven development 里的 test driven 那一部分。
82:04
I don't think development should ever be driven by tests.
我不认为 development 应该被 tests 驱动。
82:06
I think tests are a thing that you should be aware of.
我觉得 tests 是你需要 aware of 的东西。
82:10
You should know what your options are for testing
你应该知道在 testing 方面有哪些选项,
82:12
and you should make intelligent engineering decisions
然后做出明智的 engineering decisions,
82:15
about tests.
关于 tests。
82:16
Now could that decision be that for this particular project
那么,这个决定会不会是:对于这个特定项目
82:21
we are going to drive it primarily from the tests?
我们主要靠测试来驱动它?
82:24
Yes, that could be a decision that you make,
对,这确实可以是你做的决定,
82:27
but you shouldn't really think of development
但你不应该真的把开发
82:31
as something that is primarily test driven by default
看作默认情况下主要是 test-driven 的东西,
82:35
because that might be a very bad decision
因为对某些其他项目来说,那可能是个非常糟糕的决定,最终只会让你付出更多代价。
82:37
for some other project where it just ends up costing you
对于某些其他项目来说,到头来这么做反而更费成本,
82:40
more to have done it that way.
用那种方式做反而更贵。
82:41
So like with most things,
所以就像大多数事情一样,
82:43
I would advocate for a pragmatic approach to testing.
我主张testing要务实一点。
82:46
You should understand the cost of testing,
你要理解testing的成本,
82:50
the cost of developing, maintaining the test
也就是开发和维护test的成本,
82:52
and the cost to your code base,
以及给你code base带来的成本,
82:53
if it makes it harder to change your code base
如果它让你更难修改code base,
82:55
because tests have to be rewritten
因为tests需要重写,
82:56
and you therefore don't make changes you should make,
于是你就不去做那些本该做的改动了。
82:59
all of that stuff should be in your brain
那些东西都应该在你脑子里。
83:02
and you should make an intelligent decision
然后你应该做一个明智的决定,
83:03
about what your testing strategy is.
关于你的 testing strategy 是什么。
83:06
If that decision intelligently made
如果这个决定是明智做出的,
83:09
turns out to be we are going to have a lot of testing
结果是我们将会有大量的 testing
83:12
on this project, that may well be a good decision.
在这个项目上,那很可能是个好决定。
83:15
I don't think there's an absolute thing you can say
我不认为你能说出一个绝对的东西,
83:17
about how many tests there should be.
关于应该有多少 tests。
83:20
Some projects probably shouldn't have very much
有些项目可能不应该有太多这种东西
83:22
maybe some projects should have a lot.
也许有些项目应该有很多。
83:23
And I think knowing which of those you are doing
我觉得知道自己做的是哪一种
83:26
is part of being good software engineer
是成为一个好的软件工程师的一部分
83:28
is I guess what I would say.
我想这就是我要说的。
83:30
You mentioned being a good software engineer,
你提到了成为一个好的软件工程师,
83:32
but before we get into what is a good software engineer,
但在我们深入讨论什么是好的软件工程师之前,
83:34
what does good code mean to you specifically?
对你来说,好的代码具体意味着什么?
83:38
So good code to me usually means that you have written
所以对我来说,好的 code 通常意味着你写出的
83:42
a something that is as straightforward
一个东西尽可能直接地
83:47
to what the machine actually needs to do
对应到机器实际需要做的事,
83:49
to solve the problem as it can be.
来解决问题。
83:52
And also hopefully that you have,
而且也希望你,
83:55
I guess I'll say properly identified ways
我想说,已经正确地识别出一些方法
84:00
of breaking it into easily digestible pieces
来把它拆分成容易理解的部分,
84:04
and named those pieces in ways that are easy
并以简单的方式命名这些部分。
84:07
for someone to understand, especially yourself
为了让别人理解,尤其是你自己
84:09
because you are very likely to be someone
因为你很可能就是那个
84:11
who's going to have to modify it.
需要去修改它的人。
84:12
So that's the way I tend to code.
所以我倾向于这样写代码。
84:14
I try to identify what do I actually need the computer to do.
我会试着弄清我到底需要电脑做什么。
84:18
I try to write as simple as possible the thing
我会尽量把要做的那件事写得尽可能简单
84:20
that will do that.
来完成任务。
84:22
And then I try to put that in terms that are,
然后我会试着用……的措辞来表述它。
84:26
I would say least redundant.
我会说是冗余最少的。
84:28
So I don't want to see the equation for Euclidean distance
所以我不想看到 Euclidean distance 的公式
84:32
scattered throughout my code.
散落在我 code 里的各个地方。
84:33
I want to have a function that's like compute that distance
我想要有一个 function,用来计算那个距离
84:35
and I want to use it, right?
而且我想用它,对吧?
84:36
I want it to then be nicely broken into the pieces
我希望它然后能被很好地拆分成各个部分
84:40
that it represents.
它所代表的。
84:41
And I want those pieces to be reassembled
而且我希望那些部分能被重新组装起来。
84:43
will properly buy the compiler in a way
会以某种方式正确地使用编译器
84:45
that will produce code that runs very efficiently, right?
让它生成运行非常高效的代码,对吧?
84:48
And so that's what I'm usually trying to do
所以这通常就是我在尝试做的事情
84:51
when I'm trying to program.
当我在编程的时候。
84:52
And for me, I have never really understood
而对我来说,我一直没能真正理解
84:57
the sort of mentality of there's a difference
那种认为存在差异的心态
85:00
between code that is well architected by some principles
在按照某些原则架构良好的代码
85:06
and code that runs quickly.
和运行快速的代码之间。
85:08
Because in my experience, usually the code
因为以我的经验,通常 code
85:10
that is architected properly
如果架构设计得当,
85:11
is also the code that runs quickly.
那它跑起来也会很快。
85:13
And yes, there is a point where if we decide
而且没错,确实有个临界点——如果我们决定
85:17
that something absolutely has to get
某样东西必须尽可能
85:20
as close to theoretical maximum as it possibly can,
接近理论极限,
85:24
yes, we will start to make that code harder
那好,我们就会开始让那段 code 变得更难
85:27
to read and modify because we are now like
阅读和修改,因为我们现在就像...
85:30
really over specializing it for this piece of hardware
真的把这块 hardware 过度特化了
85:33
or whatever, that's true.
或者别的什么,确实如此。
85:35
But that point is like way out on the curve.
但那个点已经在曲线之外很远了。
85:39
It's not the common case.
这不是常见情况。
85:41
Most of the time, assuming you just want code
大多数时候,假设你只是想要 code
85:43
that runs pretty darn well on most hardware,
能在大多数 hardware 上跑得相当好,
85:46
the simple readable version of the code
code 的简单可读版本
85:49
is actually very fast.
实际上非常快。
85:50
It's only once you think you need to have 27 factories
只有当你觉得你需要27座工厂
85:53
and 8,000 microservices and all these things running
和8000个microservices,所有这些都在运行的时候,
85:57
that it starts to be this thing that's like good architecture
它才开始变成那种所谓的良好architecture,
86:00
but also like hard to modify, hard to read,
但同时也很难修改、很难读,
86:03
run slowly, write all these things.
跑得慢,还得写这么一堆东西。
86:06
So I tend to think of like good code,
所以我倾向于觉得好的code,
86:08
there's like this nice nexus of runs pretty darn well,
就是那种很好的结合点:运行得相当不错,
86:12
easy to read, easy to maintain,
容易读,也容易维护。
86:14
isn't as close to theoretical maximum as it could be,
并没有像它本可以的那样接近理论最大值,
86:18
but it's close enough and the paths
但已经够接近了,而且通往理论最大值的
86:21
to reach theoretical maximum have not been foreclosed.
路径没有被封死。
86:24
We left the door open with the way that we wrote it
我们写它的方式留了一扇门,
86:26
so that if someone really needs to come along
所以如果真的有人需要来
86:28
and boost its performance, it's set up to do that, right?
提升它的性能,它就是为此而设计的,对吧?
86:30
And related to this, what is a good software engineer to you?
说到这个,对你来说,什么样的软件工程师才算好?
86:35
Is it just someone who writes good code
就是会写好的代码吗?
86:37
where it goes beyond that?
那再往上呢?
86:39
I would say it really depends on the environment a little bit
我觉得这真的有点看环境。
86:44
because I think I've seen a lot of different kinds
因为我觉得我见过很多不同类型
86:48
of good software engineers and so I would like in it
的优秀软件工程师,所以我想把它比作
86:51
more to a, if you want a sports analogy,
更像,如果你想打个体育比方的话,
86:54
you'd imagine something more like a baseball team
你可以想象成一支棒球队。
86:57
where it's like what's a good baseball player?
就像在问,什么样的棒球球员算好?
87:00
Well, are we talking about a pitcher or a designated hitter,
嗯,我们说的是投手还是指定打击?
87:03
right?
对吧?
87:04
And it changes quite dramatically.
而且变化特别大。
87:06
So there might be some things like, hey,
所以可能会有一些事情,比如说,嘿,
87:07
if someone's pleasant to work with and doesn't goof off
如果一个人很好相处,而且不是总在摸鱼
87:12
all the time and actually gets their work done,
并且真的能把工作做完,
87:14
those are obviously things that we would say are true
这些显然是我们会说对任何软件工程师
87:16
of any software engineer.
都成立的事情。
87:18
There are some general personality traits
有一些普遍的性格特质。
87:20
that might be positive.
那可能是积极的。
87:21
But when you're talking about things
但当你谈论的事情
87:23
that are more specific to just software engineering
更具体到software engineering
87:26
and not just being a good employee or something like that,
而不只是做一个好员工之类的,
87:29
I would say I've seen a couple of different kinds.
我想说我见过几种不同的类型。
87:31
I've seen people who are like the utility in fielder.
我见过那种像多面手一样的人。
87:33
They're people who just like they can identify and go
他们就是能发现问题并直接去
87:36
and try to fix a problem and succeed.
尝试解决问题并且成功的人。
87:38
Even if the code base is kind of wacky and out there,
即使 code base 有点乱、有点奇葩,
87:41
they're good at getting the lay of the land
他们也很擅长摸清状况,
87:43
very quickly of identifying some that's going on
很快就能搞清楚发生了什么,
87:46
and they're not afraid to go in and like, okay,
而且他们不怕深入进去,然后会说,好吧,
87:48
this is kind of, this code base kind of ugly here.
这个 code base 这里有点难看。
87:51
It's okay, I'm going to patch around
没关系,我 patch 一下绕过去,
87:52
I'm going to do what I need to do and get things done.
做我该做的,把事搞定。
87:54
That's a great engineer to have around.
有这样的工程师在身边真的很棒。
87:56
I've also seen great engineers who are the exact opposite of that.
我也见过一些很厉害的工程师,他们完全是那种人的反面。
88:00
They are just like I take this one particular problem
他们就是那种,“我就拿这个具体的问题,
88:04
that we have and eight months later,
我们手头的,然后八个月之后,
88:08
I have ground out every last thing there is to know about this.
我已经把关于它的所有能知道的东西都磨出来了。”
88:13
And sometimes to the point of like producing new algorithms
有时候甚至到了产出新 algorithms 的地步,
88:17
that no one's even known before, right?
这些 algorithms 以前甚至没人知道,对吧?
88:18
That are like these breakthrough things, right?
就像是那种突破性的东西,对吧?
88:21
And that's a great software engineer to have on a project
项目里能有这样的 software engineer 是非常棒的。
88:23
if you're going to be having that kind of thing.
如果你要搞这种事儿的话。
88:25
And so I've seen a lot of different people
所以我见过很多不同的人,
88:28
that I would consider great software engineers
我觉得称得上优秀 software engineer 的人,
88:30
and they aren't all the same person, right?
他们并不都是同一种人,对吧?
88:33
So I think that it's kind of important
所以我觉得这挺重要的,
88:35
if you're asking it from the standpoint of like,
如果你是从这种角度来问的话,比如,
88:38
hey, you need to put together a team to go build this project.
嘿,你需要组建一个团队来做这个项目。
88:41
What's a great software engineer?
那什么才是一个优秀的 software engineer?
88:43
I would say the best advice you could give someone
我觉得你能给某人的最好建议是
88:45
in that position is think about the roles.
在那种情况下,想想这些角色。
88:48
Think about what kinds of roles there are going to be here
想想这里会有哪些角色。
88:52
and don't think great software engineer.
不要想着成为伟大的软件工程师。
88:54
Think great that role, right?
而是想着在那个角色上做到出色,对吧?
88:57
Who is going to be a great pitcher?
谁会是一个伟大的投手?
88:58
Who's going to be a great first baseman?
谁会是一个伟大的一垒手?
88:59
Who's going to be a great outfielder?
谁会是一个伟大的外野手?
89:01
Who's going to be a great this, that great third base coach,
谁会是一个很棒的这种,那种顶尖的三垒教练,
89:03
whatever it is, right?
不管是什么,对吧?
89:05
And that's what you're trying to put together
而这就是你想要拼凑起来的,
89:06
if you're trying to build a team to me.
如果你想组建一个团队的话,对我来说。
89:08
Yeah, so like it's just not one size fits all,
是啊,所以真的不是 one size fits all,
89:10
but I still want to push you a little bit.
但我还是想再逼你一下。
89:12
Like what are things that you think are non-negotiable
比如你觉得哪些事情是 absolutely non-negotiable,
89:16
for someone to be a great software engineer?
对一个人来说,要成为一个伟大的 software engineer?
89:18
I mean, we talked about the things that we talked about,
我的意思是,我们谈到了之前谈到的那些内容,
89:21
which is a recurring theme with you is just going deeper
这是你一贯的主题,就是不断深入下去,
89:24
and deeper and understanding the next and next layer,
越来越深,理解下一层又一层,
89:27
like understand if you're doing web development,
比如,如果你在做 web development,
89:30
and understand to react, once you understand to react,
然后去理解 React,一旦你理解了 React,
89:32
understand what's going on in the DOM,
就要理解 DOM 里发生了什么,
89:34
go all the way to assembly.
一路深入到 assembly。
89:35
Once you've done there, understand how the CPU
一旦你到了那里,再理解 CPU 是如何工作的。
89:38
is doing operations and branch predictions
是在做 operations 和 branch predictions
89:40
and some of those things.
以及一些类似的事情。
89:41
Like to me, that's a skill of curiosity,
对我来说,这是一种好奇心的技能,
89:44
driving deeper, crafts, whatever you call it.
深入挖掘、手艺,随便你怎么叫。
89:48
The orders are different ways we could do it.
其他的是我们可以做的不同方式。
89:49
But along these lines, what are those traits
但沿着这个思路,你觉得哪些特质是通用的,
89:51
that you think no matter what kind of role we're talking about?
不管我们谈论的是什么角色?
89:54
If you think back of some of the different type of roles
如果你回想一些不同类型的角色
89:57
that you work with, do you see some overlap
你共事的人,你看到有重叠吗?
90:00
that they all had something?
他们都有某种共同点?
90:02
I would say that it's pretty unusual, I guess,
我想说这很不寻常,我猜。
90:06
that I can't think of someone I would think of
我想不出有谁,我会认为
90:09
as a great software engineer who didn't know
是一个伟大的 software engineer,却不懂
90:12
how to read assembly or something.
怎么读 assembly 之类的。
90:14
That is true.
那倒是真的。
90:15
It might be that having that curiosity about how things work
也许是拥有那种对事物如何运作的好奇心
90:18
and knowing at some level what's going on
而且在某种程度上知道正在发生什么
90:20
is kind of maybe something that's going to be very common
也许会变成一件非常普遍的事情
90:24
to a great software engineer.
对于一位出色的 software engineer 来说。
90:26
But I would just underscore the point,
但我想强调一点,
90:28
the degree to which they are employing that knowledge
他们运用那种知识的程度
90:30
may vary quite a bit.
可能会有很大差异。
90:32
For some of them, that may be their bread and butter
对其中一些人来说,那是他们的看家本领
90:34
and they're doing that all day.
而且他们整天都在做这个。
90:35
For others, it's just really a thing where
对其他人来说,这其实就是那么回事,
90:38
because they know how a computer works,
因为他们知道计算机是怎么工作的,
90:40
they're not making those stupid architectural decisions
他们就不会做出那些愚蠢的 architectural 决策,
90:43
that come back to bite us later, right?
之后反过来坑我们,对吧?
90:45
And that's great, but they may not really be doing
这当然很好,但他们可能实际上并没有
90:47
all that much actually at that kind of level
在那种层面上做太多事情,
90:50
or thinking about at that level.
或者说没在那种层面上思考。
90:51
They're just going like, yeah, I know we got to kind of push
他们只是会像是,嗯,我知道我们得稍微推一下。
90:54
okay, this stuff's going to have to be done in batch
好,这些东西得用 batch 来做。
90:56
because I just kind of know that that's
因为我就大概知道那就是
90:57
how the machine's going to have to handle it.
机器得处理它的方式。
90:59
So I'll make sure I write the code that way or whatever.
所以我会确保我写 code 的时候就是这么写的,或者什么的。
91:02
Yes, but so there's a little bit of that.
对,但就是会有那么一点。
91:05
The other thing that I would say maybe is actually
还有一点我想说的可能是,其实
91:09
like not being dogmatic about things
就是不要对事情太教条,
91:12
that they haven't actually themselves proved out
特别是那些他们自己其实还没验证过的。
91:14
is probably a huge one.
这可能是一个很大的问题。
91:16
I find there's a lot of like received programming wisdom
我发现有很多所谓的沿袭下来的 programming wisdom,完全是胡扯。
91:19
that's just nonsense.
就好像显然从来没人验证过一样。
91:20
Like clearly no one's ever tested it.
如果他们真去验证过的话,他们就会发现
91:21
And if they did, they would have found out
它其实没有任何实际根据。
91:23
that there's no actual basis for it.
这不一定意味着它就是错的。
91:25
Doesn't necessarily mean it's false.
只是说,没有那种,没有实际的、摸得着的东西……
91:26
It's just there's no like there's no actual tangible
只是就是没有那种,没有真正的实际有形的...
91:29
way you can demonstrate.
你可以证明的方式。
91:30
And sometimes it is like you could demonstrate
而且有时候就好像你可以证明,
91:32
that there are actual concrete downsides
这种公认观点确实有具体的弊端,
91:35
to this received wisdom, right?
对吧?
91:37
And so in order for it to be received wisdom,
所以要成为公认观点,
91:39
you should have to be able to at least demonstrate concrete
你至少应该能够展示具体的
91:41
upsides, which oftentimes cannot be done.
好处,而这往往做不到。
91:43
So I would say people who actually focus on what works
所以我会说,那些真正专注于有效方法的人
91:47
in practice is a huge plus.
在实践中是一个巨大的加分项。
91:52
And you could apply that anywhere and to anything, right?
而且你可以把它应用到任何地方和任何事情上,对吧?
91:54
Not just saying, oh, the flavor of the month
不是说,哦,这个月流行什么
91:57
is that we're writing everything with classes
就是我们所有东西都用 class 来写
91:59
and virtual functions and hierarchies or whatever.
还有 virtual functions 和 hierarchies 之类的。
92:01
It's like, did you actually determine
就是说,你到底有没有实际确认过
92:03
that that results in less code
那样真的会减少代码量
92:04
or that the code actually is murmuring?
或者说这些代码实际上在低语?
92:05
It's like, do we do any testing
就像是我们有没有做任何 testing
92:06
to figure out if this is helping us rather than hurting us?
来搞清楚这到底是在帮我们还是害我们?
92:08
And the answer oftentimes is no,
而答案往往是:没有,
92:10
or if it was at all, it was extremely shotally done
或者就算有,也做得极其草率。
92:14
and you would not take those results as conclusive in any way.
而且你绝不会把这些结果当成任何定论。
92:17
And so it's like being more skeptical
所以这就好比要更加怀疑
92:19
about coding practices and actually trying to focus
coding practices,并且真正试着去专注
92:21
on what is working in practice
在那些实际有效的东西上。
92:23
and what we can demonstrate and measure
而我们可以演示和衡量的东西
92:25
in some kind of a repeatable way
以某种可重复的方式
92:29
is I think a really great thing
我觉得是一件非常棒的事情
92:30
for a software engineer to have as well.
对软件工程师来说也是如此。
92:32
So people who don't tend to fall prey to that
所以那些往往不会中这种招的人
92:34
just like, I watched some presentation
比如说我看了一个演讲
92:36
and someone at Google says always call memset
然后 Google 的某个人说总是调用 memset
92:38
or never use if statements or whatever it is.
或者永远不要用 if statements 之类的。
92:41
Like, if that's the level that you're thinking at,
比如说,如果你的思考水平就是这样的话,
92:43
then I probably am not going to put you
那我大概不会把你
92:45
in that category of really good software engineer
归入真正优秀的软件工程师那一类,
92:47
because that's not how it works.
因为事情不是那样的。
92:49
Plus, it's not that hard to try these things out
而且,去尝试这些东西并不难,
92:52
or set up or run an experiment.
或者搭建或运行一个实验。
92:56
Now, the final topic I wanted to touch on,
现在,我想谈的最后一个话题,
92:58
which I diligently didn't get into until now,
是我之前一直刻意没有深入讨论的,
93:01
is AI and how it's changing your work.
就是 AI 以及它如何改变你的工作。
93:04
And I'd like to start with that.
我想从这个开始。
93:05
Like in the work that you're doing at Molly Rocket
就像你在 Molly Rocket 做的工作,
93:09
with this project that is yet unreleased,
关于这个还没发布的项目,
93:13
how are you using AI tools if you're using them at all?
如果你有在用 AI tools 的话,你是怎么用的?
93:17
We are not using them at all.
我们完全没用。
93:19
So you're doing it just like before,
所以你还是像以前一样做,
93:21
you're writing your code.
你在写你的代码。
93:23
What made you decide to take this path?
什么让你决定走这条路?
93:26
Well, we're a little bit different,
嗯,我们有点不太一样,
93:28
obviously, in the sense for two reasons.
显然,原因有两个。
93:31
One is that we, like I said,
一个是,就像我说的,
93:34
we have two projects here
我们手头有两个项目,
93:37
and the sub-stack is our primary focus
sub-stack 是我们的主要重点,
93:40
and this other one is a thing that we're doing
另一个是我们因为想做才做的事情。
93:43
because we want to do it.
因为我们想这么做。
93:44
And when you think about that perspective,
当你从那个角度来看的时候,
93:46
why did you want to do it?
你为什么要这么做?
93:47
Well, the reason that I want to program
嗯,我想要编程的原因,
93:50
like things in a game is because I want to program them.
比如游戏里的东西,是因为我想自己编程。
93:54
If I just wanted an AI to program them,
如果我只是想让 AI 来编程这些,
93:56
I probably, you know, first of all,
那我可能,你知道,首先,
93:57
we'd probably just go use a licensed engine, right?
我们大概就会直接用个 licensed engine,对吧?
93:59
Like I wouldn't, I wouldn't even bother asking an AI to do it.
就是说我不会,我甚至都懒得去让 AI 做这个。
94:02
I'd just go get the engine, right?
我就直接去拿引擎,对吧?
94:05
Or something like that and so on.
或者类似那样,等等。
94:07
So I think a little bit of that decision
所以我觉得那个决定,某种程度上
94:09
is probably not that relevant to your audience
可能跟你的听众没太大关系,
94:11
because it's more about what do you want to do.
因为这更多是看你想做什么。
94:13
Like why are you spending this time, right?
比如你为什么要花这些时间,对吧?
94:15
It's a philosophical question, not a productivity question.
这是个哲学问题,不是效率问题。
94:19
So it's not like I evaluated it and said,
所以并不是说我去评估了它,然后说,
94:21
I don't think this will save us time or I,
我不觉得这能帮我们节省时间,或者说,我对它的版权问题、伦理问题,以及所有你可以合理评价AI的那些方面都有疑问。但倒也不是因为这些。更像是用它并不能推进项目的目标。所以到那时它基本上就不是个问题了,对吧?
94:23
or you know, or I have questions about the copyright ability
或者说,你知道,或者我对它的可版权性有疑问
94:26
of it or the ethics of it or all the sorts of things
或者它的伦理问题,或者所有那些事情
94:28
that you could rightfully evaluate AI on.
你可以合理地评估AI的那些方面。
94:31
It wasn't necessarily that.
倒不一定是这些。
94:33
It's more just like this does not further the goals
更像是,使用它并不能推进
94:36
of the project to use it.
项目的目标。
94:37
So it kind of was a non-issue at that point, right?
所以当时这基本上就不是个问题,对吧?
94:40
Stepping out a little bit more
再往外扩展一点
94:43
to a broader philosophical framework about AI,
到更广泛的AI哲学框架,
94:45
I guess what I would also say is I think that if you,
我想我还会说的是,我觉得如果你,
94:50
regardless of what you think will happen with AI in the future
不管你认为AI未来会发生什么,
94:53
because obviously we don't really have any way to predict
因为显然我们真的没有什么办法去预测
94:56
what it will look like 10 years from now.
它10年后会是什么样子。
94:58
It's anyone's guess really.
这真的是谁也说不准。
94:59
I think there will probably also be at some point
我认为在某个时候很可能也会...
95:04
a notion of like traditional hand crafting
一种类似传统手工制作的概念
95:08
that will come into play because we've seen this
这会发挥作用,因为我们已经看到
95:10
in most other times when you automate something.
在大多数其他自动化场景中都是如此。
95:13
So if you automate making furniture
所以如果你自动化制造家具
95:15
and you have like IKEA or whatever,
而且有像IKEA这样的,
95:18
that doesn't mean that there isn't some weird guy down
那并不意味着就没有某个怪人
95:21
in the industrial district of your city
在你所在城市的工业区里
95:23
making crazy wood tables with iron and welding and something
用铁和焊接之类的东西做疯狂的木桌
95:27
and that that's just a thing that people are still doing
而且那只是人们还在做的事情。
95:30
and some people want that table.
而有些人想要那张桌子。
95:32
I don't necessarily have an explanation for it
我不一定对此有解释。
95:35
and I'm not trying to argue that it has more or less value
而且我并不是想争辩它的价值更高或更低。
95:39
but it's just something that happens, right?
但这只是会发生的事情,对吧?
95:41
And so if I imagine what I love about computers
所以如果我想象我喜欢电脑的哪些地方,
95:46
and what I want to do with computers
以及我想用电脑做什么,
95:48
and you asked me move that into some other context
而你让我把那些转移到另一个情境中。
95:51
which of these people would you be?
你会是这些人中的哪一个?
95:53
My answer is always I'd be the organic farming guy.
我的答案永远是我会是搞有机农业的那个家伙。
95:56
I'd be the guy who's making the weird table
我会是那个做奇怪桌子的人,
95:59
in the industrial district.
在工业区里的那个。
96:00
I have no interest in managing a division at IKEA.
我完全没兴趣管理宜家的某个部门。
96:03
I literally couldn't care less about that, right?
我对那简直毫不在乎,对吧?
96:06
And so I think for me another reason why I'm not
所以我觉得,对我来说,另一个我不太
96:10
that interested in pursuing AI is because
想追求AI的原因是
96:13
I would like to be part of whatever the set of people are
我想成为那群人中的一员,不管他们具体是什么样的人。
96:18
who are going to keep this traditional craft alive
那些要把这门传统手艺延续下去的人。
96:21
just because that's something humans do,
只是因为那是人类会做的事情,
96:24
not because we're trying to say
不是因为我们想说明
96:26
that that's the right business case, right?
这在商业上是讲得通的,对吧?
96:28
If that makes sense.
如果你懂我意思的话。
96:29
And at this point, there's a bit of a tradition,
而且到了现在,这已经有那么点传统了。
96:31
if you will, even if we assume that these machines
可以这么说,即使我们假设这些机器
96:33
will do as good or better than humans
会做得和人类一样好,甚至更好。
96:35
for like 160 plus years,
差不多160多年了,
96:38
we've all only exclusively handwritten software
我们全都完全只手写 software。
96:42
because that's how it got done, right?
因为一直以来就是这么做的,对吧?
96:44
Like a lot of us, anyone who started coding before 2023
像我们很多人一样,任何在2023年前就开始 coding 的人,
96:48
or at the end of 2022
或者是在2022年底,
96:49
or probably honestly 2024,
或者说实话,可能是2024年,
96:51
when these things have gotten like decently good,
当这些东西已经变得相当不错的时候,
96:53
you just wrote it by hand, a lot of it
你就是手写了其中很多部分
96:55
or tap completely still counts.
或者完全用点的也算
96:57
Yeah, and I guess I would say like again,
对,而且我觉得还是那句话
97:00
it's just why do that, right?
这到底图什么呢,对吧?
97:02
Is the question, it's like,
问题就在这儿,就好比
97:03
I don't know why humans do that.
我不知道人类为什么要那么做
97:05
Humans do that because it's something humans do, right?
人类那么做是因为这就是人类会干的事,对吧?
97:07
Humans like to do things themselves sometimes.
人类有时候就是喜欢自己动手做事情
97:10
You know, people can buy a hat,
你知道,人们可以买一顶帽子,
97:13
they can buy a wool hat trivially
他们可以轻松地买一顶羊毛帽,
97:16
or they can buy whatever,
或者他们可以买任何东西,
97:17
and then someone's out there knitting a hat right now.
然后现在就有人在那边织帽子。
97:20
That's just, it's just something humans do.
这就是,这其实就是人类会做的事情。
97:22
They like to make things by hand sometimes
他们有时候喜欢手工制作东西,
97:24
and at varying levels of hand-madeness,
而且手工程度各不相同,
97:27
you know, there's some people just buy the wool
你知道,有些人就只买羊毛。
97:30
or whatever or buy the pre-made yarn.
或者随便什么别的,或者买现成的纱线。
97:31
Some people raise the sheep or ensure it, right?
有些人自己养羊,或者自己剪羊毛,对吧?
97:35
Like you can go arbitrarily for it
比如你可以想多深入就多深入,
97:37
and you can find somebody who's going all the way, right?
而且你总能找到一条道走到黑的人,对吧?
97:40
Even further than probably I would ever go
甚至可能比我会走的还要远,
97:42
if I was in that thing.
如果我也搞这个的话。
97:43
So you know, you could imagine someone making
所以你知道,你能想象有人
97:45
their own hardware these days, right?
如今自己造 hardware,对吧?
97:47
I'm not doing that.
我不会那么做的。
97:48
And so that's kind of my take on it.
所以这就是我的一点看法。
97:51
So I'm kind of the last one to ask about, you know,
所以我其实是最不该问这个的人,你知道,
97:55
AI coding or what you might want to do with it.
AI coding 或者你想用它做什么。
97:57
I really have no nothing of value to add.
我真的没有什么有价值的东西可以补充。
98:00
But I am interested in asking you
但我很有兴趣问你,
98:02
through the lens of the games industry
从游戏行业的角度来看,
98:04
and we touched on games engines arriving
而且我们之前提到了 games engines 的到来。
98:08
and now so many more people can make games not everyone,
现在有更多的人能做游戏了,但不是所有人,
98:12
but it's a lot easier to enter.
可是入行容易多了。
98:14
What are you observing in terms of most people
就大多数人而言,你观察到了什么?
98:17
outside of who are still hand crafting code
除了那些因为想做而仍然在手工写 code 的人,
98:20
because they want to are using these AI coding agents
他们都在用这些 AI coding agents,
98:22
for two reasons either it just makes sense
原因有两个:要么是觉得这样确实合理,
98:26
and they realize, well, this thing can now
然后他们意识到,嗯,这东西现在
98:28
generate code as good as I did,
生成的 code 已经和我写得一样好了。
98:30
which was the turning point in January.
那是1月的转折点。
98:31
I had the turning point actually myself
其实我自己也有过这个转折点。
98:33
or some are actually just pushed with corporate mandates
或者有些人实际上只是被公司强制要求推着走。
98:37
of like you need to use these tools and eventually
比如你得用这些工具,然后最终
98:39
they kind of get on board whether willingly or unwillingly,
他们不管自愿还是不自愿,都会慢慢接受。
98:42
but so many folks are having AI write the code for them.
但是很多人都在让AI帮他们写代码。
98:46
They're prompting it, but they're doing it.
他们是在给AI提示,但实际是他们在做。
98:48
What do you observe of the effect from your vantage point
从你的角度来看,你观察到的影响是什么?
98:53
made that beyond on quality, craftsmanship,
在质量、工艺上做到了那种超越,
98:57
on the output, speed, et cetera?
在output、速度等等方面?
99:01
What are you seeing?
你看到了什么?
99:03
I think it's a little too early to assess to be honest
我觉得说实话,现在评估还太早,
99:06
because kind of as you pointed out,
因为就像你指出的那样,
99:08
obviously there's been people who maybe you know,
显然有些人——你懂的——
99:13
we might derogatorally call AI shills
我们可能会带点贬义地称他们为AI shills,
99:16
who have been saying that it was producing
他们一直在说它正在产出……
99:18
as good a code as humans for you know,
写 code 跟人类一样好,你知道,
99:20
two years now or something like that, right?
到现在差不多两年了吧,对吧?
99:23
But in reality, the people whose opinion I would trust more,
但事实上,那些我更信任其判断的人,
99:28
none of them thought it was really all that usable
他们没一个觉得它真的那么有用,
99:30
until much more recently, right?
直到最近才这么觉得,对吧?
99:33
And so we really haven't,
所以我们其实还没有,
99:34
they haven't had very many months
他们也就没有多少个月
99:36
to actually be figuring out how to use this thing
真正去搞明白怎么用这个东西。
99:39
or to determine to what extent they can use it and how,
或者要确定他们能在多大程度上使用它,以及如何使用,
99:43
what it's best at, what the workflow looks like
它最擅长什么,workflow 是什么样的,
99:46
that makes it produce the best results.
才能让它产生最好的结果。
99:48
It seems like at the moment I would say,
我觉得目前来说,
99:50
probably need to give it at least another six months,
可能至少还需要给它六个月时间,
99:53
if not another year or something,
如果不是再需要一年左右的话,
99:54
to let everyone kind of shake out like,
让大家都能慢慢弄清楚,
99:57
what are actually the best ways to use this thing?
到底什么才是使用这个东西的最佳方式?
100:01
I know tons of people in the game industry are using it,
我知道游戏行业超多人在用它,
100:04
so I know that they are doing various things with it,
所以我知道他们拿它做各种事情,
100:08
whether those things are the same sorts of things
不管那些事情是不是同一类的事,
100:11
they will eventually think are the way they like,
就是那种他们最终会觉得是自己喜欢的方式的事,
100:14
you know, like the things that they're doing right now,
你知道,就像他们现在正在做的这些,
100:18
maybe like, oh, that was kind of dumb,
可能就像,哦,那有点傻,
100:19
like you shouldn't have used it that way,
就像你不应该那样用它,
100:20
you should do this other thing with it
你应该换一种方式用它。
100:22
and it's way more productive or something.
而且它效率高多了还是怎么的。
100:24
So I feel like it's probably too early to assess.
所以我觉得现在评估可能还太早。
100:27
We haven't seen any real like obvious,
我们还没看到什么真正明显的,
100:30
like oh, wow, like, you know, the fortnight ships
比如“哦,哇”,你懂的,那个每两周一次的发布
100:34
once a week now and it's bug free,
现在变成每周一次了,而且没有 bug,
100:36
like nothing particularly interesting has happened
就像没什么特别有意思的事发生过
100:38
in terms of output there,
就 output 而言,
100:40
but again, it's been what, like five months or something,
但话说回来,这已经多久了,大概五个月左右吧,
100:43
so it's just, it's way too early to see how it actually
所以就是,现在要看它如何真正整合到一个可靠的流程中,还为时过早,对吧?
100:47
gets integrated into a reliable process, right?
是的,而且我知道有些公司
100:50
Yeah, and there I know there are some companies
现在正在尝试,比如说,用 agents 来修 bug,
100:53
who are now tying up, let's say agents fixing bugs,
但这还只是几个月前的事。
100:55
but that's only a few months old.
最古老的、广泛使用的软件,
100:57
The oldest software that's widespread
几乎100%由 agents 编写的,
100:59
that is written close to 100% by agents
来自实验室,OpenAI Codex 和 endropics cloth code,
101:02
is from the labs, open AI codex and endropics cloth code,
来自实验室的,open AI codex 和 endropics cloth code,
101:07
but even there it's been since November
但即使那样,也已经是十一月开始的了
101:10
or some parts of it December, so like maybe six months
或者有些部分是十二月,所以大概六个月吧
101:14
and it's different, right?
而且这不一样,对吧?
101:15
That is a product they're selling.
那是他们在卖的产品。
101:16
So there's, I'm not sure we'll know for sure,
所以,我不确定我们能不能确切知道
101:21
like is it truly 100% how much,
比如真正百分之百有多少
101:23
you know, there's a marketing angle or not,
你知道,有没有营销角度在里面
101:26
but there's a self bias there.
但这里面有自我偏向。
101:28
So like, I would put those aside in terms of trustworthiness
所以呢,要论可信度的话,我会先把那些放到一边。
101:32
and you're right, that the rest,
你说得对,剩下的部分,
101:33
we just don't really have the information.
我们确实没太多信息。
101:35
It'll be, I'm sure there's so much experimentation
我相信肯定有大量实验在做,
101:37
so it'll be, but to your point, it takes time to bake, right?
所以结果会——但就像你说的,这需要时间慢慢显现,对吧?
101:41
To see the impact.
才能看到影响。
101:43
Most of these things are currently presented as tools,
目前这些东西大多是以工具的形式呈现的,
101:46
meaning a human has to operate them at least in some way,
也就是说,至少在某些环节需要人来操作。
101:50
like at least setting it up to do what it's going to do
比如至少把它设置好,让它去做它要做的事
101:54
and therefore you have to give it some time.
所以你得给它一些时间。
101:59
You know, nobody currently is selling a product
你知道,目前没有人卖一种产品
102:02
where it's just like, oh, just turn this thing on
就是说,哦,只要把这个东西打开
102:05
and it will just ship Fortnite by itself forever
它就会自己一直永远发布 Fortnite
102:07
and you can just get rid of all your engineers.
然后你就可以把所有工程师都撤掉了。
102:08
Like no one's actually selling that product yet, right?
就像,其实还没有人在卖那种产品,对吧?
102:10
We could evaluate that product
我们可以评估那个产品。
102:11
because we'd be like, did anyone do it?
因为我们可能会说,有人做了吗?
102:12
It starts should have been Fortnite on its own, right?
它本身就应该先是Fortnite,对吧?
102:14
So if it's still something where humans have to kind of figure
所以如果它仍然需要人类去琢磨怎么把它融入自己正在做的事情里,
102:18
out how they want to like, slot it into what they're doing,
那么很可能我们之所以没有看到生产力的大幅提升——那种外部观察者一眼就能看出的提升——是因为这还需要
102:21
then it's entirely possible that the reason
那么完全有可能,原因
102:24
that we haven't seen some big uptick
我们没看到明显的大幅增长
102:26
and productivity that would be obvious
以及那种显而易见的生产力提升
102:29
to an external observer is because it's going to take
对外部观察者来说,是因为需要时间
102:32
a while for people to like shake that out
人们需要一段时间来消化这些。
102:34
or maybe the AI's need to get a little bit better.
或者也许是 AI 还需要变得更好一点。
102:36
Maybe like we've got to go through some more update steps
也许我们还需要进行更多 update 步骤。
102:38
or you know, whatever, I'm not sure.
或者,你知道,我也不确定,随便吧。
102:40
So there's all that on the table.
所以这些都是有可能的。
102:42
Then there's another possibility
然后还有一种可能性,
102:43
which is that it actually already has worked
就是它其实已经起作用了,
102:46
but just the productivity boost isn't as big as would be obvious.
只是生产力的提升并没有大到显而易见的程度。
102:50
If people got 10% more productive,
如果人们的生产力提高了10%,
102:53
that would still be pretty impressive
那也已经相当厉害了,
102:55
because it's hard to get a 10% across the board uplift.
因为很难做到整体提升10%。
102:58
I've said this before on podcast,
我之前在播客里说过,
102:59
I'm like, if you have a tool that can give everyone 10% up
我会说,如果你有一个工具能让每个人提升10%,
103:02
but that's great, almost no one would know, right?
但那很棒,几乎没人会知道,对吧?
103:04
It's like, you can't, it's not really externally
就像,你没办法——这真的不太能从外部
103:07
observable that clearly if that's what you got,
清楚地观察到,如果你得到的是这种提升,
103:09
but it may have happened, right?
但这可能已经发生了,对吧?
103:11
So it's really hard for all of those reasons.
所以因为所有这些原因,真的很难判断。
103:14
At some point, if the AI's are really fantastic
到了某个时候,如果这些 AI 真的非常厉害,
103:18
and people figure out how to use them really well,
而且人们搞明白了怎么把它们用得特别好,
103:20
it should be obvious.
那应该就是显而易见的了。
103:22
It should be like five people are now
应该是像现在有五个人
103:23
shipping for it night instead of 5,000 or whatever, right?
每天晚上发布它,而不是五千个人之类的,对吧?
103:26
But until that point, it's really hard to know
但直到那个时候,真的很难知道。
103:29
because it's just like, especially if it was small,
因为就像,特别是如果它很小,
103:31
it'd be hard for us to see.
我们会很难看到。
103:32
Well, this is anecdotal but I'm getting a lot
嗯,虽然这只是个人观察,但我收到了很多
103:35
of data points and messages from software engineers
来自软件工程师的数据点和信息,
103:37
and managers, one impact it's having
以及管理人员,由此带来的一个影响是
103:40
is there's this kind of like AI fatigue,
出现了一种类似AI疲劳,
103:41
slash burnout from software developers who are like,
或者说来自软件开发者的倦怠,他们说,
103:45
look, I am good at coding.
你看,我擅长写代码。
103:47
I've always been good at it.
我一直挺擅长的。
103:49
I enjoy the work to various extents.
这工作我多多少少都挺喜欢的。
103:52
But since this AI thing happened
但自从 AI 这个事出现以后,
103:54
since the end of the year, beginning of the year,
就是去年底、今年初那阵子开始,
103:56
since it's actually, I'm now prompting
因为实际上,我现在就是在 prompting,
103:58
and now all my code is generated,
现在我所有 code 都是生成出来的,
104:00
whether that's corporate mandates or is just faster,
不管那是公司强制要求,还是只是为了更快,
104:03
I'm starting to lose my drive.
我开始失去干劲了。
104:06
Like, why am I here?
就是,我为什么会在这里?
104:07
Like, anyone could do this.
就是,换谁都能做这事。
104:09
I think there's a sense of like,
我觉得有一种感觉,
104:10
I'm using a lot less of what I'm capable of.
我发挥出来的能力远少于我本可以做到的。
104:13
There's all this pressure from above
上面一直有压力,
104:15
to be more productive with it.
要求我利用它提高效率。
104:17
And it's, I think we should,
而且,我觉得我们应该,
104:18
like, I'm seeing more and more signs
就是,我看到的迹象越来越多了。
104:20
that it's what do we call it burnout?
这就是我们所说的倦怠吧?
104:22
AI fatigue is such a loss of motivation.
AI疲劳就是一种失去动力的感觉。
104:25
I haven't seen a technology.
我还没见过一项技术。
104:27
I don't remember a technology having this widespread impact
我不记得有哪项技术产生过这么广泛的影响,
104:30
like everywhere.
就像无处不在一样。
104:31
I'm hearing from folks at some of the leading
我听到一些领先公司的人说,
104:33
like kind of not AI companies per se,
它们本身并不完全是AI公司,
104:36
but like big enough like database providers
但规模足够大,就像database提供商那样。
104:39
who are now hugely into AI
现在对AI超级热衷的人
104:41
and they're powering a lot of the things,
他们在驱动很多东西,
104:43
traditional companies, modern companies everywhere.
传统公司、现代公司,到处都是。
104:46
Have you observed some of this thing?
你观察到这些了吗?
104:47
And would you have any, any advisor
那你有没有什么建议,
104:51
and any pointers to folks who are feeling like this right now?
或者给那些现在正有这种感觉的人一些指点?
104:56
I guess I would say observed, no,
我想说,亲眼看到,没有,
105:00
heard about, yes.
听说过,有。
105:03
I guess that's what I would say.
我想这就是我会说的。
105:04
Like I have talked to people
比如我和一些人聊过
105:07
who have been like such and such
他们就像说某某某
105:09
has been having a really hard time with this
在这件事上遇到了很大的困难
105:11
or such and such, but I mean,
或者某某某,但我的意思是,
105:12
like there's, I've definitely heard
就是有,我确实听说过
105:14
that interacted directly with someone
直接和某人交流过
105:16
not currently know.
但现在不认识。
105:18
And part of that is,
而这其中有一部分原因是,
105:20
is probably largely because most of the people
很可能主要是因为大多数
105:23
I talk to have a fair amount of latitude
我与之交谈的人,在做什么以及怎么做上
105:26
with what they do and how they do it.
都有相当大的自由度。
105:29
A lot of the people that I talk to on a daily basis
很多我日常接触的人,
105:32
are able to make their own decisions
都能够自己做决定,
105:34
about what they want to do with AI
关于他们想用 AI 做什么
105:36
and so on.
等等。
105:37
And so I don't necessarily hear from as many people
所以我不一定会听到很多人的声音
105:39
who are gonna be in a position
那些人会处于这样一种位置
105:41
where some manager told them,
就是某个经理告诉他们
105:43
this is just what you have to do.
这就是你必须做的事。
105:44
This is very interesting because one thing
这非常有趣,因为有一件事
105:46
that keeps coming back
反复出现
105:47
and Arman Ronature was telling me the same thing
而且Arman Ronature告诉我同样的事
105:49
on the podcast is he's observed that autonomy,
在播客里他观察到的是,autonomy,
105:53
like at your work, how autonomous you are,
比如在你的工作中,你有多少自主权,
105:55
if you worked like how many decisions
如果你做过类似的工作,有多少决定
105:56
you can make on what you work on,
是你能自己做的,关于你做什么,
105:58
how you do your work.
以及你怎么做你的工作。
105:59
The people who have a lot of that
那些拥有很多这种自主性的人
106:01
are typically like, oh great,
通常会想,“太好了,
106:03
I can use this for this.
我可以把这个用在那上面。
106:04
I can use this tool,
我可以用这个工具,
106:06
but the people who are told,
但是那些被告知的人,
106:08
you know, like beforehand you're given a ticket
你知道,就像事先给你一张票,
106:11
or the PM tells you this,
或者PM告诉你这个,
106:12
they don't have much wiggle room.
他们没有太多回旋余地。
106:13
And now those folks are seeing it way more as a threat
而现在那些人更把这看作一种威胁,
106:16
because of course subconsciously or consciously,
因为当然,无论下意识还是有意识,
106:18
they're thinking, well, this thing could automate my job.
他们在想,嗯,这东西可能自动化我的工作。
106:21
It's now, or it made from that little effort
就是现在,或者说它就是那一点点努力造成的。
106:24
I had to do that it took away as well.
我也必须这么做,它也带走了。
106:26
So I wonder if there's a connection here.
所以我就在想,这里有没有某种联系。
106:28
I mean, that sounds totally logical, right?
我是说,这听起来完全合情合理,对吧?
106:30
If you're somebody with a high degree of autonomy,
如果你是一个拥有高度自主性的人,
106:32
then when are you going to reach for an AI?
那你会什么时候去求助于AI?
106:34
Well, whenever there's something
嗯,每当有某件事
106:36
that you didn't want to do, right?
是你不想要做的,对吧?
106:38
So kind of by definition,
所以差不多从定义上讲,
106:39
I think at that point,
我觉得到那个时候,
106:41
you're going to have a much more positive experience with it
你用它的时候体验会好很多,
106:43
because worst cases just doesn't work
因为最坏的情况根本不成立,
106:46
in which case I guess that's not great.
那样的话,我觉得就不太妙了。
106:47
You're going to be like, uh, this thing was kind of crappy,
你就会觉得,呃,这东西有点烂,
106:49
but assuming that it's able to accelerate
但假设它真能加速
106:51
some part of that, that was great.
那其中的某些部分,那就很棒了。
106:52
It's like, hey, I didn't want to do this thing already.
就像,嘿,反正我本来就不想做这事儿。
106:55
I had this AI do it for me
我让这个AI帮我做了这件事。
106:57
and now I have the thing.
现在我就有这个了。
106:58
That's just a positive experience for them, right?
这对他们来说就是个正面的体验,对吧?
107:00
Whereas yeah, if you're just told,
而如果说,你只是被告知,
107:01
like you have this thing that you wanted to do
比如说你有件想做的事,
107:03
and you were told you can't just do it yourself.
然后你被告知不能自己单独做。
107:05
You have to do it with the AI, uh, you know,
你必须得用AI来做,呃,你懂的,
107:07
and by the way, we just had layoffs or whatever,
而且顺便说一句,我们刚经历了裁员还是什么的。
107:10
you know, a lot of that stuff obviously
你知道,很多这种东西显然会彻底改变你的心理反应,因为现在不是你决定要用AI,因为有些事情你不想做,你觉得AI能帮你做。现在是你被告知你应该用这个AI来自动化你以前的工作。
107:12
could totally change your mental reactions thing
可能会彻底改变你的心理反应这回事
107:14
because now it's not you deciding to use an AI
因为现在不是你决定去用 AI
107:17
because there's something you didn't want to do
因为有些你本来不想做的事
107:19
that you thought the AI could do for you.
你原本以为AI能为你做的事情。
107:21
Now it's you just being told
现在你只是被告知
107:22
that you're supposed to be using this AI
你应该使用这个AI
107:24
to automate whatever your job used to be.
来自动化你以前的工作。
107:26
You can see pretty obviously why that would have
你可以很明显地看出,那会给人带来
107:28
different psychological effects on people, right?
不同的心理影响,对吧?
107:30
So I guess it might be just an idea
所以我猜想这可能只是一个想法
107:33
for folks in this situation that now
给现在正处于这种处境的人
107:35
it you might want to evaluate your current position
你可能想评估一下当前的职位
107:38
or if you're interviewing your next position
或者如果你在面试下一个职位
107:41
based on how much autonomy will you have
基于你会有多少自主权
107:43
because the more autonomy you'll have,
因为你的自主权越多,
107:45
the more likely you're going to have control
你越有可能拥有控制权
107:46
over how you're using this stuff,
关于你怎么使用这些东西,
107:48
how much you can experiment
你能做多少实验,
107:49
versus being given a mandate
而不是被下达一个指令,
107:51
that I don't know we're expecting you
就是我不知道我们是不是期望你
107:52
to have this output increase
让这个 output 增加
107:54
or output change whatever that is.
或者 output 改变什么的。
107:56
I wonder if this will reevaluate some of, you know,
我想知道这是否会重新评估一些,你知道,
107:58
like what is considered an attractive position?
什么样的职位算是有吸引力的职位?
108:01
Because like first of all, big tech was considered
因为首先,big tech 曾经被认为是工作的好去处,因为薪酬高、预期明确,比如职业发展路径也很清晰,但现在反而是他们在开始衡量你对 AI 的使用情况,这有点像给我们戴上了手铐,规定了他们期望你做什么。
108:03
a great place to work because high compensation,
一个很棒的工作场所,因为高薪酬,
108:06
particular expectations, like easy to understand
具体的期望,比如容易理解的
108:09
career advancement, but now they're the ones
职业晋升,但现在他们却开始
108:12
who are starting to measure your AI usage,
衡量你的AI使用情况。
108:15
which is going to like giving a kind of a bit of a
这就像是,有点像是
108:17
handcuff of what we're expecting you to do
对我们期望你去做的事情的一种束缚。
108:19
or there's where you might have,
或者说,有可能会有大规模裁员,
108:22
there might be a mass layoff,
这又是你完全无法控制的,对吧?
108:23
which again, you have no control over, right?
就像又多了一个,
108:25
Like it's getting one more,
或者是在Meta内部被强制调岗,
108:26
or inside of meta force reassignments
比如你现在要去做X个月的标注工作。
108:28
of like you will now do labeling for X months.
我是说,你可以这么想,
108:32
I mean, you could sort of think of,
你懂的,我们能不能造个说法——
108:34
you know, could we coin the phrase,
你知道,我们能不能造个说法,
108:36
are you using an AI to do your job
你是在用AI做你的工作,
108:38
or is an AI using you to do your job, right?
还是AI在利用你做你的工作,对吧?
108:41
Like because at some point, it definitely,
因为到某个时候,它确实,
108:44
it definitely felt like meta, for example,
它确实感觉就像Meta,比如说,
108:46
from your reports on it,
从你对它的报道来看,
108:47
and I've seen the same thing said by other people,
而且我也看到别人说过同样的事,
108:51
so it does not sound like a one source kind of thing.
所以这听起来不像是只有一个来源的事儿。
108:54
It sounds like this was kind of just accepted as back.
听起来这好像就直接被当作事实接受了。
108:57
That they kind of just were using you as AI training, right?
他们其实就是在拿你当AI训练数据,对吧?
109:00
Like that's what you were kind of, you know,
就是说,你其实某种意义上是,你懂的,
109:02
you're just there to train the AI to do it
你只是在那儿训练AI去做那件事,
109:03
so that we don't need you anymore, right?
然后我们就不需要你了,对吧?
109:05
And so thinking about that from a perspective
所以如果从这个角度来看待你的职业选择的话,
109:09
of choosing your job,
如果你确实在做这份工作,
109:11
it does make some sense if you do it,
如果你有任何选择余地的话,那确实是有道理的,对吧?
109:12
if you have any latitude, right?
如果你有任何自由空间,对吧?
109:14
But yeah.
不过,嗯。
109:15
As closing, what are one or two books
最后,你会推荐一两本什么书,
109:17
that you would recommend that had an impact on you?
是对你影响很大的?
109:20
I'm going to have a hot take here if I might,
如果可以的话,我要说一个大胆的看法,
109:24
because it's sort of a push I've been on recently.
因为这算是我最近一直在推动的事情。
109:29
I don't think people should necessarily take
我觉得大家不一定非要接受
109:33
a book recommendation from me.
我推荐的书。
109:35
I want to recommend that people read a paper.
我更想推荐大家去读一篇 paper。
109:38
I'm trying to get more people to just read papers
我试图让更多人直接去读论文
109:42
because I realized I read a ton of papers
因为我发现我读了好多论文
109:45
like I am constantly reading papers on things
就是我经常在读一些我感兴趣的东西的论文
109:49
that I am interested in.
比如如果我要去做一些 programming
109:50
Like if I'm going to go do some programming
在一个我从来没做过的领域
109:53
in an area that I haven't done before,
我会读一大堆论文
109:55
I will read a ton of papers.
我会去翻论文的参考文献
109:56
I'll crawl the references on papers.
我会去翻阅论文的参考文献。
109:58
I'll read a survey and go gather all those references
我會去讀一篇 survey,然後把所有 references 都找出來
110:00
and read those references and crawl them back.
然後讀那些 references,再往回追。
110:02
And I find that I learn a ton that way.
而且我發現這樣可以學到超多。
110:04
And I feel like a lot of programmers just don't do that.
而且我覺得很多程序員根本不會這樣做。
110:07
And so my recommendation would,
所以我的建議是,
110:09
you don't have to read a specific paper.
你不需要讀某一篇特定的 paper。
110:10
I'm not going to give you a specific paper
我不會給你某一篇特定的 paper
110:12
to read this one.
去讀這一個。
110:13
Just think about the domain you're programming in.
想想你正在编程的领域。
110:17
Do a search on Google Scholar for some part of that
在 Google Scholar 上搜索其中的某个部分。
110:20
that you're interested in.
你感兴趣的那个部分。
110:22
Try reading a paper following the references,
试着读一篇论文,顺着参考文献追踪,
110:24
see what you think.
看看你怎么想。
110:25
I think it's a great thing to do.
我觉得这是件很棒的事。
110:27
And I get a tremendous amount of not just enjoyment
而且我从中获得的不仅仅是大量的乐趣,
110:30
from the education of it, but also just like more knowledge
还有从学习它的过程中得到的更多知识。
110:33
about what I'm doing.
关于我在做的事情。
110:34
Pretty much every time I do this,
差不多每次我这么做的时候,
110:36
even if it's just to learn a little bit more about
哪怕只是为了多了解一点
110:38
the historical record of how things got discovered.
那些东西是如何被发现的历史记录。
110:41
But a lot of times it's just like I learn
但很多时候,我就像是学到了
110:43
about whole new techniques I just was not aware of.
一些我完全不知道的全新技术。
110:46
Because there's way too much out there
因为外面的东西太多了,
110:48
for any one person to know.
任何一个人都不可能全部知道。
110:50
And I don't know to what, again,
而且我不知道到什么程度,再说,
110:52
since I don't currently use AI in my workflow,
因为我目前没有在我的 workflow 中使用 AI,
110:55
I couldn't say but my assumption would be
我没法说,但我的假设是
110:58
that AI's would also be very good at helping you find
AI 也会非常擅长帮助你找到
111:01
some papers to read if you were interested as well.
一些论文来读,如果你也感兴趣的话。
111:03
Because that's, you know,
因为那,你知道,
111:04
chewing through a lot of the technical record
消化大量技术文献
111:07
is something that they do.
是它们会做的事。
111:08
And so maybe you could even ask your favorite AI
所以也许你甚至可以问你最喜欢的AI
111:11
to suggest a paper that you might like
来为你推荐一篇你可能喜欢的论文
111:13
based on some things that you tell it.
根据你告诉它的一些东西。
111:15
I don't know if they're good at that,
我不知道它们是不是擅长这个,
111:17
but I'm guessing that's something they could do.
但我猜这是它们能做到的。
111:19
KC, thanks a bunch for this conversation.
KC,非常感谢这次的对话。
111:21
This was great.
这太棒了。
111:22
Thanks so much for having me.
非常感谢你邀请我。
111:23
It's been a pleasure.
非常愉快。
111:25
I've been wanting to talk about performance
我一直想和 KC 聊 performance
111:26
with KC for such a long time
已经很久了。
111:27
and I'm glad that we finally made it happen.
很高兴我们终于做到了。
111:29
I kind of wish the industry had more people
我有点希望这个行业能有更多人
111:31
as excited and interested in high-performance code
像 KC 一样
111:33
as KC is.
对 high-performance code 充满热情和兴趣。
111:34
If you made it to the end of this episode,
如果你听完了这期节目,
111:36
you might just be one of them.
你可能就是其中之一。
111:38
I appreciate it KC did not beat around the bush.
我很感激KC没有绕弯子。
111:40
If you care about performance,
如果你在乎performance,
111:41
you want to be able to read assembly
你就得能读assembly,
111:43
and spend some time reading it.
并且花些时间去读它。
111:45
Reading assembly several times easier than writing it.
读assembly比写assembly容易好几倍。
111:47
If you can read assembly,
如果你能读assembly,
111:48
you can see what's happening at the machine level.
你就能看到machine level上正在发生什么。
111:51
And it's a lot easier to understand,
而且这就容易理解多了,
111:52
for example, why programming language like Python
比如说,为什么像 Python 这样的编程语言
111:54
is much slower than something like Rust or C,
会比 Rust 或 C 慢得多。
111:56
when you see the assembly code for simple operations.
当你看到简单操作的assembly code时。
111:59
I was chocolateing one KC talked about these blog posts
我当时在和一个KC聊天,他谈到了这些blog posts。
112:01
about how we rewrote our services
关于我们如何用新的语言重写了我们的services,得到了10X performance improvement,以及那些重写通常不是关于。
112:03
in a new language and got 10X performance improvement
用一种新语言,获得了10X performance improvement。
112:05
and how those rewrites are usually not about
以及那些rewrites通常并不是关于
112:07
the new language with fixing the architecture
那种用来修复架构的新语言,
112:10
that caused the performance issues to start with.
这个架构从一开始就导致了那些性能问题。
112:12
And although we did not talk much about AI,
而且虽然我们没怎么聊AI,
112:14
I found it amusing for KC to say
我觉得KC说这句话很有意思,
112:16
that the games industry had its AI moment years ago.
他说游戏行业多年前就有了自己的AI时刻。
112:19
When game engines became accessible
当game engines变得人人可用,
112:20
to pretty much anyone wanting to build a game.
几乎对任何想做游戏的人来说都是如此。
112:23
Before, large teams were needed to build
以前,需要大型团队才能构建。
112:24
both a game engine and the game.
既是 game engine,又是游戏本身。
112:26
And now teams of one or two can create full-blown games.
而现在,一两个人的团队就能做出完整的游戏。
112:29
After a brief spike of positive effects
在短暂的正面效果激增之后,
112:31
with lots of new good games released,
随着大量优秀的新游戏发布,
112:34
games have flooded the market in such great number
游戏涌入市场的数量如此之多,
112:36
that it's now impossible for a new game
以至于现在一款新游戏
112:38
to become hit organically.
想要自然走红已经不可能了。
112:39
So marketing and distribution becomes mandatory
所以营销和分发就变得必不可少。
112:42
even for great games.
即使是对很棒的游戏来说。
112:43
For more deep dives related to game development
如需更多关于游戏开发的深度解析
112:45
and performance software,
以及与性能软件相关的内容,
112:46
check out the link the pragmatic engine
可以查看 The Pragmatic Engine 的链接,
112:48
deep dives on these topics.
里面有这些主题的深度解析。
112:49
If you've enjoyed this podcast,
如果你喜欢这档播客,
112:51
please do subscribe on your favorite podcast platform
请在你最喜欢的播客平台上订阅,
112:53
and on YouTube.
以及 YouTube。
112:54
And a big thank you if you also leave a rating on the show.
还有,如果你也在节目上给我们打个分,非常感谢。
112:56
Appreciate it and see you in the next one.
谢谢大家,我们下期再见。

Play Queue

☀️