kataras / golog

A high-performant Logging Foundation for Go Applications. X3 faster than the rest leveled loggers.
BSD 3-Clause "New" or "Revised" License
329 stars 43 forks source link

[Opinion] Bogus performance comparison #1

Closed osklyar closed 7 years ago

osklyar commented 7 years ago

incredible high-performant, 3+ times faster than logrus

I am not really fond of logrus primarily for the reason that it does not abstract away the API (as I did for example in https://github.com/ventu-io/slf) but your comparison above is bogus. Yours is a plain textual logger supporting only one structural field, level markers, while logrus is a structured logger. That is a major difference. You can forward logrus structures to log data stores such as Elastic without further parsing and structuring and what can you do with your logs apart from outputting to a console or a plain file? Surely it will be more costly to maintain structured information than just a string.

Next, the performance is dramatically affected by the backend you use to output your logs. Are you comparing likes for like? Does your logger support different backends at all?

kataras commented 7 years ago

Yours is a plain textual logger supporting only one structural field, level markers, while logrus is a structured logger

Yes but the benchmarks are not comparing structures vs plain text, they compare one struct vs one struct, if you review the logrus' code has actually one hook, while golog has two, so with your logic the golog should be slower, but it's not, therefore this is not the case here, the comparison is fair.

Does your logger support different backends at all?

You can extend it to support any backend, you may want to look to the pio library and apply your thoughts.

About your title: Bogus performance comparison,

Please do a PR and improve the performance comparison (but as I said on my first answer, this is not the case here, we compare apple and apple, take the code of these two loggers and compare them, you'll understand my point),, the benchmarks code is under _benchmarks folder.

Thanks for your comment @osklyar , please do improvements anywhere you can, I'm new in this field.

osklyar commented 7 years ago

Unless yours is also a structured logger, you are comparing apples with oranges even if you think the performance claim is correct. You do not provide similar functionality on the API level even if internally you share ideas or code, as such there is no point comparing performance.

kataras commented 7 years ago

@osklyar I see that you don't care about my answer, you just want to say your things for unknown reasons, I'm sorry.

Just to know: golog does support structured logging too but in different and most efficient way, you have to see the godocs for that.