HNHacker News
TopNewBestAskShowJobs

0x07c0

134 karma · joined October 9, 2015

submissionscomments
0x07c0··on On the Madness of Optimizing Compilers
>And a good compiler doesn't only optimize for speed. It also optimizes for code size, memory usage.

No they don't. Code size is rarely a problem (embedded probably cares..). Optimizations will in most cases lead to larger code, loop unrolling, inline expansion etc. In c the compiler cant't, in most cases do anything about memory usage. (Probably could pack structs.. , but that is not something the compiler would do I think, you would break ABI with non optimized code). In managed languages, memory usages is probably more depended on the runtime system GC, then compilers.

GCC has a flag for code size optimization -Os https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html

0x07c0··on On the Madness of Optimizing Compilers
That number my have be true pre 2000, but with the move to parallel architectures it is grossly wrong. Optimization is not about saving a few cycles here and there. It is about using the whole machine, multiple chips, all with multiple cores. This cores are vector cores (AVX/SSE, altivec, etc). The chips are on different NUMA domains, the cores has pipelines, caches, etc, that has to be exploited... Compilers really don't do to much about this. This is now the job of the programmer. Speedup for codes that can exploit this, at least 20-30x. This adds up to loot of computer time... (add multiple accelerators (GPGPUs, MIC), and you can have 200-300x speedup on one node)
0x07c0··on Going Fast Slowly
I really like Douglas McIlroy concept of negative code.

Also, the varnish source is really nice! Pen kode ;)

http://programmers.stackexchange.com/questions/103807/what-i...

0x07c0··on Justice Department Wants Apple to Unlock Nine More iPhones
Cant a legal hack be to move core security development out of US jurisdiction, and let Apple USA lease tech from Apple Iceland/Switzerland/Ireland/etc, as is done with taxes today ? This would make Apple USA unable to fulfil any court order demanding change to source code.
0x07c0··on “GOTO Considered Harmful” Considered Harmful (1987) [pdf]
Well the part about asm was obviously a joke, control structures are nice to have. My point was that in many domains goto's are useful, both for solving problems, getting performance and for code clarity.
0x07c0··on “GOTO Considered Harmful” Considered Harmful (1987) [pdf]
stdlib do have this: #include <setjmp.h>

longjmp(BACK_TO_MAMA,1);

Never used this though.

0x07c0··on “GOTO Considered Harmful” Considered Harmful (1987) [pdf]
They are not corner cases, it rely depend on what domain you work in. Currently working on "tooling" for HPC application, and use goto all the time. Any form of system programming in c will probably have lots of goto's. Error handling being the most usual. Also some algos express them self best using goto's. And of course asm, try writing anything in asm without jumps :-)
0x07c0··on “GOTO Considered Harmful” Considered Harmful (1987) [pdf]
In my current project I use both. Direct coded lexer and a vm using gnu-c &&label.
0x07c0··on Turkey Shoots Down Russian Warplane Near Syrian Border
"..Turkish camps in Syria which the Turkmens are being trained, stating that it still takes place unofficially and in a secret way.[6][7] He added that Turkish Forces are training the Syrian Turks to protect their settlements and to join the fight with Syrian Turkmen Brigades in those secretly located camps. Nuceyfi also gave more information saying that Turkish officials have told that military supplies and weapons will be sent to Turkmens in Iraq and Syria in the near future but he isn't acquainted about the exact amount and date.

Later that day, Turkish 'officials' in Ankara, confirmed the statements of Esil Nuceyfi about the before and the positively promising future of the training of Turkmens both in Iraq and Syria" https://en.wikipedia.org/wiki/Syrian_Turkmen_Brigades#Brigad... http://www.telegraph.co.uk/news/worldnews/europe/turkey/1201...

0x07c0··on Turkey Shoots Down Russian Warplane Near Syrian Border
They also hit one of the rescue helicopters with a missile. Shooting down the plane, killing of the pilots in the air (by Turkish assets), ambush of rescue party. This looks like a planed provocation to me. http://www.reuters.com/article/2015/11/24/us-mideast-syria-c...
0x07c0··on Endless Sky: Open-Source Escape Velocity Successor
Used it the remove the shareware block (Capitan something )..
0x07c0··on Doubling the speed of jpegtran with SIMD
U can also use something like openMP (Newer versions has pragma's for SIMDs) to help the compiler expose parallelism in your code. (Hard fore a compiler to figure out the intent of the programmers. So be nice and give the the poor compiler some hints ;) ). Also many consumer grade chips have GPUs integrated, this can also be used for speeding things up.
0x07c0··on Doubling the speed of jpegtran with SIMD
If they get larger file sizes then that probably means they are doing something wrong. Optimized a mpg encoder with SSE once. And larger file size was usually do to some lose of floating point precision. Going thorough the functions and comparing output from serial to vector function should give the bug. Fixing this stuff also can give some more speed up!
← PreviousPage 2 of 2