Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PostPointsAsync method is so slow in linux os #90

Closed
jinkyu93 opened this issue Feb 25, 2020 · 4 comments · Fixed by #93
Closed

PostPointsAsync method is so slow in linux os #90

jinkyu93 opened this issue Feb 25, 2020 · 4 comments · Fixed by #93

Comments

@jinkyu93
Copy link

hi
I've used this library on my dot net core solution.
when I test in window os, this library was not slow.
but in linux os, PostPointsAsync was so slow.
I checked why. and I find InfluxValueField.ToString is so slow.
if InfluxValueField is double or float, you use String.Format method.
but when I tested in linux os, this code so slow. so I changed this code just toString.
after changing, PostPointsAsync was not slow in linux os.

I have some question. why use String.Format method?

my development environment is
window : window 10
linux : centos 7

check this logic please.

InfluxValueField

@mvadu
Copy link
Contributor

mvadu commented Feb 27, 2020

Please see #3. InfluxDB assumes decimal separator to be a ., but in other locale settings system default could be , which makes the Influx line protocol to break. If the String.Format is slow on linux then we should probably raise in .netcore. If its just in InfluxValueField.ToString I can take a look to optimize it.

@yyjdelete
Copy link

yyjdelete commented Feb 28, 2020

May should use CultureInfo.InvariantCulture instead?

@jinkyu93
Copy link
Author

How about
"CultureInfo.GetCultureInfo("en-us")"
instead of
"new CultureInfo("en-us")"

when I change this code, I got a fast speed in linux os
you made to create every time CultureInfo object on call ToString in InfluxValueField. that is seem to be inefficient.

@mvadu
Copy link
Contributor

mvadu commented Mar 28, 2020

@jinkyu93 that is a brilliant suggestion.. Now wondering why I did not think about it.. I will try to push an update this weekend..

@mvadu mvadu closed this as completed in #93 Apr 5, 2020
mvadu added a commit that referenced this issue Apr 5, 2020
.netcore and framework version upgrade.
mvadu added a commit that referenced this issue Apr 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants