[{"data":1,"prerenderedAt":213},["ShallowReactive",2],{"project-4570468":3},{"id":4,"name":5,"line":5,"line_source":6,"title":7,"url":8,"domain":9,"maker":10,"posted_at":11,"year":12,"points":13,"comments":14,"rank_in_year":15,"shown_in_year":16,"top":17,"tier":18,"category":19,"subcategory":20,"format":21,"keywords":22,"reception":26,"sentiment":27,"stance_mix":28,"scored_comments":33,"aspects":34,"strip":38,"post_text":40,"what":41,"said":63,"maker_in_thread":133,"shape":143,"grid":146,"attempts":174,"same_week":175,"maker_shows":204,"maker_hidden":205,"reader_version":206,"card":207},"4570468","A Genetic approach to CSS compression","title","Show HN: A Genetic approach to CSS compression","http:\u002F\u002Ffriggeri.net\u002Fblog\u002Fa-genetic-approach-to-css-compression\u002F","friggeri.net","friggeri",1348583034,2012,63,14,370,1677,23,"notable","dev_tools","css compression","library",[20,23,24,25],"genetic algorithm","gzip","minification","curious",0.071,{"positive":29,"neutral":30,"mixed":31,"critical":32},2,3,0,1,6,{"idea":35,"execution":36,"performance":37},{"positive":29,"critical":31},{"positive":31,"critical":32},{"positive":31,"critical":31},[31,39,31,32,30,31,30,31,31,30,31,31,31,39],5,null,{"problem":42,"audience":52,"pricing":40,"motivation":40,"time_to_build":40,"stack":59,"openness":60,"stage":61,"team_size":62},{"value":43,"source":44,"evidence":45},"Reducing CSS file size by reordering rules to compress better","inferred",[46,48],{"id":47},"post",{"id":49,"by":50,"text":51},"4570954","muxxa","What about if you rerun the genetic algorithm with the fitness function being the size of the final compressed+gzipped file? Maybe that could counter-intuitively reorder the CSS…",{"value":53,"source":44,"evidence":54},"Web developers optimizing CSS delivery",[55],{"id":56,"by":57,"text":58},"4570685","franze","``` however, although the resulting file size is smaller, once gzipped it actually leads to larger files than by only using minification, therefore this is a totally useless…",[],"open_source","prototype","unknown",{"praise":64,"objections":84,"requests":103,"questions":112,"alternatives":128},[65,77],{"value":66,"source":67,"evidence":68},"Interesting experiment despite being a dead end","commenter",[69,73],{"id":70,"by":71,"text":72},"4570729","justinsb","I really appreciate OP's honesty\u002Fhumility, and (presuming you're right franze) it shows that even things we ourselves consider to be dead-ends, may in fact be useful to different…",{"id":74,"by":75,"text":76},"4570916","halbermensch","Quite interesting though, as far as \"useless\" ideas go.",{"value":78,"source":79,"evidence":80},"Could be useful for mobile devices with small caches","maker",[81],{"id":82,"by":10,"text":83},"4570903","I was not aware of that at all, thanks for pointing it out. Looks like this could actually be a solution to something.",[85,89,96],{"value":86,"source":67,"evidence":87},"Gzipped output is larger than plain minification",[88],{"id":56,"by":57,"text":58},{"value":90,"source":67,"evidence":91},"Genetic algorithms are heuristics with no optimality guarantee",[92],{"id":93,"by":94,"text":95},"4571801","merraksh","The problem might be NP-hard, but with modern commercial (CPLEX, Gurobi, Xpress) and open-source (Cbc, SCIP) solvers for discrete optimization you can find a provably optimal…",{"value":97,"source":67,"evidence":98},"Non-deterministic, unclear how many generations to run",[99],{"id":100,"by":101,"text":102},"4570776","ganarajpr","Since GA is non-deterministic, you will never know how long \u002F for how many iterations ( generations) to run the GA for. If one could get a pretty good compression in around…",[104,108],{"value":105,"source":67,"evidence":106},"Use compressed file size as the fitness function",[107],{"id":49,"by":50,"text":51},{"value":109,"source":67,"evidence":110},"Try exact discrete optimization solvers instead",[111],{"id":93,"by":94,"text":95},[113],{"value":114,"source":67,"evidence":115},"Is gzip served on the fly or precompressed as best practice?",[116,120,124],{"id":117,"by":118,"text":119},"4570883","SageRaven","Best practice for serving .css files is gzippped? Is this at the file level or on-the-fly by the web server? In any case, why is this considered best practice? (I ask as a…",{"id":121,"by":122,"text":123},"4571103","sambeau","Generally on-the-fly by the web server, although you can, in theory, zip manually and serve. The big speed bottleneck when serving pages is the network so the smaller the file…",{"id":125,"by":126,"text":127},"4571246","icebraining","While most people do on-the-fly gzipping, I think that's it's best to just include static gzipping as part of the deployment process. Then you can use e.g. Nginx's…",[129],{"value":130,"source":67,"evidence":131},"Exact solvers such as CPLEX, Gurobi, Cbc and SCIP",[132],{"id":93,"by":94,"text":95},{"comments":134,"answered":32,"key":135},4,[136,137,140],{"id":82,"text":83},{"id":138,"text":139},"4570974","This is more or less what I hint to at the end of the article, I did look at it very fast but it did not yield very interesting results. The way I see it that this might be…",{"id":141,"text":142},"4571041","You might be onto something about the merge\u002Fsplit balance. Will definitely investigate in that direction.",{"commenters":144,"max_depth":134,"maker_replies":134,"first_comment_mins":145,"lifespan_hours":134},10,20,[147,149,151,153,155,157,159,161,163,166,168,170,172,173],[56,31,31,148,57,31],"commenter\u002Fneutral\u002Fperformance",[70,31,39,150,71,31],"maker\u002Fpositive\u002Fidea",[82,31,31,152,10,32],"project\u002Fpositive\u002Fidea",[93,32,32,154,94,31],"project\u002Fcritical\u002Fexecution",[49,29,30,156,50,31],"project\u002Fneutral\u002Fidea",[138,29,31,158,10,32],"project\u002Fneutral\u002Fexecution",[160,29,30,158,50,31],"4571012",[141,29,31,162,10,32],"maker\u002Fpositive\u002Fexecution",[164,30,31,165,10,32],"4570577","maker\u002Fneutral\u002Fnone",[100,30,30,167,101,31],"project\u002Fneutral\u002Fperformance",[117,134,31,169,118,31],"other\u002Fneutral\u002Fnone",[121,134,31,171,122,31],"other\u002Fneutral\u002Fperformance",[125,134,31,171,126,31],[74,39,39,152,75,31],[],[176,180,185,190,194,199],{"id":177,"name":178,"points":179,"category":19},"4570382","Ejecta",190,{"id":181,"name":182,"points":183,"category":184},"4556296","The Deeps",158,"games",{"id":186,"name":187,"points":188,"category":189},"4555423","5000 best",150,"consumer_social",{"id":191,"name":192,"points":193,"category":19},"4560410","assembly.ynh.io",149,{"id":195,"name":196,"points":197,"category":198},"4552914","Quantblocks",99,"finance_crypto",{"id":200,"name":201,"points":202,"category":203},"4548106","WP Simple Social",75,"web_saas",9,false,"v2",{"id":208,"name":5,"line":5,"ai":205,"cat":19,"year":12,"points":13,"comments":14,"rec":26,"s":209,"top":17,"kw":210,"maker":10,"domain":9,"tier":18,"attempts":31,"strip":211,"url":8,"mix":212,"praise":66,"objection":86,"sub":20},4570468,0.07,[20,23,24,25],"05013030030005",[29,30,31,32],1793990885648]