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

Standalone header file for ArgList #590

Closed
ludekvodicka opened this issue Oct 22, 2017 · 2 comments
Closed

Standalone header file for ArgList #590

ludekvodicka opened this issue Oct 22, 2017 · 2 comments

Comments

@ludekvodicka
Copy link
Contributor

Would be possible to separate ArgList class to standalone header file?

Because fmt::ArgList is used on a lot of places, it would be great to be able to include fmt::ArgList only instead of including the whole format.h.

@ludekvodicka ludekvodicka changed the title Standalone file for ArgList Standalone header file for ArgList Oct 22, 2017
@vitaut
Copy link
Contributor

vitaut commented Oct 22, 2017

It has been already suggested in #528 (comment). I think it's a reasonable suggestion and can be done in the next version together with an API to construct argument lists.

@vitaut
Copy link
Contributor

vitaut commented Dec 6, 2017

Moved the core API that deals with argument lists to a separate header, fmt/core.h, in the std branch. The new header is very small, just 672 significant LOC as reported by cloc

$ cloc include/fmt/core.h
-------------------------------------------------------------------------------
Language                     files          blank        comment           code
-------------------------------------------------------------------------------
C/C++ Header                     1            183            148            672
-------------------------------------------------------------------------------

and has only few dependencies (I plan to reduce dependencies even more later).

With these changes compile times are now >40% better compared to IOStreams on bloat-test:

============ =============== ==================== ==================
Method       Compile Time, s Executable size, KiB Stripped size, KiB
============ =============== ==================== ==================
printf                   2.6                   29                 26
IOStreams               35.0                   59                 55
fmt                     24.2                   37                 34
tinyformat              49.2                  103                 97
Boost Format           113.0                  762                739
Folly Format           147.7                  102                 87
============ =============== ==================== ==================

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants