My idea is to do a project in Go and Ruby, to make a simple parse the same url to an rss feed, and check how long it takes each run of languages.
Let’s first talk about the project in Ruby.
We will have a class called
Parse::Rss, with some methods, as:
The main file, start the url variable with a value already set and start the Parse :: Rss class. initializing the class will already run parse the url and return the object that the gem returns.
Now is print the returns.
bundle install to install the gems of
main.rb file return of the
Parse::Rss class and execution of time:
1 2 3 4 5 6 7 8
Project on github: parserssrb
Now let’s talk about the project in Go.
As we have an external package, you will need to install using:
Now create the file
parse/rss.go, in package
main.go in root path, this file we used time to calculate time run the project.
1 2 3 4 5 6 7 8 9
Project on github: grfeed
In a quick comparison with the “same” functionality,
Go was faster than
Thanks! Until next time!