[ 
https://issues.apache.org/jira/browse/TINKERPOP-1174?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15931174#comment-15931174
 ] 

stephen mallette commented on TINKERPOP-1174:
---------------------------------------------

Another technical reason to implement this is that we will see improved cache 
hits in Gremlin Server. For example, if you do:

{code}
g.addV("person").property("name",name,"age",age,"optional",opt)
g.addV("person").property("name",name,"age",age)
{code}

you'l get two different compilations, but if you do:

{code}
g.addV("person").property(props)
{code}

you get one compilation and have the ability to vary the properties. 

This approach also has the possible benefit of making {{Bytecode}} 
significantly smaller and traversal building far less expensive if the {{Map}} 
of arguments was special cased to avoid use of {{Parameters}} and {{Bytecode}} 
skipped adding "property" steps to its instruction list.  

> addVertex(Map properties) method
> --------------------------------
>
>                 Key: TINKERPOP-1174
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-1174
>             Project: TinkerPop
>          Issue Type: Improvement
>          Components: structure
>    Affects Versions: 3.1.1-incubating
>            Reporter: Matthias Broecheler
>            Assignee: stephen mallette
>
> which overloads the other {{addVertex(Object... properties)}} method with a 
> map based version (of key-value pairs).
> Having this alternative to addVertex is nice because:
> 1) It allows you to submit a map when adding vertices on remote graphs via 
> drivers. Right now, you have to convert the properties to an array which is 
> awkward and unnecessary
> 2) It would work well with groovy's map based syntax so one can write:
> {{g.addVertex( key1 : "value1", key2: "value2")}}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to