保持你的code的L1缓存 [英] Keeping your code in L1 cache

查看:251
本文介绍了保持你的code的L1缓存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在读<一个href=\"http://en.wikipedia.org/wiki/K%5F%28programming%5Flanguage%29#Performance%5Fcharacteristics\">Wikipedia's日K编程语言一文,这是我所看到的:

I have been reading Wikipedia's article on K programming language and this is what I saw:

国米preTER和语言的语法结构紧凑的小尺寸使得它可以在K应用程序完全符合处理器的一级缓存中。

The small size of the interpreter and compact syntax of the language makes it possible for K applications to fit entirely within the level 1 cache of the processor.

我感兴趣。怎么可能有在L1缓存整个程序?再说了,CPU有256KB L1缓存。说我的节目比方式以下,它需要的内存很少量(例如,仅仅为调用栈和这样)。比方说,它不需要任何库(虽然如果一个程序是一个操作系统,它需要包括KERNEL32.DLL或其他)。并且不OS自动分配,任何程序部分的内存(当然,可执行code和栈和堆)?

I am intrigued. How is it possible to have the whole program in L1 cache? Say, CPU has 256kb L1 cache. Say my program is way less than that and it needs a very little amount of memory (say, just for the call stack and such). Say, it doesn't need any libraries (although if a program is for an OS, it would need to include kernel32.dll or whatever). And doesn't OS automatically allocates some minimal memory for any program (well, for executable code and stack and heap)?

感谢您。

推荐答案

我觉得他们说的是不是整个程序适合在L1缓存,但所有运行大部分时间拟合的code在L1缓存。

I think what they're saying is not that the entire program fits in L1 cache, but that all the code that runs most of the time fits in the L1 cache.

是的,OS分配很多其他的结构,但这些都是很少打够没有关系。

Yes, the OS allocates lots of other structures, but those are hit rarely enough to not matter.

当然,这都是猜测 - 我一无所知'K'的语言

Of course, this is all speculation -- I know nothing about the 'K' language.

这篇关于保持你的code的L1缓存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆