code: def _faster_to_representation(self, instance):
          
  
          ret = {}
          fields = self._readable_fields
  
          is_fast = isinstance(instance, prefetch.FastObject)
          id_fields = self._readable_id_fields
  
          for field in fields:
              attribute = None
  
              # we exclude dynamic fields here because the proper fastquery
              # dereferencing happens in the `get_attribute` method now
              if (
                  is_fast and
                  not isinstance(
                      field,
                      (DynamicGenericRelationField, DynamicRelationField)
                  )
              ):
                  if field in id_fields and field.source not in instance:
                      # TODO - make better.
                      attribute = instance.get(field.source + '_id')
                      ret[field.field_name] = attribute
                      continue
                  else:
                      try:
                          attribute = instance[field.source]
                      except KeyError:
                          # slower, but does more stuff
                          # Also, some temp debugging
                          if hasattr(instance, field.source):
                              attribute = getattr(instance, field.source)
                          else:
                              # Fall back on DRF behavior
                              attribute = field.get_attribute(instance)
                              print(
                                  'Missing %s from %s' % (
                                      field.field_name,
                                      self.__class__.__name__
                                  )
                              )
              else:
                  try:
                      attribute = field.get_attribute(instance)
                  except SkipField:
                      continue
  
              if attribute is None:
                  # We skip `to_representation` for `None` values so that
                  # fields do not have to explicitly deal with that case.
                  ret[field.field_name] = None
              else:
                  ret[field.field_name] = field.to_representation(attribute)
  
          return ret
docs: Modified to_representation with optimizations.
  
          1) Returns a plain old dict as opposed to OrderedDict.
              (Constructing ordered dict is ~100x slower than `{}`.)
          2) Ensure we use a cached list of fields
              (this optimization exists in DRF 3.2 but not 3.1)
  
          Arguments:
              instance: a model instance or data object
          Returns:
              Dict of primitive datatypes.