-
Notifications
You must be signed in to change notification settings - Fork 73
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
Support single key:value pair for ISpan.Log
#85
Comments
Would the existing #91 would also make it (slightly) easier to implement custom, more efficient, log types. I'll backlog this to wait for more people who want this. |
Unfortunately no because |
Unfortunately I doubt people will realize this with any haste. Performance is something that people find far later in the game, if at all :( But if performance is not a high priority item for opentracing-csharp I can keep such things I notice to myself :) |
That's an unnecessary/destructive comment. Backlog just means that it's not scheduled for any release. That's not my project alone so feedback from other people is essential. E.g. it would be interesting to hear how often people pass one vs. many elements to the method etc. Could you please also add the actual signature change/addition you're proposing. |
I'm sorry, I did not mean it as destructive as it sounds - I meant it more genuinely. I do not mean to imply the project has intentions of being slow - but rather than it would be perfectly reasonable at this stage of it's lifecycle to not be preoccupied with performance yet - and if that's the case then I can hold my tongue until major players are using it and pushing for changes - taking on a reactive rather than proactive approach which would be just as valid at this point. My fear of 'backlog' here would be that in my experience when an item that is made solely for performance isn't causing a system to grind to a halt (and is more of a single in many cuts), that item often doesn't get taken up later. That said, of course community feedback would be great I just meant to say I would caution on performance items from taking no input as a negative signal. The API change that would enable tracers to optimize as they deem necessary would be either
Compiled, they're essentially the same, so it really makes no difference to me which flavor so long as we can avoid allocating a dictionary just to send 2 strings. |
A more optimal way could be to accept an IEnumerable<KeyValuePair<string,object>> instead of a dictionary, I can't find anywhere in the spec that I specifies the keys should be unique, so a Dictionary is a limitation not expressed by the spec |
@ThomasSkyldahl PR #91 would bring that. However, it obviously still isn't as performant/easy to use as a separate @opentracing/opentracing-c-maintainers (and anyone else): My request for more feedback here is mostly whether this is an "important enough" use case or whether people will need more than one key:value pair in most cases anyway and therefore would make this a negligible performance improvement. Sure, it would be "just two more methods" but the question is where do we draw the line. This should be a conscious, well-discussed decision. |
@cwe1ss My opinion is that this would be more of an "Enhancement" - also, I'd discuss that in the Java scenario as well. |
@cwe1ss ahh great didn't see that one. I would argue that if the API has This is kind of back to the whole performance thing in the orginal issue description. if people really want the |
The problem is that we don't have ~Log(string @event);
+Log(string key, object value);
~Log(IEnumerable<KeyValuePair<string, object>> fields); |
@cwe1ss i see your point and there are even more if you include the A few notes: Its kind of strange that the actual value in the simple the other thing is the hidden meaning of what the You have to actually read the docs to know that it logs I would argue that another point about all the
see: https://docs.microsoft.com/en-us/dotnet/standard/design-guidelines/member-overloading I know the java API is structured like the current implementation, but java API's aren't always perfect :) |
@opentracing/opentracing-c-maintainers thoughts? @ThomasSkyldahl could you open a separate issue regarding the order of parameters? |
Per the specification
Problem: A dictionary is far from free in C#, creating one just for a single key:value pair (and then the cost in using it in the tracing library implementation) can be avoided by adding an overload on the interface.
The text was updated successfully, but these errors were encountered: