Why I Switched from Python to Go Lang for AI Deployment

preview_player
Показать описание
In this video, I share my journey of deploying the same AI project with both Go and Python, highlighting the challenges, successes, and performance differences.

🤔 Takeaways:
* Go excels in response times, scalability, and resource management.
* Some data science libraries might be less efficient in Go compared to Python.
* Consider switching to Go for performance gains when Python hits traffic limits.

🚨 Important Note:
While Go may not cover all data science libraries, its strengths shine in specific scenarios. Explore the performance gains and make a strategic decision based on your project's requirements.
Рекомендации по теме
Комментарии
Автор

“I wanted to dump my spaghetti code aside” lmao so relatable

ankitsanghi
Автор

Most of the developers do not know how to use python efficiently

md.jannatultasnim
Автор

Damn that's one great video, thanks a ton.

newmoodclown
Автор

This was a fantastic video. Thanks for posting

andrewzielinski
Автор

Another reason for golang is that it's really picky for code design. For example if you have an if else loop, you need to put the else behind the closing curly barsckt from the if stement or it's like you have an else statement without an if statement.

You can't have an empty line at the bottom of a list, can't have variables which are not used etc.

Another nice thing is that golang's error handler is way better and give more details about the error before you can even run it.

electricz
Автор

Nice Comparison - thanks 🙂
did you consider julia (programming language) for prototyping? It could be fast enough for inference and can access the ML Libraries...

fabianwachmann
Автор

this was a very practical and a real use case you made some really good points about when to use Python and when to use Golang thank you man

salehmir
Автор

Great speed increase.Did the ai inference use gpu? Would be interested to hear about the multi armed bandit recommendation engine.

thegrumpydeveloper
Автор

Cool video, did you tried Mojo language? I'm just currios if it is faster than python.

DifferencialX
Автор

Very cool video, nice job and thank you for sharing.

Incertophile
Автор

It's maybe a good idea to start from instrumenting APMs or running benchmarks to identify the performance bottlenecks, as Rob Pike famously said in his 5 Rules of Programming.
In general, Go excels when your application is mainly IO bound.
In the context of machine learning, Python is actually a wrapper language to call scientific calculation libraries written by C and Fortran.
These libraries are developed and tuned-up for decades and Go (lol) has literally zero chance to match up with them.

ANONAAAAAAAAA
Автор

Currently learning python thinking about learning go next!

TheHolyRolle
Автор

Cool video, and I'm also a big fan of go. Did you consider rewriting the problem code as a C extension for Python, or was that not viable for some reason?

dalton
Автор

NIce Explanation . Thanks for the vide

SomebodyYouUsedToSee
Автор

Most likely the bottelneck would be in the python code itself not in pandas or numpy (which are supposed to be well optimized).

fallout__boy
Автор

Maybe you should also give Julia a try. It's written as a dynamic, high level language like python, but can run with the speed of a a low-level language due to JIT compilation during runtime. It was specifically build for scientific computing and data sciene and has a really fun programming pattern based on multiple dispatch, which you should definitly check out. You have access to all data science tools, including tensor/deep learning libraries and trivial GPU computing.
The core idea of julia was to bridge this gap, between fast and easy to code languages like python and low-level languages, so that you don't need to rewrite your finished project again for deployment. Have fun :)

hendrikmehrtens
Автор

This was very informational. Thank you for sharing your observations and conclusions. Is there a public github repo that we can check?

RootsterAnon
Автор

I had a similar experience, when I tried to switch python to nim. I've found out nim does not have the same amount of libraries as python and not everything is available in nim.

seasong
Автор

I have a question, like how did you make predictions in real time without being the lib's available for go ?
as there are for python such as scikit etc ?

pranaydas
Автор

So what the actual _AI_ code has been written on the Go (or Python) in your project? Rearrange a list, sum it and handle endpoint looks liike no-AI part.

AlexanderBorshak