Page MenuHomePhabricator

sbenza (Samuel Benzaquen)
User

Projects

User does not belong to any projects.

User Details

User Since
Apr 23 2013, 11:59 AM (517 w, 5 d)

Recent Activity

Oct 4 2021

sbenza accepted D110586: Update `DynTypedNode` to support the conversion of `TypeLoc`s..
Oct 4 2021, 9:34 AM · Restricted Project

Oct 1 2021

sbenza added inline comments to D110586: Update `DynTypedNode` to support the conversion of `TypeLoc`s..
Oct 1 2021, 1:30 PM · Restricted Project

Sep 30 2021

sbenza added inline comments to D110586: Update `DynTypedNode` to support the conversion of `TypeLoc`s..
Sep 30 2021, 10:37 AM · Restricted Project

Aug 28 2020

sbenza accepted D86751: Add new warning for compound punctuation tokens that are split across macro expansions or split by whitespace..
Aug 28 2020, 6:41 AM · Restricted Project

Feb 28 2020

sbenza accepted D75365: [AST Matchers] Fix bug in 'optionally' matcher wherein all previous bindings are cleared when all inner matchers fail..
Feb 28 2020, 10:23 AM · Restricted Project

May 22 2019

sbenza accepted D62160: [LibTooling] Update Stencil to use RangeSelector.
May 22 2019, 8:43 AM · Restricted Project, Restricted Project, Restricted Project, Restricted Project

May 8 2019

sbenza added a comment to D59999: Allow the compiler to optimize `string == "literal string"`..

I'm not happy with this. In particular, it does NOT call through the character traits, which it is required to do by the standard.

May 8 2019, 7:52 AM · Restricted Project

May 6 2019

sbenza added a comment to D59999: Allow the compiler to optimize `string == "literal string"`..

As an example of code reduction.

May 6 2019, 8:24 AM · Restricted Project
sbenza updated the diff for D59999: Allow the compiler to optimize `string == "literal string"`..

Another option for the optimzation.

May 6 2019, 8:16 AM · Restricted Project

Apr 29 2019

sbenza added a comment to D59999: Allow the compiler to optimize `string == "literal string"`..

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.

I don't think so, because then it would (might?) not end up in the dylib, and that would break *everything* that uses it.

Apr 29 2019, 7:33 AM · Restricted Project
sbenza retitled D59999: Allow the compiler to optimize `string == "literal string"`. from Make it easier for the compiler to optimize `operator==(string,char*)`. to Allow the compiler to optimize `string == "literal string"`..
Apr 29 2019, 7:31 AM · Restricted Project
sbenza updated the diff for D59999: Allow the compiler to optimize `string == "literal string"`..

Use inline to solve the problem instead of changing the implemetation.

Apr 29 2019, 7:31 AM · Restricted Project

Apr 24 2019

sbenza accepted D61005: [LibTooling] Fix unneeded use of unique_ptr where shared_ptr is expected..
Apr 24 2019, 8:08 AM · Restricted Project, Restricted Project

Apr 18 2019

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

Apr 17 2019

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

Apr 10 2019

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

Apr 3 2019

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

Mar 29 2019

sbenza added a comment to D59999: Allow the compiler to optimize `string == "literal string"`..

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:

Mar 29 2019, 2:21 PM · Restricted Project
sbenza added a comment to D59999: Allow the compiler to optimize `string == "literal string"`..

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.

Mar 29 2019, 1:53 PM · Restricted Project
sbenza created D59999: Allow the compiler to optimize `string == "literal string"`..
Mar 29 2019, 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.

Mar 29 2019, 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*).
Mar 29 2019, 8:21 AM · Restricted Project

Mar 25 2019

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

Fix benchmark for rhs being empty.

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

Mar 21 2019

sbenza committed rG9b7aa02b539f: Add relational benchmark against a string constant. (authored by sbenza).
Add relational benchmark against a string constant.
Mar 21 2019, 9:06 AM
sbenza committed rCXX356680: Add relational benchmark against a string constant..
Add relational benchmark against a string constant.
Mar 21 2019, 9:05 AM
sbenza committed rL356680: Add relational benchmark against a string constant..
Add relational benchmark against a string constant.
Mar 21 2019, 9:05 AM
sbenza closed D59512: Add relational benchmark against a string constant..
Mar 21 2019, 9:05 AM · Restricted Project
sbenza added inline comments to D59512: Add relational benchmark against a string constant..
Mar 21 2019, 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