recentpopularlog in

mcherm : optimization   35

PyPy Status Blog: PyPy's new JSON parser
Several clever ways to speed up JSON parsing. My favorites: guess the next field name and verify with memcmp (saves parsing the string), and for common sets of field names, don't make hashmaps but instead use a data structure with a single copy of the fields and arrays for all the instance values.
programming  algorithms  datastructures  optimization  pypy 
5 weeks ago by mcherm
Why const Doesn't Make C Code Faster — The Art of Machinery
Someone could cast away const, so the compiler can only optimize const variables in cases where it sees all uses and could have optimized anyway. As proof, sqlite runs equally fast with and without const.
programming  optimization  via:HackerNews 
august 2019 by mcherm
A Branchless UTF-8 Decoder « null program
He writes a UTF-8 decoder with no if statements or loops so it can be pipelined in modern CPUs. Also does a great job of explaining why the design of the UTF-8 encoding is so brilliant.
programming  unicode  optimization  via:HackerNews 
october 2017 by mcherm
Apples and Oranges: The fallacy of programming language performance comparisons : CodePerformance
He sped up the C code in someone's benchmark by more than 800x. Moral: get someone who knows language X involved in writing a benchmark with language X.
optimization  performance  C  via:reddit 
april 2016 by mcherm
Searching 20 GB/sec: Systems Engineering Before Algorithms - Scalyr Blog
To search effectively, they didn't build any indexes, but the instead optimized the inner loop of a linear search through the entire set of data. The article discusses when that approach is better than using a fancy algorithm.
algorithms  scalability  optimization  via:reddit 
october 2014 by mcherm
From 60 Frames per Second to 500 in Haskell | Keera Studios
How they got a 700% speedup in a Haskell game with one use of unsafePerformIO, a few "bangs", and 15 lines of code.
optimization  haskell  performance  profiling  via:HackerNews 
october 2014 by mcherm
Domain specific evaluation orders | David R. MacIver
A really interesting performance improvement: recognize when instances are just intermediate results, and switch around the data structures and/or algorithms and/or evaluation order to optimize performance in these cases.
programming  performance  via:DavidMacIver  DavidMacIver  algorithms  optimization 
january 2014 by mcherm
Changes to String in Java 1.7.0_06 - Java Performance Tuning Guide
In 1.7.0_06, java changed String so substrings can no longer share memory. Their analysis says almost all strings are small so it gave little benefit.
java  jdk  optimization  algorithms  via:reddit  programming 
november 2013 by mcherm
Three years later, Mr. Moore is still letting us punt on database sharding - (37signals)
Today, the cost of RAM and SSD storage is so cheap that hey, maybe you CAN run everything on one big server. Even if multiple shards would be fairly easy to do, even just the cost of administering multiple machines may make it worth using just one.
optimization  database  via:HackerNews 
january 2012 by mcherm
'Re: Why Git is so fast (was: Re: Eric Sink's blog - notes on git,' - MARC
A technical and low-level analysis of why certain kinds of code (in this case, the source to Git) can be made faster when written in C than when written in Java. Gives a pretty good idea of what kind of problem space C is best for.
programming  languages  languagedesign  C  java  optimization  via:HackerNews 
january 2012 by mcherm
When Good Data Structures are Not the Right Choice
Strings in .Net have a length prefix and a \0 suffix. This means substring() can’t re-use sections and concatenation can’t build a rope. They COULD build a second implementation make these two things efficient. But performance tests show it’s not worth it because most of the time developers use short strings. Big-O analysis doesn’t matter if most of your use cases are small!
via:EricLippert  EricLippert  optimization  programming  datastructures 
july 2011 by mcherm
A day in the life of a slow page at Stack Overflow
How Object-Relational-Mapping and a poorly defined set of database indexes cost a factor of 10x to 100x.
programming  optimization  performance  database  via:reddit 
may 2011 by mcherm
Scheme faster and easier than C?
For his algorithms class, the rest used C or assembly. He used scheme and then used correctness-preserving transformations to make the second fastest program.
programming  languages  scheme  optimization  performance  via:HackerNews 
february 2011 by mcherm
Android Developers Blog: New Gingerbread API: StrictMode
to keep android running fast they built a mode where it gripes at you every time a piece of code runs slow.
programming  androiddev  performance  google  optimization 
december 2010 by mcherm
You can’t beat a good compiler… right? »
A rare example of assembly-level optimization. In this case, he writes pure C code, but reads the assembly to tweak the code until the optimizer generates far better code.
assembly  C  programming  optimization  via:HackerNews  LouisBrandy 
july 2010 by mcherm
Embedded in Academia : C Compilers Disprove Fermat’s Last Theorem
An optimizing compiler keeps removing his infinite loops. He tries to outfox it by giving it Fermat's Last Theorem to prove. But it still removes the loop. (Answer: he forgot to use the answer.)
programming  optimization  compiler 
may 2010 by mcherm
Google Closure: How not to write JavaScript
A bunch of examples which demonstrate the Google's javascript library "closure" was written by Java programmers and uses lots of java idioms to its detriment. It compares unfavorably with something like jQuery.
javascript  programming  google  jquery  optimization  via:HackerNews 
november 2009 by mcherm
PyPy Status Blog: GC improvements
A couple of very clever hacks to save 2 words (usually 8 bytes) for each and every object. Very nicely written and explained. This comes out of the PyPy project, a project for which I have the greatest of respect.
memory  optimization  pypy  ArminRigo  hack 
october 2009 by mcherm
Java theory and practice: Urban performance legends, revisited
Why Java's memory allocation is typically even faster than C's, for typical usage patterns. Also how escape analysis can allow the JVM to store some stuff on the stack instead of the heap.
java  programming  jvm  optimization  memory  performance  C++  garbagecollection  via:HackerNews 
october 2009 by mcherm
Humans and compilers need each other: the VLIW SIMD case
There are some kinds of optimizations a compiler cannot perform but a programmer can. They consist of cases where you negotiate a change in the requirements to make use of some optimization that was just out of reach. Interesting thought: what about a compiler that gave feedback on missed optimization opportunities.
programming  optimization  compiler 
september 2009 by mcherm
Page Speed Home
A tool from Google for making web pages load faster. Check it out.
webdevelopment  google  optimization  html  todo  via:reddit 
june 2009 by mcherm
The "C is Efficient" Language Fallacy : Good Math, Bad Math
People often say "C is fast" because "C is close to the machine". But it's not true. C is close to how machines used to work long ago. Today, they have caching, pipelining and lots of other tricks. Often C is primitive enough that the compiler doesn't dare be "smart" (because of things like "aliasing" -- do these 2 pointers point to the same memory?). Mark Chu-Carroll tried several different languages (well optimized) on a real-world problem and found OCaml to be fastest!
optimization  programming  parallelprogramming  languages  compiler  via:reddit  markcc  ocaml 
may 2009 by mcherm
Short String Optimization - Thatcher's rants and musings
An example of a very clever optimization trick that squeezes out one more byte. Useful, but only for this kind of very-close-to-the-machine work.
via:reddit  programming  optimization 
may 2009 by mcherm
assertTrue( ): How to write fast code
A useful insight: computers run at a fixed speed -- you can NOT "make your code run faster". Instead, seek to make your code DO less.
programming  philosophy  via:EricSink  optimization 
march 2009 by mcherm
PyPy Status Blog: Applying a Tracing JIT to an Interpreter
The PyPy project is creating a JIT to optimize an interpreter for a language. But interpreters for languages need special handling. For instance, you don't want to optimize just the bytecode interpretation loop, you want to optimize entire loops in the language being interpreted! This shows (generally... the specifics are made up) how to provide annotations for the JIT that permit this.
optimization  python  programming  compiler  pypy  jit  vm 
march 2009 by mcherm
Optimize all your PNG and JPEG images with one command using imgopt |
Somebody sticks together a script to run all the image size optimization tools one after another -- apparently the results are noticeably better than running just one of them. Also I hadn't realized that tuning your compression algorithm made this much difference.
compression  optimization  webdevelopment  webdesign  graphics  images  programming 
march 2009 by mcherm
The Sad Tragedy of Micro-Optimization Theater: Coding Horror
Every programmer who is seriously concerned about optimizing their code should read this article. Really.
programming  via:CodingHorror  JeffAtwood  optimization  performance 
february 2009 by mcherm
Proebsting's Law
This fellow claims that many years of advancement in optimizing compilers still gives only a tiny advance -- perhaps it's not worth it!
programming  performance  optimization  compilers 
september 2008 by mcherm
Dynamic Languages Strike Back: Stevey's Blog Rants
A transcript of a talk by Steve Yegge about how to make dynamic languages fast.
languages  programming  programminglanguages  yegge  compiler  dynamic  languagedesign  optimization 
may 2008 by mcherm
Firefox 3 Memory Usage «
Interesting review of what the Firefox developers did to minimize memory usage. Does YOUR application get this kind of delicate care?
firefox  programming  memory  optimization 
march 2008 by mcherm
Sorting revisited
Comparison of some sort algorithms written in C and heavily optimized, as compiled by different compilers. Moral of the story: intel's compiler is good!
optimization  algorithms  programming 
february 2008 by mcherm > Graphics Programming Black Book by Michael Abrash
A book on optimization (down to assembly, particularly focused on graphics) that's available as a free PDF. It's old (486 code) but quite well written. See, for instance, the chapter on linked lists.
assembly  programming  optimization  books  graphics  gameprogramming 
february 2008 by mcherm
Cowboy Programming » Mature Optimization
Article describing when it IS good to do early optimization, particularly in game programming.
programming  blogentry  gameprogramming  optimization 
october 2007 by mcherm

Copy this bookmark:

to read