https://gyazo.com/eb5c5741b6a9a16c692170a41a49c858.png

| Latency Comparison Numbers (~2012) | |
| ---------------------------------- | |
| L1 cache reference 0.5 ns | |
| Branch mispredict 5 ns | |
| L2 cache reference 7 ns 14x L1 cache | |
| Mutex lock/unlock 25 ns | |
| Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
| Compress 1K bytes with Zippy 3,000 ns 3 us | |
| Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
| Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
| /* This is the original elf.h file from the GNU C Library; I only removed | |
| the inclusion of feature.h and added definitions of __BEGIN_DECLS and | |
| __END_DECLS as documented in | |
| https://cmd.inp.nsk.su/old/cmd2/manuals/gnudocs/gnudocs/libtool/libtool_36.html | |
| On macOS, simply copy the file to /usr/local/include/. | |
| Mathias Lafeldt <[email protected]> */ | |
| /* This file defines standard ELF types, structures, and macros. |
| ;SMBDIS.ASM - A COMPREHENSIVE SUPER MARIO BROS. DISASSEMBLY | |
| ;by doppelganger ([email protected]) | |
| ;This file is provided for your own use as-is. It will require the character rom data | |
| ;and an iNES file header to get it to work. | |
| ;There are so many people I have to thank for this, that taking all the credit for | |
| ;myself would be an unforgivable act of arrogance. Without their help this would | |
| ;probably not be possible. So I thank all the peeps in the nesdev scene whose insight into | |
| ;the 6502 and the NES helped me learn how it works (you guys know who you are, there's no |
| setmetatable(_ENV, { __index=lpeg }) | |
| Scopes = { {} } | |
| function eval_expr(expr) | |
| local accum = eval(expr[2]) -- because 1 is "expr" | |
| for i = 3, #expr, 2 do | |
| local operator = expr[i] | |
| local num2 = eval(expr[i+1]) |
Friend: I tried looking at static linking in Mac OS X and it seems nearly impossible. Take a look at this http://stackoverflow.com/a/3801032
Me: I have no idea what that
-staticflag does, but I'm pretty sure that's not how you link to a library. Let me RTFM a bit.
Minutes later...
| #!/usr/bin/env python3 | |
| ''' | |
| test.c - clang -o test.so -fPIC -shared test.c | |
| ---------------------------------------------- | |
| extern int baz(); | |
| int foo() { | |
| return 42; | |
| } |
| 000(023Rb|001Rb) | |
| 001(017La|002Rb) | |
| 002(021La|003Rb) | |
| 003(021La|004La) | |
| 004(009Rb|005Lb) | |
| 005(004Ra|005La) | |
| 006(008La|007La) | |
| 007(009Rb|007La) | |
| 008(009Ra|008La) | |
| 009(010Ra|026Ra) |
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| # This script is a simple test to do image operations on pyopencl in combination with PIL | |
| # | |
| # based on the code of: https://gist.github.com/likr/3735779 | |
| import pyopencl as cl | |
| import numpy |