**Abstract:** We study first-passage percolation through related optimization problems over paths of restricted length. The path length variable is in duality with a shift of the weights. This puts into a convex duality framework old observations about the convergence of the normalized Euclidean length of geodesics due to Hammersley and Welsh, Smythe and Wierman, and Kesten, and leads to new results about geodesic length and the regularity of the shape function as a function of the weight shift. For points far enough away from the origin, the ratio of the geodesic length and the $\ell^1$ distance to the endpoint is uniformly bounded away from one. The shape function is a strictly concave function of the weight shift. Atoms of the weight distribution generate singularities, that is, points of nondifferentiability, in this function. We generalize to all distributions, directions and dimensions an old singularity result of Steele and Zhang for the planar Bernoulli case. When the weight distribution has two or more atoms, a dense set of shifts produce singularities. The results come from a combination of the convex duality, the shape theorems of the different first-passage optimization problems, and modification arguments. This is joint work with Arjun Krishnan and Timo Seppalainen.