Re: Review Request 49246: Enhanced startsWith/endsWith's performance.

2016-07-04 Thread Michael Park

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


Ship it!




Ship It!

- Michael Park


On July 4, 2016, 1:57 p.m., Klaus Ma wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/49246/
> ---
> 
> (Updated July 4, 2016, 1:57 p.m.)
> 
> 
> Review request for mesos and Michael Park.
> 
> 
> Bugs: MESOS-5715
> https://issues.apache.org/jira/browse/MESOS-5715
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Enhanced startsWith/endsWith's performance.
> 
> 
> Diffs
> -
> 
>   3rdparty/stout/include/stout/strings.hpp 
> 162bdfb6c4f5a6b108761ebccd9b77e672f6dd87 
> 
> Diff: https://reviews.apache.org/r/49246/diff/
> 
> 
> Testing
> ---
> 
> make && make check
> 
> 
> Thanks,
> 
> Klaus Ma
> 
>



Re: Review Request 49246: Enhanced startsWith/endsWith's performance.

2016-07-04 Thread Klaus Ma

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

(Updated July 4, 2016, 9:57 p.m.)


Review request for mesos and Michael Park.


Changes
---

Update format.


Bugs: MESOS-5715
https://issues.apache.org/jira/browse/MESOS-5715


Repository: mesos


Description
---

Enhanced startsWith/endsWith's performance.


Diffs (updated)
-

  3rdparty/stout/include/stout/strings.hpp 
162bdfb6c4f5a6b108761ebccd9b77e672f6dd87 

Diff: https://reviews.apache.org/r/49246/diff/


Testing
---

make && make check


Thanks,

Klaus Ma



Re: Review Request 49246: Enhanced startsWith/endsWith's performance.

2016-07-04 Thread Mesos ReviewBot

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



Patch looks great!

Reviews applied: [49140, 49246]

Passed command: export OS='ubuntu:14.04' BUILDTOOL='autotools' COMPILER='gcc' 
CONFIGURATION='--verbose' ENVIRONMENT='GLOG_v=1 MESOS_VERBOSE=1'; 
./support/docker_build.sh

- Mesos ReviewBot


On July 4, 2016, 6:49 a.m., Klaus Ma wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/49246/
> ---
> 
> (Updated July 4, 2016, 6:49 a.m.)
> 
> 
> Review request for mesos and Michael Park.
> 
> 
> Bugs: MESOS-5715
> https://issues.apache.org/jira/browse/MESOS-5715
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Enhanced startsWith/endsWith's performance.
> 
> 
> Diffs
> -
> 
>   3rdparty/stout/include/stout/strings.hpp 
> 162bdfb6c4f5a6b108761ebccd9b77e672f6dd87 
> 
> Diff: https://reviews.apache.org/r/49246/diff/
> 
> 
> Testing
> ---
> 
> make && make check
> 
> 
> Thanks,
> 
> Klaus Ma
> 
>



Re: Review Request 49246: Enhanced startsWith/endsWith's performance.

2016-07-04 Thread Klaus Ma

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

(Updated July 4, 2016, 2:49 p.m.)


Review request for mesos and Michael Park.


Changes
---

Address mcypark's comments.


Bugs: MESOS-5715
https://issues.apache.org/jira/browse/MESOS-5715


Repository: mesos


Description
---

Enhanced startsWith/endsWith's performance.


Diffs (updated)
-

  3rdparty/stout/include/stout/strings.hpp 
162bdfb6c4f5a6b108761ebccd9b77e672f6dd87 

Diff: https://reviews.apache.org/r/49246/diff/


Testing
---

make && make check


Thanks,

Klaus Ma



Re: Review Request 49246: Enhanced startsWith/endsWith's performance.

2016-07-03 Thread Michael Park

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




3rdparty/stout/include/stout/strings.hpp (lines 370 - 374)


I think it would be more efficient and readable to use `std::equal`.

```
return s.size() >= prefix.size() &&
   std::equal(prefix.begin(), prefix.end(), s.begin());
```



3rdparty/stout/include/stout/strings.hpp (lines 386 - 390)


```
return s.size() >= suffix.size() &&
   std::equal(suffix.rbegin(), suffix.rend(), s.rbegin());
```


- Michael Park


On June 27, 2016, 6:16 a.m., Klaus Ma wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/49246/
> ---
> 
> (Updated June 27, 2016, 6:16 a.m.)
> 
> 
> Review request for mesos and Michael Park.
> 
> 
> Bugs: MESOS-5715
> https://issues.apache.org/jira/browse/MESOS-5715
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Enhanced startsWith/endsWith's performance.
> 
> 
> Diffs
> -
> 
>   3rdparty/stout/include/stout/strings.hpp 
> 162bdfb6c4f5a6b108761ebccd9b77e672f6dd87 
> 
> Diff: https://reviews.apache.org/r/49246/diff/
> 
> 
> Testing
> ---
> 
> make && make check
> 
> 
> Thanks,
> 
> Klaus Ma
> 
>



Re: Review Request 49246: Enhanced startsWith/endsWith's performance.

2016-06-27 Thread Neil Conway

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


Ship it!




Ship It!

- Neil Conway


On June 27, 2016, 6:16 a.m., Klaus Ma wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/49246/
> ---
> 
> (Updated June 27, 2016, 6:16 a.m.)
> 
> 
> Review request for mesos and Michael Park.
> 
> 
> Bugs: MESOS-5715
> https://issues.apache.org/jira/browse/MESOS-5715
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Enhanced startsWith/endsWith's performance.
> 
> 
> Diffs
> -
> 
>   3rdparty/stout/include/stout/strings.hpp 
> 162bdfb6c4f5a6b108761ebccd9b77e672f6dd87 
> 
> Diff: https://reviews.apache.org/r/49246/diff/
> 
> 
> Testing
> ---
> 
> make && make check
> 
> 
> Thanks,
> 
> Klaus Ma
> 
>



Re: Review Request 49246: Enhanced startsWith/endsWith's performance.

2016-06-27 Thread haosdent huang

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


Ship it!




Ship It!

- haosdent huang


On June 27, 2016, 6:16 a.m., Klaus Ma wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/49246/
> ---
> 
> (Updated June 27, 2016, 6:16 a.m.)
> 
> 
> Review request for mesos and Michael Park.
> 
> 
> Bugs: MESOS-5715
> https://issues.apache.org/jira/browse/MESOS-5715
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Enhanced startsWith/endsWith's performance.
> 
> 
> Diffs
> -
> 
>   3rdparty/stout/include/stout/strings.hpp 
> 162bdfb6c4f5a6b108761ebccd9b77e672f6dd87 
> 
> Diff: https://reviews.apache.org/r/49246/diff/
> 
> 
> Testing
> ---
> 
> make && make check
> 
> 
> Thanks,
> 
> Klaus Ma
> 
>



Re: Review Request 49246: Enhanced startsWith/endsWith's performance.

2016-06-27 Thread Klaus Ma


> On June 27, 2016, 4:25 p.m., Neil Conway wrote:
> > Can you provide some benchmarks to validate whether these changes improve 
> > performance, and for what kinds of inputs? (e.g., short vs. long strings, 
> > found match vs. no-match-found).

@neil, thanks for your comments; benchmarks maybe not necessary for this case:

1. In `startsWith`, `find` will try to find the first position of `prefix`, for 
example: s is "aab", prefix is "b", `find` will return 2; the performance 
improvement dependent on the length of `s`.
2. In `endsWith`, similar cases with `startsWith`.


- Klaus


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


On June 27, 2016, 2:16 p.m., Klaus Ma wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/49246/
> ---
> 
> (Updated June 27, 2016, 2:16 p.m.)
> 
> 
> Review request for mesos and Michael Park.
> 
> 
> Bugs: MESOS-5715
> https://issues.apache.org/jira/browse/MESOS-5715
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Enhanced startsWith/endsWith's performance.
> 
> 
> Diffs
> -
> 
>   3rdparty/stout/include/stout/strings.hpp 
> 162bdfb6c4f5a6b108761ebccd9b77e672f6dd87 
> 
> Diff: https://reviews.apache.org/r/49246/diff/
> 
> 
> Testing
> ---
> 
> make && make check
> 
> 
> Thanks,
> 
> Klaus Ma
> 
>



Re: Review Request 49246: Enhanced startsWith/endsWith's performance.

2016-06-27 Thread Neil Conway

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



Can you provide some benchmarks to validate whether these changes improve 
performance, and for what kinds of inputs? (e.g., short vs. long strings, found 
match vs. no-match-found).

- Neil Conway


On June 27, 2016, 6:16 a.m., Klaus Ma wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/49246/
> ---
> 
> (Updated June 27, 2016, 6:16 a.m.)
> 
> 
> Review request for mesos and Michael Park.
> 
> 
> Bugs: MESOS-5715
> https://issues.apache.org/jira/browse/MESOS-5715
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Enhanced startsWith/endsWith's performance.
> 
> 
> Diffs
> -
> 
>   3rdparty/stout/include/stout/strings.hpp 
> 162bdfb6c4f5a6b108761ebccd9b77e672f6dd87 
> 
> Diff: https://reviews.apache.org/r/49246/diff/
> 
> 
> Testing
> ---
> 
> make && make check
> 
> 
> Thanks,
> 
> Klaus Ma
> 
>



Re: Review Request 49246: Enhanced startsWith/endsWith's performance.

2016-06-27 Thread Mesos ReviewBot

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



Patch looks great!

Reviews applied: [49140, 49246]

Passed command: export OS='ubuntu:14.04' BUILDTOOL='autotools' COMPILER='gcc' 
CONFIGURATION='--verbose' ENVIRONMENT='GLOG_v=1 MESOS_VERBOSE=1'; 
./support/docker_build.sh

- Mesos ReviewBot


On June 27, 2016, 6:16 a.m., Klaus Ma wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/49246/
> ---
> 
> (Updated June 27, 2016, 6:16 a.m.)
> 
> 
> Review request for mesos and Michael Park.
> 
> 
> Bugs: MESOS-5715
> https://issues.apache.org/jira/browse/MESOS-5715
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Enhanced startsWith/endsWith's performance.
> 
> 
> Diffs
> -
> 
>   3rdparty/stout/include/stout/strings.hpp 
> 162bdfb6c4f5a6b108761ebccd9b77e672f6dd87 
> 
> Diff: https://reviews.apache.org/r/49246/diff/
> 
> 
> Testing
> ---
> 
> make && make check
> 
> 
> Thanks,
> 
> Klaus Ma
> 
>



Re: Review Request 49246: Enhanced startsWith/endsWith's performance.

2016-06-27 Thread Klaus Ma

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

(Updated June 27, 2016, 2:16 p.m.)


Review request for mesos and Michael Park.


Changes
---

Update JIRA


Bugs: MESOS-5715
https://issues.apache.org/jira/browse/MESOS-5715


Repository: mesos


Description
---

Enhanced startsWith/endsWith's performance.


Diffs
-

  3rdparty/stout/include/stout/strings.hpp 
162bdfb6c4f5a6b108761ebccd9b77e672f6dd87 

Diff: https://reviews.apache.org/r/49246/diff/


Testing
---

make && make check


Thanks,

Klaus Ma



Review Request 49246: Enhanced startsWith/endsWith's performance.

2016-06-27 Thread Klaus Ma

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

Review request for mesos and Michael Park.


Bugs: MESOS-5692
https://issues.apache.org/jira/browse/MESOS-5692


Repository: mesos


Description
---

Enhanced startsWith/endsWith's performance.


Diffs
-

  3rdparty/stout/include/stout/strings.hpp 
162bdfb6c4f5a6b108761ebccd9b77e672f6dd87 

Diff: https://reviews.apache.org/r/49246/diff/


Testing
---

make && make check


Thanks,

Klaus Ma