TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

What Happens If We Inline Everything?

33 点作者 abhi9u3 天前

1 comment

vrighter2 天前
I once did actually have to inline everything. Was making an EEPROM programmer using an arduino and two shift registers, and I wanted to make it go as fast as possible. I was sending data to it in packets over high speed serial, with an acknowledgement, and it had an internal buffer that could just barely not fill up (the EEPROM writing was slightly slower than the serial connection) as data was being consumed while processing a partial packet. It was so tightly constrained that if I didn't inline everything, the overhead of function calls was enough for the EEPROM writing to become just slow enough for the serial buffer to overflow, which meant I had to use a smaller buffer, which meant more idle time on the serial port, waiting for acknowledgements. Made the program huge, but in this case it did allow me to squeeze out every little bit of performance out of that tiny micro. I even had to patch out the timer interrupt code from the arduino core, as those interrupts were causing me to miss out on serial data.