From: Eric Wong Date: 2015-12-03T22:51:08+00:00 Subject: [ruby-core:71819] Re: [Ruby trunk - Bug #11768] [Open] Add a polymorphic inline cache tenderlove@ruby-lang.org wrote: > I haven't run every benchmark that's checked in, but this patch speeds > up the polymorphic call benchmark by about 20%. Nice! > The down side of this patch is that it increases memory usage because > the size of the call cache struct gets larger, even if the call site > is monomorphic. I think we could make the code expand and contract, > but I'm not sure if it's worthwhile. Perhaps you can simplify the code so the existing monomorphic cache is just: POLYMORPHIC_CACHE_SIZE == 1 By the way, how did you arrive at the value of 6? Memory usage is a bigger problem of Ruby than speed to me; so maybe a smaller value is a compromise. > The other downside is that it will probably slow down calls if the > global method state changes, but I don't think that is a situation we > should optimize for. Agreed. Did you measure startup performance?