由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - 问个硬件加OO的面试题
相关主题
a virtual table question by JP morgan微软C++面试题
Virtual pointer是每个object都有一个吗?问个apple的面试的问题
问几个跟C++有关的面试题Amazon offer 选择 附面经
面试题[合集] 一道面试题
one C++ question?一道面试题
virtual destructor (C++)问题问个C++重新编译的问题
请问这是什么level的面试题问道C的面试题
最新微软SDE II面试题请教一道Google面试题
相关话题的讨论汇总
话题: type话题: cache话题: 100话题: pc话题: levels
进入JobHunting版参与讨论
1 (共1页)
g*c
发帖数: 4510
1
一个type有一百个level,就是说parent和grandparent有100个level
一个type有两个level
这两个type的performance会怎样
我回答是create是perf有差别,用起来没差别
然后面试官就提到了CPU L1 L2 cache和pointer jump,我想了一下,回答说因为都是
Derived type,所以用起来还是没差别。
不知道有没有miss了什么?请高人指点。多谢!
x*****z
发帖数: 15
2
http://www.learncpp.com/cpp-tutorial/125-the-virtual-table/
So it looks like cache performance could be different, depending on how many
vtable have to be accessed. Like 100 functions implemented in 100 levels vs
in 2 levels. Not sure tough.
g*c
发帖数: 4510
3
应该是证明了我答的没错

many
vs

【在 x*****z 的大作中提到】
: http://www.learncpp.com/cpp-tutorial/125-the-virtual-table/
: So it looks like cache performance could be different, depending on how many
: vtable have to be accessed. Like 100 functions implemented in 100 levels vs
: in 2 levels. Not sure tough.

g*c
发帖数: 4510
4
多谢,应该是证明了我答的没错

many
vs

【在 x*****z 的大作中提到】
: http://www.learncpp.com/cpp-tutorial/125-the-virtual-table/
: So it looks like cache performance could be different, depending on how many
: vtable have to be accessed. Like 100 functions implemented in 100 levels vs
: in 2 levels. Not sure tough.

r***0
发帖数: 406
5
I may think you (LZ) are wrong. With the 100 levels, the instruction cache
won't work well for prefetch. The instruction stream prefetch usually works
at PC incr or PC decr two directions. But if the derived type pointer
chasing to 100 different target, I think the cache performance will drop.
Please update if you figure out the answer.

【在 g*c 的大作中提到】
: 多谢,应该是证明了我答的没错
:
: many
: vs

1 (共1页)
进入JobHunting版参与讨论
相关主题
请教一道Google面试题one C++ question?
谁能解释下这道c++的面试题virtual destructor (C++)问题
Tricky Pointer Problems -- Which level are you?请问这是什么level的面试题
面试题最新微软SDE II面试题
a virtual table question by JP morgan微软C++面试题
Virtual pointer是每个object都有一个吗?问个apple的面试的问题
问几个跟C++有关的面试题Amazon offer 选择 附面经
面试题[合集] 一道面试题
相关话题的讨论汇总
话题: type话题: cache话题: 100话题: pc话题: levels