> On Aug. 24, 2020, 9:30 p.m., Benjamin Mahler wrote:
> > Hm.. is it possible to have a simpler patch that avoids the factory and 
> > instead passes the flags through the creation path?

This is possible; however, I would argue that putting limits on RE2 is rather 
deep implemenation detail which should not pollute the **public allocator 
interface**.

Given this, and also the need for caching, I'm not sure that passing the flags 
through creation path and removing them right after that makes a lot of sense.


> On Aug. 24, 2020, 9:30 p.m., Benjamin Mahler wrote:
> > src/master/allocator/mesos/offer_constraints_filter.cpp
> > Lines 113-119 (patched)
> > <https://reviews.apache.org/r/72786/diff/5/?file=2238651#file2238651line113>
> >
> >     How did you figure this out? Just from your own testing?
> >     
> >     What about with clang? Same result?
> >     
> >     How much faster? Is it worth bothering?

Around 10% of the allocation loop time in a rather pecualr, although not 
exotic, situation: a fast regexp that filters out most of the agents.
Probably not worth bothering until we have a well-parametrized benchmark.

Maybe instead I should figure out if -O3 (which is the default in ther 
Makefile, as opposed to cMake with RelWithDebInfo, which by defautl uses -O2) 
can get us rid of this buffer zeroing: 
https://github.com/google/re2/blob/ca11026a032ce2a3de4b3c389ee53d2bdc8794d6/re2/re2.cc#L907
in the case of FullMatch.

If it does, it might be worth making the CMake build less consistent internally 
but more consistent with the "standard" build flags of RE2.


> On Aug. 24, 2020, 9:30 p.m., Benjamin Mahler wrote:
> > src/master/flags.hpp
> > Lines 125-126 (patched)
> > <https://reviews.apache.org/r/72786/diff/5/?file=2238653#file2238653line125>
> >
> >     Just noticed that these don't line up with the above constant types, is 
> > that intentional?
> >     
> >     Can we make max_mem of type `Bytes`? That would let a user specify 
> > "4kb", "4MB" etc

These are types are identical to those used in RE2. 
I'll try `Bytes`, though; if flags work with that, that would be great.


- Andrei


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/72786/#review221697
-----------------------------------------------------------


On Aug. 24, 2020, 7:46 p.m., Andrei Sekretenko wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/72786/
> -----------------------------------------------------------
> 
> (Updated Aug. 24, 2020, 7:46 p.m.)
> 
> 
> Review request for mesos and Benjamin Mahler.
> 
> 
> Bugs: MESOS-10173
>     https://issues.apache.org/jira/browse/MESOS-10173
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Implemented regex-based offer constraints.
> 
> 
> Diffs
> -----
> 
>   include/mesos/allocator/allocator.hpp 
> 05d0e9c46485c3048a65d46747d56e715883a0b3 
>   src/Makefile.am 8b95611baff2f925910ea46addf462cf9f33071b 
>   src/master/allocator/mesos/offer_constraints_filter.hpp PRE-CREATION 
>   src/master/allocator/mesos/offer_constraints_filter.cpp 
> ef8a948260d92a9d54efb65f0e5c8aa3d0c67b91 
>   src/master/constants.hpp c384b6878193a4b6bb09294d8b14757906595c1b 
>   src/master/flags.hpp 78623d68bf428cd3f52684303d98a525d42eb878 
>   src/master/flags.cpp 74f4daadd48e8e691be43759b88dc8b3c2df489a 
>   src/master/master.hpp e478f805069813532011f2a1991ab1f847080516 
>   src/master/master.cpp 4428985902512eea1c97205f04a4fed6c16d494e 
>   src/tests/master/offer_constraints_filter_tests.cpp 
> f88e2011bc510323344ffe58fd550b7683242950 
> 
> 
> Diff: https://reviews.apache.org/r/72786/diff/5/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Andrei Sekretenko
> 
>

Reply via email to