Igor Ostrovsky
igoro.com · Personal blog · on HN since 2008
Igor Ostrovsky, a software engineer, writes explanatory posts on CPU caches, branch prediction, RAID, GPUs, and the C# memory model.
What HN saysHN commenters call the whole blog a nice read and link its processor cache effects gallery, RAID-6 explanation, and volatile keyword memory model post.
35HN people shared it
6linked it in comments
39stories submitted
827story points
8 months agolast shared
2008people per year2026
Most-shared posts
- 1Gallery of Processor Cache Effects13 people · 426 points · first shared 2010 · 36 comments on HN
- 2How RAID-6 dual parity calculation works3 people · 56 points · first shared 2014 · 7 comments on HN
- 3Human heart is a Turing machine, research on XBox 360 shows. Wait, what?3 people · 38 points · first shared 2009 · 6 comments on HN
- 4How GPU came to be used for general computation2 people · 52 points · first shared 2010 · 17 comments on HN
- 5Fast and slow if-statements: branch prediction in modern processors2 people · 37 points · first shared 2010 · 24 comments on HN
- 6How to write a self-printing program2 people · 21 points · first shared 2012 · 14 comments on HN
- 7What really happens when you navigate to a URL2 people · 7 points · first shared 2010 · discussion on HN
- 8Is two to the power of infinity more than infinity?2 people · 7 points · first shared 2015 · 1 comments on HN
- 9Efficient auto-complete with a ternary search tree2 people · 4 points · first shared 2009 · discussion on HN
- 10Self-printing Game of Life in C#2 people · 3 points · first shared 2008 · discussion on HN
- 11Skip Lists are Fascinating1 people · 112 points · first shared 2011 · 34 comments on HN
- 12NET Memory model and the volatile keyword (2010)1 people · 35 points · first shared 2015 · 3 comments on HN
- 13Graphs, trees, and the origin of humanity1 people · 19 points · first shared 2010 · 2 comments on HN
- 14RoboZZle hacked, and 100+ sites are still compromised1 people · 3 points · first shared 2009 · discussion on HN
- 15A neat trick to express multi-clause if statements in C++, C# or Java1 people · 2 points · first shared 2008 · discussion on HN
What HN people wrote when they linked it
mratsim · 2019-11-22
Good question.
I can't find a single SPIR-V AXPY (a*X+y) example which is the Hello World of linear algebra in Vulkan/SPIR-V so I'm not optimistic on ease of use.
You can probably do texture hacks like what people did in 2006 when they realized that GPU were fast for linear algebra and OpenCL/Cuda did not exist (https://igoro.com/archive/how-gpu-came-to-be-used-for-general-computat…
The best would probably be to follow this Halide issue and the corresponding branches: https://github.com/halide/Halide/issues/2296. Note that Halide is a compiler so it automates lots of the boilerplate that is probably needed to Vulkan for compute compared to Cuda.
FrankyHollywood · 2023-05-22
This is a nice read too (the whole blog actually)
http://igoro.com/archive/volatile-keyword-in-c-memory-model-explained/
It's a bit old by now (2010), but I always remembered the mental model Igor created.
thomas43 · 2020-06-20
Do you have some more detaile about your app?
I use perf, sysprof, trace32, visual studio profiler for profiling, but this highly depends on your environment.
These assorted links might be interesting to you:
- https://github.com/Kobzol/hardware-effects
- https://www.youtube.com/watch?v=FJJTYQYB1JQ
- https://godbolt.org/
- http://igoro.com/archive/gallery-of-processor-cache-effects/
gameshot911 · 2018-05-16
Link below with more info, for those who were interested like me!
http://igoro.com/archive/how-raid-6-dual-parity-calculation-works/
xtacy · 2011-12-18
On a related node, this page also has an interesting visualisation of the effects of cache misses on program performance: http://igoro.com/archive/gallery-of-processor-cache-effects
malkia · 2015-08-10
Long time ago, I've did some experiments with luajit and branching (well more like the CPU). It was based on this article: http://igoro.com/archive/fast-and-slow-if-statements-branch-prediction…
https://raw.githubusercontent.com/malkia/ufo/master/samples/bench/badi…
local ffi = require("ffi")
local band = bit.band
local function test(n, m)
local count = 0; for i=1, n do if band(i, m)==0 then count = count + 1 end end return count
end
local function timeit(m)
local t = os.clock()
test(0xFFFFFFF,m)
local t = os.clock() - t
print(string.format("%08X",m),t)
end
timeit(0x80000000)
timeit(0xffffffff)
timeit(1)
timeit(3)
timeit(2)
timeit(4)
timeit(8)
timeit(16)
--[[
-- This is on OSX 10.7.2 MBP 2008 Jan build
./luajit samples/badif.lua
80000000 14.067395
FFFFFFFF 20.252955
00000001 13.497108
00000003 17.337942
00000002 14.142266
00000004 14.221376
00000008 14.42377
00000010 14.708237
--]]
Results now - 2015 (again Macbook OSX, much better than before and also luajit 2.0.4):
80000000 0.247822
FFFFFFFF 1.253168
00000001 0.664586
00000003 0.974336
00000002 0.676823
00000004 0.679609
00000008 0.675207
00000010 0.673961
without jit, just interpretter (pretty much the same results):
$ src/luajit -joff ~/badif.lua
80000000 3.329909
FFFFFFFF 3.553143
00000001 3.440378
00000003 3.484646
00000002 3.424834
00000004 3.424539
00000008 3.616981
…