Try to get a more specific class instead of using the Map interface
i.e., invokevirtual is significantly faster then invokeinterface.
184385
private Class getMapType()
  {
    Class mapType = Map.class;
    IParsedElement parent = getParsedElement().getParent();
    if( parent instanceof NewExpression )
    {
      IType newType = ((NewExpression)parent).getType();
      IJavaClassInfo classInfo = IRTypeResolver.getJavaBackedClass(newType);
      Class javaBackedClass = classInfo != null ? classInfo.getBackingClass() : null;
      if( classInfo != null && javaBackedClass != null )
      {
        mapType = javaBackedClass;
      }
      else if( JavaTypes.getJreType(AbstractMap.class).isAssignableFrom( newType ) )
      {
        mapType = AbstractMap.class;
      }
    }
    return mapType;
  }
1229664
def visit_class(rec, cls, op):
    # type: (Any, Iterable, Union[Callable[..., Any], partial[Any]]) -> None
    """"""

    if isinstance(rec, MutableMapping):
        if "class" in rec and rec.get("class") in cls:
            op(rec)
        for d in rec:
            visit_class(rec[d], cls, op)
    if isinstance(rec, MutableSequence):
        for d in rec:
            visit_class(d, cls, op)
697599
@PerformanceSensitive
    public Class<?> getCallerClass(final Class<?> anchor) {
        boolean next = false;
        Class<?> clazz;
        for (int i = 2; null != (clazz = getCallerClass(i)); i++) {
            if (anchor.equals(clazz)) {
                next = true;
                continue;
            }
            if (next) {
                return clazz;
            }
        }
        return Object.class;
    }
868026
public static FastWritable tryGetInstance(String name, Configuration conf) {
    if (name.length() != NAME_LEN) {
      // we use it to fast discard the request without doing map lookup
      return null;
    }
    FastWritable fw = register.get(name);
    return fw == null ? null : fw.getFastWritableInstance(conf);
  }
12113
private <T> T instantiateClass(PropertyKey propertyKey) {
        T object = null;
        String property = properties.getProperty(propertyKey.getKey());
        if (property != null) {
            try {
                Class<T> clazz = ClassLoaderUtils.loadClass(property);
                LOGGER.debug("Instantiate {}", clazz);
                object = clazz.newInstance();
            } catch (ClassNotFoundException e) {
                LOGGER.error("Couldn't load the " + property + " class given by the " + propertyKey + " property", e);
            } catch (InstantiationException e) {
                LOGGER.error("Couldn't instantiate the " + property + " class given by the " + propertyKey + " property", e);
            } catch (IllegalAccessException e) {
                LOGGER.error("Couldn't access the " + property + " class given by the " + propertyKey + " property", e);
            }
        }
        return object;
    }
602804
def incver(o, prop_names):
    """"""
    from ambry.identity import ObjectNumber

    d = {}

    for p in o.__mapper__.attrs:
        v = getattr(o, p.key)
        if v is None:
            d[p.key] = None
        elif p.key in prop_names:
            d[p.key] = str(ObjectNumber.increment(v))
        else:
            if not hasattr(v, '__mapper__'): # Only copy values, never objects
                d[p.key] = v

    return o.__class__(**d)
109985
public static <T extends MethodDescription> ElementMatcher.Junction<T> isVirtual() {
        return new MethodSortMatcher<T>(MethodSortMatcher.Sort.VIRTUAL);
    }
555239
private static Object getPluginImplementationViaProperty(Class<?> pluginClass) {
		String className = pluginClass.getCanonicalName();
		if (className == null) {
			throw new IllegalArgumentException("Class " + pluginClass + " does not have a canonical name!");
		}
		// Check system properties for plugin class.
		// This will only happen during system startup thus it's okay to use the synchronized
		// System.getProperties as it will never get called in normal operations.
		String implementingClass = System.getProperty(PROPERTY_PREFIX + className);
		if (implementingClass != null) {
			try {
				Class<?> cls = Class.forName(implementingClass);
				// narrow the scope (cast) to the type we're expecting
				cls = cls.asSubclass(pluginClass);
				return cls.newInstance();
			} catch (ClassCastException e) {
				throw new RuntimeException(className + " implementation is not an instance of " + className + ": " + implementingClass);
			} catch (ClassNotFoundException e) {
				throw new RuntimeException(className + " implementation class not found: " + implementingClass, e);
			} catch (InstantiationException e) {
				throw new RuntimeException(className + " implementation not able to be instantiated: " + implementingClass, e);
			} catch (IllegalAccessException e) {
				throw new RuntimeException(className + " implementation not able to be accessed: " + implementingClass, e);
			}
		} else {
			return null;
		}
	}
1172072
private Map<Class<?>, Integer> getGlobalAlternativeMap() {
        if (cachedAlternativeMap == null || dirty) {
            Map<Class<?>, Integer> map = new HashMap<Class<?>, Integer>();
            for (Item item : alternatives) {
                map.put(item.getJavaClass(), item.getPriority());
            }
            cachedAlternativeMap = ImmutableMap.copyOf(map);
        }
        return cachedAlternativeMap;
    }
562088
public Object getRealObjectIfMaterialized(Object objectOrProxy)
    {
        if(isNormalOjbProxy(objectOrProxy))
        {
            String msg;

            try
            {
                IndirectionHandler handler = getIndirectionHandler(objectOrProxy);

                return handler.alreadyMaterialized() ? handler.getRealSubject() : null;
            }
            catch(ClassCastException e)
            {
                // shouldn't happen but still ...
                msg = "The InvocationHandler for the provided Proxy was not an instance of " + IndirectionHandler.class.getName();
                log.error(msg);
                throw new PersistenceBrokerException(msg, e);
            }
            catch(IllegalArgumentException e)
            {
                msg = "Could not retrieve real object for given Proxy: " + objectOrProxy;
                log.error(msg);
                throw new PersistenceBrokerException(msg, e);
            }
            catch(PersistenceBrokerException e)
            {
                log.error("Could not retrieve real object for given Proxy: " + objectOrProxy);
                throw e;
            }
        }
        else if(isVirtualOjbProxy(objectOrProxy))
        {
            try
            {
                VirtualProxy proxy = (VirtualProxy) objectOrProxy;

                return proxy.alreadyMaterialized() ? proxy.getRealSubject() : null;
            }
            catch(PersistenceBrokerException e)
            {
                log.error("Could not retrieve real object for VirtualProxy: " + objectOrProxy);
                throw e;
            }
        }
        else
        {
            return objectOrProxy;
        }
    }
1214387
public Class<?> getClass(final String key) {
    try {
      if (containsKey(key)) {
        return Class.forName(get(key));
      } else {
        throw new UndefinedPropertyException("Missing required property '"
            + key + "'");
      }
    } catch (final ClassNotFoundException e) {
      throw new IllegalArgumentException(e);
    }
  }
315397
@Override
    public boolean invokeEvictable(final T instance) throws DempsyException {
        return isEvictionSupported() ? (Boolean) wrap(() -> evictableMethod.invoke(instance)) : false;
    }
863801
private static Class<?> getRawType(final ParameterizedType parameterizedType) {
        final Type rawType = parameterizedType.getRawType();

        // check if raw type is a Class object
        // not currently necessary, but since the return type is Type instead of
        // Class, there's enough reason to believe that future versions of Java
        // may return other Type implementations. And type-safety checking is
        // rarely a bad idea.
        if (!(rawType instanceof Class<?>)) {
            throw new IllegalStateException("Wait... What!? Type of rawType: " + rawType);
        }

        return (Class<?>) rawType;
    }
465750
@Override
  public ClientBundle getFake(Class<?> type) {
    return (ClientBundle) Proxy.newProxyInstance(
        FakeClientBundleProvider.class.getClassLoader(),
        new Class<?>[] {type},
        new InvocationHandler() {
          @Override
          public Object invoke(Object proxy, Method method, Object[] args) throws Exception {
            Class<?> returnType = method.getReturnType();
            if (CssResource.class.isAssignableFrom(returnType)) {
              return GWT.create(returnType);
            } else {
              return createFakeResource(returnType, method.getName());
            }
          }
        });
  }
1103809
public static void propagateTypeError(
      Registry registry, Id id, Class<?> desiredClass, Class<?> actualClass) {
    final String dType = desiredClass.getName();
    final String aType = actualClass.getName();
    final String msg = String.format("cannot access '%s' as a %s, it already exists as a %s",
        id, dType, aType);
    registry.propagate(new IllegalStateException(msg));
  }
1327081
@SuppressWarnings("javadoc")
    public static <T> T getSingleService(Class<T> serviceInterface) throws IllegalStateException {
        // Cached single service values are derived from the values cached when checking
        // for multiple services
        T rval = null;
        Set<T> services = getServices(serviceInterface);
        
        if (services.size() > 1) {
            throw new IllegalStateException("Multiple implementations found of " + serviceInterface); //$NON-NLS-1$
        } else if (!services.isEmpty()) {
            rval = services.iterator().next();
        }
        return rval;
    }
1247284
@SuppressWarnings("unchecked")
	public T get() {
		T result;

		if (uri != null) {
			if (classLoader == null) {
				classLoader = clazz.getClassLoader();
			}

			Endpoint clientEndpoint = new HTTPClientEndpoint(uri);
			if (logger != null) {
				clientEndpoint = new LoggerEndpoint(clientEndpoint, logger);
			}

			result = new FacadeEndpoint<T>(clientEndpoint, //
					classLoader, clazz, typeConverter, //
					additionalInterfaces.toArray(new Class<?>[additionalInterfaces.size()])) //
					.newProxy();
		} else {
			ObjectEndpoint endpoint = new ObjectEndpoint();
			endpoint.faultMapper(faultMapper);
			endpoint.typeConverter(typeConverter);
			endpoint.export(server, clazz);
			for (Class<?> i : additionalInterfaces) {
				endpoint.export(server, i);
			}
			result = (T) new HTTPServerEndpoint(endpoint);
		}

		return result;
	}