def fast_generate(obj, opts = nil)
    if State === opts
      state, opts = opts, nil
    else
      state = FAST_STATE_PROTOTYPE.dup
    end
    if opts
      if opts.respond_to? :to_hash
        opts = opts.to_hash
      elsif opts.respond_to? :to_h
        opts = opts.to_h
      else
        raise TypeError, "can't convert #{opts.class} into Hash"
      end
      state.configure(opts)
    end
    state.generate(obj)
  end
:startdoc:
Generate a JSON document from the Ruby data structure _obj_ and return it.
This method disables the checks for circles in Ruby objects.

*WARNING*: Be careful not to pass any Ruby data structures with circles as
_obj_ argument because this will cause JSON to go into an infinite loop.