Skip to content
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

Improve compilation speed by taking advantage of memoization #79

Open
wants to merge 13 commits into
base: develop
Choose a base branch
from

Commits on Jul 6, 2023

  1. optimize mp_transform_if (extract f from the struct to benefit from m…

    …emoization)
    
    compiler |       gcc-12      |      clang-15
    before   | 0:00.13s - 60432K | 0:00.16s - 100956K
    after    | 0:00.11s - 47300K | 0:00.16s - 100484K
    
    ```cpp
    using namespace boost::mp11;
    
    template<class T> using p = mp_bool<T::value & 1>;
    template<class T> using f = mp_size_t<T::value + 1>;
    template<class I> using test = mp_transform_if<p, f, mp_iota<I>>;
    
    using r1 = mp_transform<test, mp_iota_c<50>>;
    ```
    jonathanpoelen committed Jul 6, 2023
    Configuration menu
    Copy the full SHA
    4efda72 View commit details
    Browse the repository at this point in the history
  2. optimize mp_filter (extract f from the struct to benefit from memoiza…

    …tion)
    
    compiler |       gcc-12      |      clang-15
    before   | 0:00.16s - 72460K | 0:00.16s - 102068K
    after    | 0:00.14s - 61884K | 0:00.16s - 101828K
    
    ```cpp
    using namespace boost::mp11;
    
    template<class T> using p = mp_bool<T::value & 1>;
    template<class I> using test = mp_filter<p, mp_iota<I>>;
    
    using r1 = mp_transform<test, mp_iota_c<50>>;
    ```
    jonathanpoelen committed Jul 6, 2023
    Configuration menu
    Copy the full SHA
    b131e3f View commit details
    Browse the repository at this point in the history
  3. optimize mp_drop (extract f from the struct to benefit from memoization)

    compiler |       gcc-12       |      clang-15
    before   | 0:00.48s - 192464K | 0:00.48s - 154480K
    after    | 0:00.43s - 172472K | 0:00.46s - 150404K
    
    ```cpp
    template<class L> struct f { template<class I> using g = mp_drop<L, I>; };
    template<class I, class L = mp_iota<I>> using test = mp_transform<f<L>::template g, L>;
    
    using r1 = mp_transform<test, mp_iota_c<50>>;
    ```
    jonathanpoelen committed Jul 6, 2023
    Configuration menu
    Copy the full SHA
    bdfc8d1 View commit details
    Browse the repository at this point in the history
  4. optimize mp_sort (extract f from the struct to benefit from memoization)

    compiler |       gcc-12       |      clang-15
    before   | 0:00.46s - 198848K | 0:00.49s - 132632K
    after    | 0:00.42s - 183384K | 0:00.48s - 131748K
    
    ```cpp
    using namespace boost::mp11;
    
    template<class I> using test = mp_sort<mp_iota<I>, mp_less>;
    
    using r1 = mp_transform<test, mp_iota_c<25>>;
    ```
    jonathanpoelen committed Jul 6, 2023
    Configuration menu
    Copy the full SHA
    12a80bd View commit details
    Browse the repository at this point in the history
  5. optimize mp_replace_at (extract f from the struct to benefit from mem…

    …oization)
    
    compiler |       gcc-12       |      clang-15
    before   | 0:00.34s - 134428K | 0:00.33s - 124720K
    after    | 0:00.29s - 116920K | 0:00.32s - 122568K
    
    ```cpp
    using namespace boost::mp11;
    
    template<class I> using f = mp_replace_at<mp_iota<I>, I, void>;
    template<class I> using test = mp_transform<f, mp_iota<I>>;
    
    using r1 = mp_transform<test, mp_iota_c<50>>;
    ```
    jonathanpoelen committed Jul 6, 2023
    Configuration menu
    Copy the full SHA
    33f6c72 View commit details
    Browse the repository at this point in the history
  6. optimize mp_power_set (extract f from the struct to benefit from memo…

    …ization)
    
    compiler |       gcc-12       |      clang-15
    before   | 0:01.35s - 538732K | 0:00.65s - 203924K
    after    | 0:01.02s - 396032K | 0:00.65s - 203080K
    
    ```cpp
    using namespace boost::mp11;
    
    template<class I> using test = mp_power_set<mp_iota<I>>;
    
    using r1 = mp_transform<test, mp_iota_c<15>>;
    ```
    jonathanpoelen committed Jul 6, 2023
    Configuration menu
    Copy the full SHA
    c479059 View commit details
    Browse the repository at this point in the history
  7. optimize mp_map_find (extract f from the struct to benefit from memoi…

    …zation)
    
    compiler |       gcc-12       |      clang-15
    before   | 0:00.29s - 128600K | 0:00.25s - 120604K
    after    | 0:00.22s - 99908K  | 0:00.23s - 116084K
    
    ```cpp
    using namespace boost::mp11;
    
    template<class L, class M = mp_transform<mp_list, L>>
    struct f { template<class I> using g = mp_map_find<M, I>; };
    
    template<class I, class L = mp_iota<I>> using test
      = mp_transform<f<L>::template g, L>;
    
    using r1 = mp_transform<test, mp_iota_c<50>>;
    ```
    jonathanpoelen committed Jul 6, 2023
    Configuration menu
    Copy the full SHA
    5c466a9 View commit details
    Browse the repository at this point in the history
  8. optimize mp_map_update (extract f from the struct to benefit from mem…

    …oization)
    
    compiler |       gcc-12       |      clang-15
    before   | 0:00.73s - 270224K | 0:00.54s - 156112K
    after    | 0:00.19s - 85004K  | 0:00.29s - 119232K
    
    ```cpp
    using namespace boost::mp11;
    
    template<class L, class M = mp_transform<mp_list, L>>
    struct f { template<class I> using g = mp_map_update<M, mp_list<I>, mp_list>; };
    
    template<class I, class L = mp_iota<I>> using test
      = mp_transform<f<L>::template g, L>;
    
    using r1 = mp_transform<test, mp_iota_c<20>>;
    ```
    jonathanpoelen committed Jul 6, 2023
    Configuration menu
    Copy the full SHA
    480189d View commit details
    Browse the repository at this point in the history
  9. optimize mp_map_erase (extract f from the struct to benefit from memo…

    …ization)
    
    compiler |       gcc-12       |      clang-15
    before   | 0:00.52s - 197128K | 0:00.44s - 140780K
    after    | 0:00.47s - 183968K | 0:00.43s - 139336K
    
    ```cpp
    using namespace boost::mp11;
    
    template<class L, class M = mp_transform<mp_list, L>>
    struct f { template<class I> using g = mp_map_erase<M, I>; };
    
    template<class I, class L = mp_iota<I>> using test
      = mp_transform<f<L>::template g, L>;
    
    using r1 = mp_transform<test, mp_iota_c<30>>;
    ```
    jonathanpoelen committed Jul 6, 2023
    Configuration menu
    Copy the full SHA
    29246d3 View commit details
    Browse the repository at this point in the history
  10. optimize mp_map_replace

    compiler |       gcc-12       |      clang-15
    before   | 0:00.46s - 187160K | 0:00.38s - 129104K
    after    | 0:00.21s - 80236K  | 0:00.33s - 123644K
    
    ```cpp
    using namespace boost::mp11;
    
    template<class L, class M = mp_transform<mp_list, L>>
    struct f { template<class I> using g = mp_map_replace<M, mp_list<I, I>>; };
    
    template<class I, class L = mp_iota<I>> using test
      = mp_transform<f<L>::template g, L>;
    
    using r1 = mp_transform<test, mp_iota_c<30>>;
    ```
    jonathanpoelen committed Jul 6, 2023
    Configuration menu
    Copy the full SHA
    de1ca6f View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    09d7a0e View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    45fbe8a View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    7f478ea View commit details
    Browse the repository at this point in the history