As one data point, here's a histogram of the 20k or so calls to number->string that happen during the start up of DrRacket (first entry in each list is the argument passed to number->string and the second is the number of times that call happened):
'((0 2399) (1 8116) (2 4278) (3 2196) (4 1346) (5 901) (6 364) (7 230) (8 106) (9 96) (10 42) (11 5) (12 3) (72 1) (100 34) (241 1)) Two others apps we care about are building the documentation and recompiling all of the .zos in the main distribution. (But we might also just decide that we don't care if number->string is fast, too.) Robby On Sat, Dec 31, 2016 at 1:57 PM, Robby Findler <ro...@eecs.northwestern.edu> wrote: > On Sat, Dec 31, 2016 at 12:57 PM, Matthew Butterick <m...@mbtype.com> wrote: >> Is it cheating to avoid divisions by using table lookups? > > Everything is fair in love, war, and benchmarking. :) > > But this introduces an additional cost that's a little bit more > troublesome to measure. Specifically, each namespace that instantiates > `racket/base` will now take a tiny bit more space and take a tiny bit > longer to initialize. I think this would boil down to a judgment call, > but a first step before making that judgment call would be to get some > benchmarks we think are representative (that actually call > number->string) and figure out what inputs they supply (and how often > they supply them). Based on that, then minimize the size of the table > and then I'd say that we're in a good position to make the judgment > call. > > Robby -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.