Skip to content

Symbol table can't look up from ByteList directly #300

@headius

Description

@headius

Currently, when looking up a Symbol using a ByteList (or a RubyString) we still convert to a Java String and then look up with that as the key. This causes creation of at minimum a wasted Java String plus buffers used by JVM internally for transcoding our bytes into String.

We need to improve the Symbol table to support direct lookup with ByteList.

More justification: Rails and other libraries frequently use the form :"foo#{bar}" to generate symbols on the fly at runtime. With no caching or improvements, this creates two Ruby Strings, two ByteLists, a Java String and transcoding support classes even when the symbol exists, depending on what "bar" is (if it is not a String, there's a third String and ByteList created for it). I we can get this down to one ByteList total for all cases where bar is a String, Symbol, or Fixnum, which would cover the vast majority of cases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions