Uh oh!
There was an error while loading. Please reload this page.
Fix benchmark issues - #7311
Conversation
mscdex
commented
Jun 15, 2016
/cc @AndreasMadsen |
Can you explain the motivation behind not using |
mscdex
commented
Jun 15, 2016
IIRC Originally I did not realize that numeric strings were being automatically converted because most benchmarks were already doing conversions and it tripped me up when I was trying to benchmark the http changes from the same PR. Specifically one of the functions being benchmarked checks the type and returns early if it's not a string. So when I started running that benchmark, I was getting unexpected results. IMHO keeping all of the values as strings makes things more consistent and the changes here are small compared to the total number of benchmarks. |
Perhaps we should just I think the current implementation (never parsing) is confusing because we allow numbers as input, but converts them to strings. To ensure consistency we would have to only allow strings, which would be rather inconvenient. |
f230ea5 to
ddf9bf7Comparemscdex
commented
Jun 18, 2016
@AndreasMadsen I've added the missing stringify in the code you referenced. I think allowing numbers in the default values is fine as it shows the intention better. |
AndreasMadsen
commented
Jun 18, 2016
I agree. But setting number in What I'm sugesting is that we use |
@AndreasMadsen If that were implemented it'd mean you'd have to start using escaped double quotes to force a number to be treated as a string which could be equally "confusing", for example: |
mscdex
commented
Jun 21, 2016
/cc @nodejs/collaborators |
AndreasMadsen
commented
Jun 21, 2016
@mscdex I can understand that it is inconvenient, but you will have to explain how it is "equally confusing". Another solution could be to transfer the configuration parameters with |
trevnorris
commented
Jun 21, 2016
IMO using |
AndreasMadsen
commented
Jun 21, 2016
@trevnorris We can replace |
trevnorris
commented
Jun 27, 2016
@AndreasMadsen wouldn't each parameter know whether it should be a string or a number? |
AndreasMadsen
commented
Jun 28, 2016
@trevnorris A parameter could have both string and number values, but apparently there doesn't currently exists such a case. |
trevnorris
commented
Jun 28, 2016
@AndreasMadsen Since it doesn't exist yet can we implement a rule that it can't. :) I can't think of a good reason for doing that, when it wouldn't make more sense to simply have two difference parameters. |
AndreasMadsen
commented
Jun 28, 2016
@trevnorris Sounds like a good idea.
A case where different types of values is used is in the assert benchmark, but is uses strings to identify the actual value. |
mscdex
commented
Jul 12, 2016
/cc @nodejs/collaborators Any more input on this? We already have two other open PRs that fix benchmarks fixed by this PR. |
Trott
commented
Jul 12, 2016
Not sure about the |
mscdex
commented
Jul 12, 2016
@Trott The |
Trott
commented
Jul 12, 2016
@mscdex Oh, I see. LGTM then. |
mcollina
commented
Jul 12, 2016
LGTM |
@mscdex I'm pretty sure the Right now if a I could be wrong (I can't check right now), but edit: based on our initial discussion that commit should just be removed. |
Trott
commented
Jul 12, 2016
@mscdex Maybe land the other two commits more-or-less right now, and put the |
Numeric arguments are no longer automatically converted to numbers, so we need to explicitly convert them wherever necessary.
Previously bench.end would call process.exit(0) however this is rather confusing and indeed a few benchmarks had code that assumed otherwise. This adds process.exit(0) to the benchmarks that needs it.
ddf9bf7 to
daae7d7Comparemscdex
commented
Jul 12, 2016
@AndreasMadsen@Trott I've removed that commit. |
Trott
commented
Jul 12, 2016
LGTM |
Considering the amount of issues related to this, I don't think we have the time to discuss this anymore. But I still think this is a bad fix that is only going to add confusion. I would much rather see that @trevnorris suggestion was implemented. |
Trott
commented
Jul 12, 2016
@AndreasMadsen What are you referring to as "a bad fix"? The use of I'm mostly interested in seeing the |
mscdex
commented
Jul 12, 2016
IMHO having less magic here is better. To me, it makes it easier to think about. |
AndreasMadsen
commented
Jul 12, 2016
It is "Or the use of + to coerce?". Right now number inputs to The suggested fix is to infer the type from the options argument and add a rule such mixed types aren't allowed. |
Checklist
make -j4 test(UNIX) orvcbuild test nosign(Windows) passesAffected core subsystem(s)
Description of change
These commits fix some issues that exist since c570182 and 83432bf.