New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Predicate leaper [WIP] #20

Open
wants to merge 2 commits into
base: master
from

Conversation

Projects
None yet
2 participants
@frankmcsherry
Collaborator

frankmcsherry commented Dec 5, 2018

This PR introduces treefrog::filters::{PrefixFilter, ValueFilter}, each of which implement Leaper. The first is constructed from a fn(&Tuple) -> bool and the second from a fn(&Tuple, &Val) -> bool. Each of them do the very simple action you would expect, the first one ruling out extensions based on prefix and the second filtering values down using the predicate.

frankmcsherry and others added some commits Dec 5, 2018

@nikomatsakis

This comment has been minimized.

Member

nikomatsakis commented Dec 5, 2018

Seems like a handi concept, though I'm not sure that I have a use for it yet =)

@nikomatsakis

This comment has been minimized.

Member

nikomatsakis commented Dec 6, 2018

I just remembered that measuring wallclock is for suckers. Here is the perf stat data for the clap-rs run.

Before this branch

 Performance counter stats for 'cargo +nightly run -q --release -- -a DatafrogOpt inputs/clap-rs/app-parser-{{impl}}-add_defaults/':

          4,025.17 msec task-clock:u              #    1.000 CPUs utilized
                 0      context-switches:u        #    0.000 K/sec
                 0      cpu-migrations:u          #    0.000 K/sec
            59,305      page-faults:u             # 14734.161 M/sec
    15,758,451,927      cycles:u                  # 3915143.336 GHz
    23,096,903,211      instructions:u            #    1.47  insn per cycle
     5,605,560,844      branches:u                # 1392685923.975 M/sec
       183,745,828      branch-misses:u           #    3.28% of all branches

       4.025395892 seconds time elapsed

       3.921707000 seconds user
       0.091707000 seconds sys

After this branch

Trial 3
--------------------------------------------------
Directory: inputs/clap-rs/app-parser-{{impl}}-add_defaults/
Time: 3.089s

 Performance counter stats for 'cargo +nightly run -q --release -- -a DatafrogOpt inputs/clap-rs/app-parser-{{impl}}-add_defaults/':

          3,457.01 msec task-clock:u              #    1.000 CPUs utilized
                 0      context-switches:u        #    0.000 K/sec
                 0      cpu-migrations:u          #    0.000 K/sec
            67,908      page-faults:u             # 19643.622 M/sec
    14,628,191,302      cycles:u                  # 4231469.859 GHz
    23,038,912,035      instructions:u            #    1.57  insn per cycle
     5,589,209,698      branches:u                # 1616780358.114 M/sec
       184,352,921      branch-misses:u           #    3.30% of all branches

       3.456541405 seconds time elapsed

       3.328974000 seconds user
       0.117606000 seconds sys
@frankmcsherry

This comment has been minimized.

Collaborator

frankmcsherry commented Dec 6, 2018

Wait, but .. nothing changed in this branch other than some weird new predicate filters. :)

Is this for the &'a Val and Val unification?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment