This is more of a request but could I get a patch release when the logfmt is merged? Else I'm going to have to pull from the git repo when doing `npm i -g Haraka`. If no, what needs to be done? I can try and help.
tasansga has quit
knutix has quit
_smf_
anosh: Well I'm not doing a patch release today - I don't have time. npm can install packages directly from Git anyway.
anosh
Yeah
I'm fine with that
:)
_smf_
And I'm not happy with the PR as it is.
I'm now about to benchmark those logging changes as I didn't appreciate exactly what you had done.
If they turn out to be slower (and I highly suspect they will), then I'm going to be requesting further changes.
anosh
Alright, no probs
knutix joined the channel
anosh has quit
anosh joined the channel
tasansga joined the channel
_smf_
anosh: I'd seriously be considering if logfmt is actually worth the penalty if I were you.
anosh
I'm running benchmarks now betweek old logger, new default, new logfmt
_smf_
I've already done it.
See the pull request
anosh
just saw
_smf_
On a really basic test - it over 160% slower.
Which TBH is hardly surprising given all the dependencies it has.
If you benchark it inside Haraka then I suspect the results will be worse.
I didn't do that as it's time consuming and ultimately it won't make any difference to my views on it.
I understand that template literals are faster, the issue would be somehow knowing there are key=value already to build the end result in logfmt instead
aaaah let me see what I can do
_smf_
anosh: how did you do that test? What loglevel etc.
anosh
protocol
I ran `time smtp-source -m 8000 127.0.0.1:2500`
with ok-ing both rcpt and queue
_smf_
Ok - so we tested different things.
anosh
yeah
_smf_
My answer is still the same.
There is no way I want logfmt in Haraka by default.
anosh
Alright
_smf_
I can gist you the code I used if you want to try it for yourself.
once again i wanna to ask about tls config - i got error (No Valid TLS config) - i see that lines added in tls.js 6 days ago. I create bundle with key/cert/cat in configt/tls/domain_name.pem. Still got 'no valid tls config'. Where now should be places all tls confs?
_smf_
gruceqq: you said you were using 2.8.14 yesterday. So what you actually meant is that you installed Haraka from git then?
that's the improved one compared to the stupid node module
Could you run it to see whether it's good for you whenever you get the time?
_smf_
anosh: I can't believe that is going to be anywhere near the performance given that it uses regexps.
I'll give it a try though.
As I expected:
smf@i7desktop:~$ time node haraka_logger5.js 2>&1 > /dev/null
real0m7.255s
user0m7.080s
sys0m0.244s
67.17% slower
For 1 million iterations
anosh
yeah
It was using indexOf before
switching to regex made it faster for me
fuck
baudehlo
This probably varies on node versions fwiw.
anosh
I'm on 6
idk how _smf_ is getting a large gap too which is frustrating
_smf_
I'm on 7.10.1 on this machine.
baudehlo
Node 8 includes an entirely different JS engine.
_smf_
baudehlo: I know, but whilst the performance might alter a bit. Running regexp over every single key is always going to be slower than string concatenation isn't it.
baudehlo
Not necessarily.
_smf_
Ok - but do you want to modify logger and make it slower than it already is for a feature that so far one person is submitting a PR for?
anosh
regexp was running faster than 4 indexOf's
baudehlo
Can I see the comparison code?
_smf_
The original pull was >160% slower than our stock code for 1 million operations.
Note that there's a bug in anosh's code there. It's doing an if (!foo) .vs. if (foo !== undefined), so it fails on numeric 0.
anosh
It was originally a `foo !== undefined || foo !== null`
At this point I'm trying to just make it faster
_smf_
anosh: if you run it as it is though, errors= is reported incorrectly.
So it's got to be fast and correct.
baudehlo
For a fair test, shouldn't `var logdetail` be constructed in the for loop?
anosh
yeah
baudehlo
is $& expensive in node like it is in Perl?
Like maybe use () and $1 instead.
_smf_
baudehlo: if I move the logdetail into the loops, it's 54.6% slower .vs. 67.17% when outside of the loop.
I constructed it outside of the loop to compare the functions that were building the log line, but I can see that creating an Array .vs. Object would probably have an effect too.
anosh
I 'll try that baudehlo
_smf_
baudehlo: I mean arguably a 50% time increase probably isn't going to be particularly noticable overall given this is rather artificial.
baudehlo
The `if` is correct actually because it does a toString() and "0" is true in node.
godsflaw joined the channel
OK, this version of stringify is optimized now (V8 didn't like a few things about the other version):