A Genetic approach to CSS compression

Dev tools

css compression

SHOW HN2012

63points
14comments
#370of 1,677 in 2012
Top 23%of 2012 by points

How HN took it

CuriousMostly questions and neutral comments

2 positive, 3 neutral or asking, 0 mixed, 1 critical, out of 6 comments about the project. Thread score +0.07.

Idea: 2 for, 0 againstExecution: 0 for, 1 against

The thread, comment by comment

Each row is a top-level comment and its replies, in HN's order. Select a cell to open that comment on HN.

positive neutral or mixed critical about another commenter or something else the maker

What HN said

What people liked

  • Interesting experiment despite being a dead end

    From 2 comments
    • I really appreciate OP's honesty/humility, 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…
      justinsb on HN
    • Quite interesting though, as far as "useless" ideas go.
      halbermensch on HN
  • Could be useful for mobile devices with small caches

    From 1 comment
    • I was not aware of that at all, thanks for pointing it out. Looks like this could actually be a solution to something.
      friggeri on HN

Objections

  • Gzipped output is larger than plain minification

    From 1 comment
    • ``` 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…
      franze on HN
  • Genetic algorithms are heuristics with no optimality guarantee

    From 1 comment
    • 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…
      merraksh on HN
  • Non-deterministic, unclear how many generations to run

    From 1 comment
    • Since GA is non-deterministic, you will never know how long / for how many iterations ( generations) to run the GA for. If one could get a pretty good compression in around…
      ganarajpr on HN

Requests

  • Use compressed file size as the fitness function

    From 1 comment
    • 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…
      muxxa on HN
  • Try exact discrete optimization solvers instead

    From 1 comment
    • 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…
      merraksh on HN

Questions

  • Is gzip served on the fly or precompressed as best practice?

    From 3 comments
    • 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…
      SageRaven on HN
    • 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…
      sambeau on HN
    • 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…
      icebraining on HN

Alternatives named

  • Exact solvers such as CPLEX, Gurobi, Cbc and SCIP

    From 1 comment
    • 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…
      merraksh on HN

Category, keywords, summaries and labels on this page were made by AI (Thread Reader v2) and not checked by hand. Each point links to the comments it came from.

Add a badge to your READMEShown on HackerShow
[![Shown on HackerShow](https://hackershow.org/badge.svg)](https://hackershow.org/show/4570468)