Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance unmarshalling components #42

Open
richmarr opened this issue Sep 24, 2012 · 1 comment
Open

Performance unmarshalling components #42

richmarr opened this issue Sep 24, 2012 · 1 comment

Comments

@richmarr
Copy link

Working on an app for a client that uses this plugin, I've come across a bit of a performance hit. Search results themselves come back from Elasticsearch very quickly, but it takes another ~10 seconds to finish unmarshalling the 33 hits in the response and pass the results back to my app code.

Each domain class being searched contains maybe a dozen component domain classes.

Adding a bit of logging seems to indicate that a lot of time (~4ms per property) is being spent on the call to BindDynamicMethod.invoke() in the DomainClassUnmarshaller.unmarshallDomain() method.

I can add a workaround or two so that the performance hit is less noticeable, but it seems like there should be scope to make this a bit more performant. Happy to help if you can give me some guidance as to how you'd prefer to go about it.

@thch0014
Copy link

I prefer to not use unmarshalling, because it is too slow. I had implemented my own little function:

private org.elasticsearch.action.search.SearchResponse doSearchGetRawResponse(SearchRequest request, Map params) {

    elasticSearchHelper.withElasticSearch { Client client ->
        def response = client.search(request).actionGet()

        return response
    }
}

You can parse the result at your own. You are getting a "source" for every search hit. For me, the performace is good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants