Page MenuHomePhabricator

sbenza (Samuel Benzaquen)
User

Projects

User does not belong to any projects.

User Details

User Since
Apr 23 2013, 11:59 AM (312 w, 3 d)

Recent Activity

Thu, Apr 18

sbenza accepted D59371: [LibTooling] Add Stencil library for format-string style codegen..
Thu, Apr 18, 7:38 AM · Restricted Project

Wed, Apr 17

sbenza added inline comments to D59371: [LibTooling] Add Stencil library for format-string style codegen..
Wed, Apr 17, 9:10 AM · Restricted Project

Wed, Apr 10

sbenza added inline comments to D59371: [LibTooling] Add Stencil library for format-string style codegen..
Wed, Apr 10, 9:14 AM · Restricted Project

Wed, Apr 3

sbenza committed rG27a83e99f486: Add more benchmarks for literal strings. (authored by sbenza).
Add more benchmarks for literal strings.
Wed, Apr 3, 10:40 AM
sbenza committed rCXX357614: Add more benchmarks for literal strings..
Add more benchmarks for literal strings.
Wed, Apr 3, 10:39 AM
sbenza committed rL357614: Add more benchmarks for literal strings..
Add more benchmarks for literal strings.
Wed, Apr 3, 10:39 AM
sbenza closed D59781: Add more benchmarks for literal strings..
Wed, Apr 3, 10:39 AM · Restricted Project

Fri, Mar 29

sbenza added a comment to D59999: Make it easier for the compiler to optimize `operator==(string,char*)`..

Thanks for debugging that. I didn't realize it didn't try to inline on purpose.
Maybe we just need to mark the function as inline, even if we also have the extern template instantiation.
That way the compiler can inline it if it helps, but won't actually generate the weak symbol in the object files otherwise.
Eg, something like:

Fri, Mar 29, 2:21 PM · Restricted Project
sbenza added a comment to D59999: Make it easier for the compiler to optimize `operator==(string,char*)`..

Maybe the generated code would be better if basic_string::compare was being inlined, but the compiler chose not to do it. char_traits::compare, on the other hand is much smaller and easier to inline.

Fri, Mar 29, 1:53 PM · Restricted Project
sbenza created D59999: Make it easier for the compiler to optimize `operator==(string,char*)`..
Fri, Mar 29, 8:46 AM · Restricted Project
sbenza updated the diff for D59781: Add more benchmarks for literal strings..

Remove string file changes from this PR.
They were added by mistake.

Fri, Mar 29, 8:22 AM · Restricted Project
sbenza updated the diff for D59781: Add more benchmarks for literal strings..
  • Make it easier for the compiler to optimize operator==(string,char*).
Fri, Mar 29, 8:21 AM · Restricted Project

Mon, Mar 25

sbenza updated the diff for D59781: Add more benchmarks for literal strings..

Fix benchmark for rhs being empty.

Mon, Mar 25, 10:33 AM · Restricted Project
sbenza created D59781: Add more benchmarks for literal strings..
Mon, Mar 25, 10:33 AM · Restricted Project

Thu, Mar 21

sbenza committed rG9b7aa02b539f: Add relational benchmark against a string constant. (authored by sbenza).
Add relational benchmark against a string constant.
Thu, Mar 21, 9:06 AM
sbenza committed rCXX356680: Add relational benchmark against a string constant..
Add relational benchmark against a string constant.
Thu, Mar 21, 9:05 AM
sbenza committed rL356680: Add relational benchmark against a string constant..
Add relational benchmark against a string constant.
Thu, Mar 21, 9:05 AM
sbenza closed D59512: Add relational benchmark against a string constant..
Thu, Mar 21, 9:05 AM · Restricted Project
sbenza added inline comments to D59512: Add relational benchmark against a string constant..
Thu, Mar 21, 8:13 AM · Restricted Project

Mar 18 2019

sbenza created D59512: Add relational benchmark against a string constant..
Mar 18 2019, 2:03 PM · Restricted Project

Jan 29 2019

sbenza added a comment to D18914: [clang-tidy] new readability-redundant-inline.

...
I personally think that 1) should be used, because late one could move the function definition to a source file (removing the inline) without having to touch
the class declaration. I can extend this patch to transform 2) and 3) into 1).

Alternatively, I could add an option to choose between 1), 2) or 3).
What do you think?

Jan 29 2019, 10:20 AM

Dec 10 2018

sbenza added a comment to D53994: Fixing lower bound regression in certain situations..

re resize+iota, I don't see why not. That code is not part of the measurements.

As for why 0...n, for integers it doesn't really what the values are. only that there are N distinct values. The initial ordering of those values is changed depending on the benchmark.
Note that for strings we don't use consecutive values as the value itself matters for operator<. That is, the first mismatched char is the one that matters and "sequential" strings would not be good for that.

For lower_bound you might want a different sequence, though. You might also want to check for values missing in the list. The way we do it for std::set is to have 0,2,...,N. We then search for 2*i for hits and 2*i+1 for misses.

I see your point about n values but I'm not entirely sold.
There is a famous bug in quick sort implementation, for example, - not partitioning the duplicates.
BTW just ran a small benchmark, check out how much duplicates affect the performance of std::sort http://quick-bench.com/mq8UiBPBT5vmmS7FG-RmY11VriQ

Dec 10 2018, 8:41 AM

Dec 7 2018

sbenza added inline comments to D55045: Add a version of std::function that includes a few optimizations..
Dec 7 2018, 10:11 AM

Dec 4 2018

sbenza added a comment to D53994: Fixing lower bound regression in certain situations..

It seems like the input/benchmark generation in algorithms.bench is not a good fit for binary search.

Also, please take a look: https://github.com/llvm-mirror/libcxx/blob/master/benchmarks/algorithms.bench.cpp#L45
I'm not sure if it matters, but seems like a weird idea to measure on 0...n - not very representative data.
I would also suggest rewriting it like:

V.resize(N);
std::iota(V.begin(), V.end());

The last time I measured - much faster (and less code).

@sbenza wrote those benchmarks, there might be a reason why he used 0...n.

Dec 4 2018, 2:35 PM
sbenza added inline comments to D55045: Add a version of std::function that includes a few optimizations..
Dec 4 2018, 12:22 PM
sbenza added inline comments to D55045: Add a version of std::function that includes a few optimizations..
Dec 4 2018, 7:59 AM

Dec 3 2018

sbenza added inline comments to D55045: Add a version of std::function that includes a few optimizations..
Dec 3 2018, 12:32 PM

Nov 20 2018

sbenza committed rCXX347329: Add benchmarks for sorting and heap functions..
Add benchmarks for sorting and heap functions.
Nov 20 2018, 9:19 AM
sbenza committed rL347329: Add benchmarks for sorting and heap functions..
Add benchmarks for sorting and heap functions.
Nov 20 2018, 9:18 AM
sbenza closed D53978: Add benchmarks for sorting and heap functions..
Nov 20 2018, 9:18 AM

Nov 19 2018

sbenza updated the diff for D53978: Add benchmarks for sorting and heap functions..

Changed the sizes to be denser in the lower end.

Nov 19 2018, 12:10 PM

Nov 13 2018

sbenza added a comment to D54404: Exclude matchers which can have multiple results.

I acknowledge and share the future-proofing concern.

We could possibly use something trait-based instead and put the trait beside the matcher definition in ASTMatchers.h, but that doesn't really solve the problem. It only moves the problem.

If we could somehow incorporate it into the matcher definition itself, though, it means we don't have two lists of things to keep updated. You're right that it doesn't eliminate the problem -- we still have to know to ask the question when reviewing new matchers (so perhaps something that requires you to explicitly opt-in/out would be better).

Adding @sbenza in case he has ideas.

Nov 13 2018, 10:22 AM

Nov 12 2018

sbenza added a comment to D54407: Record the matcher type when storing a binding.

Adding @sbenza in case he has opinions on this approach. I think it's reasonable, but I also know that changes to the the AST matcher internals sometimes have unintended side effects with the various instantiations.

Nov 12 2018, 7:54 AM

Nov 9 2018

sbenza added inline comments to D54307: [ASTMatchers] overload ignoringParens for Expr.
Nov 9 2018, 11:47 AM · Restricted Project

Nov 1 2018

sbenza added a comment to D53978: Add benchmarks for sorting and heap functions..

Is there any value in breaking these out into one benchmark per file? I can see this file ever-growing as we add new benchmarks.

Nov 1 2018, 9:08 AM
sbenza created D53978: Add benchmarks for sorting and heap functions..
Nov 1 2018, 8:33 AM

Oct 30 2018

sbenza committed rCXX345611: Add more benchmarks for std::string..
Add more benchmarks for std::string.
Oct 30 2018, 8:58 AM
sbenza committed rL345611: Add more benchmarks for std::string..
Add more benchmarks for std::string.
Oct 30 2018, 8:56 AM
sbenza closed D53825: Add more benchmarks for std::string..
Oct 30 2018, 8:56 AM

Oct 29 2018

sbenza created D53825: Add more benchmarks for std::string..
Oct 29 2018, 12:14 PM
sbenza added a comment to D53523: Add benchmark for std::set..

Sorry for the break.
I submitted the fix.

Oct 29 2018, 12:12 PM
sbenza committed rCXX345523: Fix mismatch between size_t and uint64_t in std::set benchmark..
Fix mismatch between size_t and uint64_t in std::set benchmark.
Oct 29 2018, 12:10 PM
sbenza committed rL345523: Fix mismatch between size_t and uint64_t in std::set benchmark..
Fix mismatch between size_t and uint64_t in std::set benchmark.
Oct 29 2018, 12:10 PM

Oct 23 2018

sbenza committed rCXX345035: Add benchmark for std::set..
Add benchmark for std::set.
Oct 23 2018, 7:52 AM
sbenza committed rL345035: Add benchmark for std::set..
Add benchmark for std::set.
Oct 23 2018, 7:52 AM
sbenza closed D53523: Add benchmark for std::set..
Oct 23 2018, 7:52 AM

Oct 22 2018

sbenza created D53523: Add benchmark for std::set..
Oct 22 2018, 12:59 PM

Oct 12 2018

sbenza committed rCXX344415: Add benchmarks for std::function..
Add benchmarks for std::function.
Oct 12 2018, 2:03 PM
sbenza committed rL344415: Add benchmarks for std::function..
Add benchmarks for std::function.
Oct 12 2018, 2:03 PM
sbenza closed D53087: Add benchmarks for std::function..
Oct 12 2018, 2:03 PM

Oct 11 2018

sbenza added inline comments to D53087: Add benchmarks for std::function..
Oct 11 2018, 1:00 PM
sbenza updated the diff for D53087: Add benchmarks for std::function..

#include changes. C++17 cleanup.

Oct 11 2018, 1:00 PM

Oct 10 2018

sbenza updated the diff for D53087: Add benchmarks for std::function..

Fixes

Oct 10 2018, 12:39 PM
sbenza added inline comments to D53087: Add benchmarks for std::function..
Oct 10 2018, 12:39 PM
sbenza updated the diff for D53087: Add benchmarks for std::function..

Use TEST_ALWAYS_INLINE instead of attribute((always_inline))

Oct 10 2018, 12:28 PM
sbenza updated the diff for D53087: Add benchmarks for std::function..

Minor comment fix

Oct 10 2018, 10:56 AM
sbenza updated the diff for D53087: Add benchmarks for std::function..

Fix casing for some function names.

Oct 10 2018, 8:58 AM
sbenza created D53087: Add benchmarks for std::function..
Oct 10 2018, 8:54 AM

Jan 15 2018

sbenza committed rCTE322497: [clang-tidy] Expand readability-redundant-smartptr-get to understand implicit….
[clang-tidy] Expand readability-redundant-smartptr-get to understand implicit…
Jan 15 2018, 10:06 AM
sbenza committed rL322497: [clang-tidy] Expand readability-redundant-smartptr-get to understand implicit….
[clang-tidy] Expand readability-redundant-smartptr-get to understand implicit…
Jan 15 2018, 10:06 AM
sbenza closed D41998: [clang-tidy] Expand readability-redundant-smartptr-get to understand implicit converions to bool in more contexts..
Jan 15 2018, 10:06 AM
sbenza closed D41998: [clang-tidy] Expand readability-redundant-smartptr-get to understand implicit converions to bool in more contexts..
Jan 15 2018, 10:06 AM
sbenza updated the diff for D41998: [clang-tidy] Expand readability-redundant-smartptr-get to understand implicit converions to bool in more contexts..

minor fix

Jan 15 2018, 10:06 AM

Jan 12 2018

sbenza created D41998: [clang-tidy] Expand readability-redundant-smartptr-get to understand implicit converions to bool in more contexts..
Jan 12 2018, 9:53 AM

Jan 8 2018

sbenza committed rCTE322002: [clang-tidy] Fix DanglingHandleCheck for the correct conversion operation….
[clang-tidy] Fix DanglingHandleCheck for the correct conversion operation…
Jan 8 2018, 8:00 AM
sbenza committed rL322002: [clang-tidy] Fix DanglingHandleCheck for the correct conversion operation….
[clang-tidy] Fix DanglingHandleCheck for the correct conversion operation…
Jan 8 2018, 8:00 AM
sbenza closed D41779: [clang-tidy] Fix DanglingHandleCheck for the correct conversion operation between basic_string and basic_string_view..
Jan 8 2018, 8:00 AM

Jan 5 2018

sbenza created D41779: [clang-tidy] Fix DanglingHandleCheck for the correct conversion operation between basic_string and basic_string_view..
Jan 5 2018, 10:45 AM

May 30 2017

sbenza added inline comments to D33531: Clang-tidy readability: avoid const value return.
May 30 2017, 7:07 AM · Restricted Project
sbenza added a comment to D33623: Make the parser close parens for you on EOF.

Do we want this change in the parser itself? or in clang-query?
clang-query could be helpful enough to add parens when it detect an ET_ParserNoCloseParen error, without changing the language here.

May 30 2017, 6:57 AM

May 5 2017

sbenza accepted D31160: [clang-tidy] Fix misc-move-const-arg for move-only types..
May 5 2017, 10:25 AM
sbenza added inline comments to D31160: [clang-tidy] Fix misc-move-const-arg for move-only types..
May 5 2017, 9:41 AM

Feb 22 2017

sbenza added inline comments to D29621: Add ASTMatchRefactorer and ReplaceNodeWithTemplate to RefactoringCallbacks.
Feb 22 2017, 2:48 PM

Feb 10 2017

sbenza added inline comments to D29621: Add ASTMatchRefactorer and ReplaceNodeWithTemplate to RefactoringCallbacks.
Feb 10 2017, 1:20 PM

Feb 7 2017

sbenza added inline comments to D29622: Add a batch query and replace tool based on AST matchers..
Feb 7 2017, 7:44 AM
sbenza added inline comments to D29621: Add ASTMatchRefactorer and ReplaceNodeWithTemplate to RefactoringCallbacks.
Feb 7 2017, 7:40 AM

Jan 12 2017

sbenza added inline comments to D28239: [clang-tidy] Function names configurable for cppcoreguidelines-nomalloc - checker.
Jan 12 2017, 7:58 AM · Restricted Project

Sep 26 2016

sbenza accepted D24874: Fully implement the matcher for CXXCtorInitializer.
Sep 26 2016, 10:10 AM

Sep 8 2016

sbenza added inline comments to D24339: [clang-tidy] Add check 'readability-redundant-member-init'.
Sep 8 2016, 11:44 AM

Aug 10 2016

sbenza added inline comments to D22220: [clang-tidy] Add check 'misc-move-forwarding-reference'.
Aug 10 2016, 7:19 AM · Restricted Project

Jul 28 2016

sbenza added inline comments to D22220: [clang-tidy] Add check 'misc-move-forwarding-reference'.
Jul 28 2016, 1:10 PM · Restricted Project

Jul 25 2016

sbenza added inline comments to D22220: [clang-tidy] Add check 'misc-move-forwarding-reference'.
Jul 25 2016, 2:17 PM · Restricted Project

Jun 28 2016

sbenza retitled D21815: [clang-tidy] Add 'included from' details to warning message. from to [clang-tidy] Add 'included from' details to warning message..
Jun 28 2016, 1:22 PM
sbenza committed rL274019: [clang-tidy] Do not match on lambdas..
[clang-tidy] Do not match on lambdas.
Jun 28 2016, 7:26 AM
sbenza committed rL274015: [ASTMatchers] Add isLambda() matcher..
[ASTMatchers] Add isLambda() matcher.
Jun 28 2016, 7:17 AM

Jun 21 2016

sbenza added inline comments to D20964: [clang-tidy] Add modernize-use-emplace.
Jun 21 2016, 11:46 AM

Jun 17 2016

sbenza added a comment to D21185: [clang-tidy] Add performance-emplace-into-containers.

Missing the .rst file.
Did you use the check_clang_tidy.py script to create the template?

Jun 17 2016, 11:52 AM

Jun 7 2016

sbenza accepted D21036: Misplaced const-qualification with typedef types.
Jun 7 2016, 10:21 AM
sbenza added inline comments to D21036: Misplaced const-qualification with typedef types.
Jun 7 2016, 10:01 AM
sbenza added a comment to D21036: Misplaced const-qualification with typedef types.

I think this would be more interesting with macros.
Eg triggering in code like this:

#define FOO(type, op) const type& X = op()
FOO(int*, bar);

Sorry, I originally missed this comment.

That might be a reasonable addition to this check, but strikes me as a future enhancement. Are you looking for the patch to cover this case initially, or is it fine for a follow-up?

Jun 7 2016, 9:58 AM

Jun 6 2016

sbenza added a comment to D21036: Misplaced const-qualification with typedef types.

I think this would be more interesting with macros.
Eg triggering in code like this:

Jun 6 2016, 1:03 PM
sbenza committed rL271896: [clang-tidy] Do not try to suggest a fix if the parameter is partially in a….
[clang-tidy] Do not try to suggest a fix if the parameter is partially in a…
Jun 6 2016, 7:27 AM

Jun 2 2016

sbenza added a comment to D20917: [clang-tidy] modernize-use-auto: don't remove stars by default.

Is it a typo in the description when it says that when RemoveStar is on we will write 'auto*' instead if 'auto'?

Jun 2 2016, 9:35 AM

Jun 1 2016

sbenza committed rL271426: Fix uninitialized memory access when the token 'const' is not present in.
Fix uninitialized memory access when the token 'const' is not present in
Jun 1 2016, 1:44 PM

May 31 2016

sbenza added inline comments to D20277: [clang-tidy] UnnecessaryValueParamCheck - suggest std::move() if non-const value parameter can be moved..
May 31 2016, 8:18 AM

May 25 2016

sbenza committed rL270714: Speed up check by using a recursive visitor..
Speed up check by using a recursive visitor.
May 25 2016, 9:25 AM
sbenza closed D20597: Speed up check by using a recursive visitor. by committing rL270714: Speed up check by using a recursive visitor..
May 25 2016, 9:25 AM
sbenza updated the diff for D20597: Speed up check by using a recursive visitor..

Reformat code

May 25 2016, 9:17 AM

May 24 2016

sbenza retitled D20597: Speed up check by using a recursive visitor. from to Speed up check by using a recursive visitor..
May 24 2016, 1:51 PM

May 23 2016

sbenza added inline comments to D19324: [ASTMatchers] new forEachOverriden matcher.
May 23 2016, 8:30 AM