Coder Social home page Coder Social logo

Production use? about go-linq HOT 16 CLOSED

ahmetb avatar ahmetb commented on May 24, 2024
Production use?

from go-linq.

Comments (16)

cleitonmarx avatar cleitonmarx commented on May 24, 2024 1

What type of application is it?

The application is an event ticketing API

How performance critical is it?

Sometimes we have peaks in numbers of requests, so performance is critical. To improve performance in this scenarios, we are reducing the database calls and removing the aggregation processing from the database and using go-linq to help us with the aggregations processing and with complex/nested objects composition in the API server side, what is easier to scale.

If you are using go-linq since May, you must have used v1. So, can you give any details on migrating to v2?

Unfortunately, I didn't have the chance to migrate to the v2, but I'm considering to make it soon.

from go-linq.

kalaninja avatar kalaninja commented on May 24, 2024 1

@bsideup it preserves the order when the goroutines are starting, but then result are put into the channel as soon as the job is done. So you may introduce a new parameter, then put it inside the result and use smth like

FromChannel(results).OrderByT(
        func(result ResultType) int { return result.Priority },
    )

thanks @cleitonmarx for new "-T" methods syntax.

from go-linq.

cleitonmarx avatar cleitonmarx commented on May 24, 2024

Hey @frankandrobot, I have been using it in production since May. Works fine! 😃

from go-linq.

kalaninja avatar kalaninja commented on May 24, 2024

@cleitonmarx Thanks for the reply. Can you give any more details on the use case? What type of application is it? How performance critical is it?

If you are using go-linq since May, you must have used v1. So, can you give any details on migrating to v2?

from go-linq.

bsideup avatar bsideup commented on May 24, 2024

We use go-linq in http://github.com/zeroturnaround/configo to improve the readability and make it a bit more functional

from go-linq.

ahmetb avatar ahmetb commented on May 24, 2024

@bsideup thanks for the answer. I guess this issue is not something we can “resolve” per se. We have nice changes (like generic functions) coming up with v3, make sure to check the new stuff out!

from go-linq.

bsideup avatar bsideup commented on May 24, 2024

@ahmetalpbalkan generic functions? I think you mean interface {}s everywhere, right?

from go-linq.

cleitonmarx avatar cleitonmarx commented on May 24, 2024

@bsideup You can check it out the new generic functions preview here:
https://github.com/ahmetalpbalkan/go-linq/tree/v3-dev#generic-functions

from go-linq.

bsideup avatar bsideup commented on May 24, 2024

@cleitonmarx oh, so you decided to implement #26 ? Cool! Will check it soon.

from go-linq.

ahmetb avatar ahmetb commented on May 24, 2024

Yeah and I was thinking this idea sounds familiar lol. We observe 5-15x performance penalty (see benchmark_test.go) but it yields cleaner code of course.

from go-linq.

bsideup avatar bsideup commented on May 24, 2024

@ahmetalpbalkan Errr... looks like AsParallel().AsOrdered().Select(...).AsSequential() is gone, and with channels API it's totally unclear how to do the same :(

from go-linq.

kalaninja avatar kalaninja commented on May 24, 2024

@bsideup Can you give an example of what you are trying to do?

from go-linq.

bsideup avatar bsideup commented on May 24, 2024

@kalaninja sure, luckily it's open sourced:
https://github.com/zeroturnaround/configo/blob/master/sources/composite.go#L27-L38

from go-linq.

kalaninja avatar kalaninja commented on May 24, 2024

@bsideup The "Concurrent" example on our website does mostly the same thing.

The idea is to start a new goroutine per each item manually, output each result to the channel and close the channel when all the goroutines are done. FromChannel() method waits until the channel is closed to continue iterating the query.

I know that the current syntax is messy, it is more like a workaround. But it gives you more control on what you want to do, and making "plinq" api for the current version is also on our todo list.

from go-linq.

bsideup avatar bsideup commented on May 24, 2024

Does it preserve the order?

from go-linq.

ahmetb avatar ahmetb commented on May 24, 2024

Closing as it is now answered.

from go-linq.

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.