Giter Site home page Giter Site logo

Comments (10)

robinedwards avatar robinedwards commented on July 26, 2024

Hello have you tried the neomodel create method?, it's built into the StructuredNode class. It won't be quite as fast as the batch-import program but it does group the rest requests into a single batch operation so it will be faster than looping over the dataset also it handles indexing which batch-import doesnt.

people = Person.create(
    {'name': 'Bob', 'age': 23},
    {'name': 'Tim', 'age': 44}
)

from neomodel.

kristiank avatar kristiank commented on July 26, 2024

Also I would like add, that batches over the REST interface aren't
supposed to be very huge. You might start trying with appr 500 per batch
and see if the performance is good enough.

from neomodel.

technige avatar technige commented on July 26, 2024

From previous experimentation, I've found a batch size of about 300 per
batch gives optimum performance. Although that may be only with my setup
and not a general rule.

On 5 July 2013 10:33, Kristian Kankainen [email protected] wrote:

Also I would like add, that batches over the REST interface aren't
supposed to be very huge. You might start trying with appr 500 per batch
and see if the performance is good enough.


Reply to this email directly or view it on GitHubhttps://github.com//issues/54#issuecomment-20509114
.

from neomodel.

robinedwards avatar robinedwards commented on July 26, 2024

Thanks I've updated the docs :-)

from neomodel.

neoecos avatar neoecos commented on July 26, 2024

Hey !!!

You were absolutely right, now the import is at least 10x-15x faster using a batch size of 280-320 properties.

I have a doubt, when you refer to batch size is the number of properties and relationships, right ? or the number of nodes?

Thank you,

from neomodel.

technige avatar technige commented on July 26, 2024

The number comes from the number of actions taken within a batch. In this
context, it would be the number of entities created, both nodes and
relationships.
On 5 Jul 2013 18:04, "Sebastian Ortiz" [email protected] wrote:

Hey !!!

You were absolutely right, now the import is at least 10x-15x faster using
a batch size of 280-320 properties.

I have a doubt, when you refer to batch size is the number of properties
and relationships, right ? or the number of nodes?

Thank you,


Reply to this email directly or view it on GitHubhttps://github.com//issues/54#issuecomment-20529088
.

from neomodel.

neoecos avatar neoecos commented on July 26, 2024

Thank you, now i have another doubt, the create method is like this

@classmethod
def create(cls, *props)
   ...

And with the example on this issue, @robinedwards i dont know how to call the create method with a list of dicts containing the data, something like

header = map(lambda f: f.strip('\n').strip('"').lower(), line.split('|'))
batchList = []
batchSize = 300
    for line in ins:
        fields = map(lambda f: f.strip('\n').strip('"'),
                     line.replace(',', '.').split('|'))
        record = {}
        map(lambda k, v: record.update({k: v}), header, fields)
        batchList.append(record)
        if len(batchList) == batchSize:
            #: this will fail
            RegistroPredioCatastroTipo2.create(batchList)
            batchList = []
RegistroPredioCatastroTipo2.create(batchList)

from neomodel.

robinedwards avatar robinedwards commented on July 26, 2024

When you call create it's expecting a list of dicts as opposed to a reference to a list.

Try this:

RegistroPredioCatastroTipo2.create(*batchList)

from neomodel.

neoecos avatar neoecos commented on July 26, 2024

Thank you @robinedwards , today i will try to do the batch import test with the recomendations on this issue.

from neomodel.

neoecos avatar neoecos commented on July 26, 2024

Awesome !!!

Thank you for your help, using this method the performance on insert is acceptable for our requeriments, i am inserting about 2000 nodes with 30 properties per second.

Thank you again!

from neomodel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.