{"id":177,"date":"2013-08-19T21:33:29","date_gmt":"2013-08-19T21:33:29","guid":{"rendered":"http:\/\/blogs.gentoo.org\/lu_zero\/?p=177"},"modified":"2013-08-20T11:20:43","modified_gmt":"2013-08-20T11:20:43","slug":"trades","status":"publish","type":"post","link":"https:\/\/blogs.gentoo.org\/lu_zero\/2013\/08\/19\/trades\/","title":{"rendered":"Trades"},"content":{"rendered":"<p>The code <strong>must<\/strong> be properly formatted, nice to read. You <strong>must<\/strong> have testcases.<\/p>\n<ul>\n<li>Always start with simple even dumb code. (e.g. as is written in the spec you write it down no matter how stupid or inefficient)<\/li>\n<li>Trade simplicity\/clarity for speed, if the gain is big. (e.g. move from the letter-of-the-spec-matching code to something actually faster, sometimes also clarity and simplicity gain from it)<\/li>\n<li>Trade space for speed, if the gain is big enough. (e.g. a lookup table usually is a nice solution, sometimes for a different problem)<\/li>\n<li>Trade precision for speed if you must, always leave a codepath that isn&#8217;t imprecise.<\/li>\n<li>Never trade portability, but you might trade slower generic code for faster specialized code for all the platform implementing it. (e.g. implement in asm a function that was inlined before, the plain C code would be slower since you have a call overhead while the asm-optimized version would be 16-fold faster than C)<\/li>\n<\/ul>\n<p>As <a href=\"http:\/\/codecs.multimedia.cx\/\">Kostya<\/a> pointed, sometimes you start with a binary specification so point 1 is moot.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The code must be properly formatted, nice to read. You must have testcases. Always start with simple even dumb code. (e.g. as is written in the spec you write it down no matter how stupid or inefficient) Trade simplicity\/clarity for speed, if the gain is big. (e.g. move from the letter-of-the-spec-matching code to something actually &hellip; <a href=\"https:\/\/blogs.gentoo.org\/lu_zero\/2013\/08\/19\/trades\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Trades<\/span><\/a><\/p>\n","protected":false},"author":10,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true},"categories":[6],"tags":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/s1aGWH-trades","_links":{"self":[{"href":"https:\/\/blogs.gentoo.org\/lu_zero\/wp-json\/wp\/v2\/posts\/177"}],"collection":[{"href":"https:\/\/blogs.gentoo.org\/lu_zero\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.gentoo.org\/lu_zero\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.gentoo.org\/lu_zero\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.gentoo.org\/lu_zero\/wp-json\/wp\/v2\/comments?post=177"}],"version-history":[{"count":3,"href":"https:\/\/blogs.gentoo.org\/lu_zero\/wp-json\/wp\/v2\/posts\/177\/revisions"}],"predecessor-version":[{"id":179,"href":"https:\/\/blogs.gentoo.org\/lu_zero\/wp-json\/wp\/v2\/posts\/177\/revisions\/179"}],"wp:attachment":[{"href":"https:\/\/blogs.gentoo.org\/lu_zero\/wp-json\/wp\/v2\/media?parent=177"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/lu_zero\/wp-json\/wp\/v2\/categories?post=177"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/lu_zero\/wp-json\/wp\/v2\/tags?post=177"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}