influxdata / go-syslog

Blazing fast syslog parser
MIT License
476 stars 69 forks source link

another library's benchmark #10

Closed jtarchie closed 6 years ago

jtarchie commented 6 years ago

I tried out your benchmarks with my library.

Some notes:

leodido commented 6 years ago

Hi @jtarchie congrats for your library. :)

Would be interesting to look at the results of this library on your machine. Also would be very interesting to adapt the test cases of this package and run them on your library.

Notice that priority values have to be within [1,191] or be 0 (ie., 002 is not a valid priority value) to be valid, since from them are computed the facility and the severity values as the RFC mandates.

Clearly there are a bunch of features of this library, namely:

that all slightly slow down a bit this library.

These were chosen due to the trade-off between speed, correctness (RFC5424-compliance) and library features.

jtarchie commented 6 years ago

I'll take a crack at the test cases here, too.

I don't know how I feel about the best effort though. I feel that can be anti-functionality. What do you you use it for?

leodido commented 6 years ago

Ideas you give me (and I thank you!) are:

leodido commented 6 years ago

The best effort thing is useful when you want to extract (and store) a syslog message also if it was not completely compliant to the rules.

Since from a lot of years a lot of software do syslog messages in a "free" way it is very common that some syslog messages are only partially compliant to that RFC5424.

With the best effort mode we can save it if it is minimally valid - ie., until the point that breaks the rules it is correct and contains almost a valid priority value and a valid version (which are the only two fields that cannot have nil values by RFC).

jtarchie commented 6 years ago

I do have a best effort then as I allow any prival range. 😄

leodido commented 6 years ago

Best effort does not allow any priority values, only valid ones :stuck_out_tongue_closed_eyes:

leodido commented 6 years ago

I have tested ideas from your impl., namely these.

Closing for now.