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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the source a regular class #1498

Merged
merged 5 commits into from Apr 6, 2021
Merged

Conversation

tobim
Copy link
Member

@tobim tobim commented Mar 25, 2021

馃摂 Description

This introduces a reader factory that is used for vast import and spawn source instead of instantiating source, make_source, import_command, etc with every existing reader type.

This change is intended to improve the dev experience during modify -> compile -> run cycles by speeding up incremental builds.

A local test simulating a change to source.hpp gives the following times for me:

Before:

$ touch libvast/vast/system/source.hpp
$ time cmake --build ~/t/build/vast/debug -j 1
[0/2] Re-checking globbed directories...
[19/19] Linking CXX executable bin/example-test

________________________________________________________
Executed in  155.45 secs   fish           external
   usr time  154.25 secs   38.12 millis  154.21 secs
   sys time    8.83 secs    5.00 millis    8.83 secs

After:

$ touch libvast/vast/system/source.hpp
$ time cmake --build ~/t/build/vast/detemp -j 1
[0/2] Re-checking globbed directories...
[15/15] Linking integration test directory

________________________________________________________
Executed in   83.25 secs   fish           external
   usr time   85.76 secs    0.00 micros   85.76 secs
   sys time    5.49 secs  712.00 micros    5.49 secs

馃幆 Review Instructions

Sorry for the single big commit, it is probably easiest to compare the this against the merge base by checking both locally and opening the header of master next to the cpp from this branch, i.e. master/source.hpp | detemplate/source.cpp.

One can probably start by looking at the changes that were done for the reader and derived classes, and then go from outside in: application.cpp -> import_command -> make_source -> source & source_common. spawn_source and node.cpp are obvious afterwards.

I'm available for a review call is anyone is interested.

@tobim tobim added the maintenance Tasks for keeping up the infrastructure label Mar 25, 2021
@tobim tobim requested a review from a team March 25, 2021 15:21
@dominiklohmann dominiklohmann requested a review from a team March 25, 2021 15:24
@tobim tobim force-pushed the topic/detemplate-source branch 2 times, most recently from ada0243 to 409299a Compare March 25, 2021 15:48
@tobim
Copy link
Member Author

tobim commented Mar 25, 2021

@elvisoric you might be interested in this. It should remove some of the friction for exploratory changes.

@elvisoric
Copy link

@tobim Thank you. I'll take a look.

@dominiklohmann dominiklohmann self-assigned this Mar 30, 2021
libvast/src/detail/make_io_stream.cpp Show resolved Hide resolved
libvast/src/system/make_source.cpp Show resolved Hide resolved
libvast/src/system/source.cpp Show resolved Hide resolved
This introduces a reader factory that is used for `vast import` and
`spawn source` instead of instantiating `source`, `make_source`,
`import_command`, etc with every existing reader type.

This change is intended to improve the dev experience during
modify -> compile -> run cycles by speeding up incremental builds.

A local test simulating a change to `source.hpp` gives the following
times for me:

Before:
```
$ touch libvast/vast/system/source.hpp
$ time cmake --build ~/t/build/vast/debug -j 1
[0/2] Re-checking globbed directories...
[19/19] Linking CXX executable bin/example-test

________________________________________________________
Executed in  155.45 secs   fish           external
   usr time  154.25 secs   38.12 millis  154.21 secs
   sys time    8.83 secs    5.00 millis    8.83 secs
```

After:
```
$ touch libvast/vast/system/source.hpp
$ time cmake --build ~/t/build/vast/detemp -j 1
[0/2] Re-checking globbed directories...
[15/15] Linking integration test directory

________________________________________________________
Executed in   83.25 secs   fish           external
   usr time   85.76 secs    0.00 micros   85.76 secs
   sys time    5.49 secs  712.00 micros    5.49 secs
```
Copy link
Member

@dominiklohmann dominiklohmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made the requested changes myself, they're all contained in the last commit. @tobim if you approve of my changes, please just merge the PR after CI is done.

tools/lsvast/CMakeLists.txt Show resolved Hide resolved
libvast/vast/system/datagram_source.hpp Outdated Show resolved Hide resolved
- Pulls in changes from upstream
- Removes templated source_common utility functions
Copy link
Member Author

@tobim tobim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for finishing. Consider this approved from my side.

@dominiklohmann dominiklohmann merged commit e0dfd46 into master Apr 6, 2021
@dominiklohmann dominiklohmann deleted the topic/detemplate-source branch April 6, 2021 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Tasks for keeping up the infrastructure
Projects
None yet
3 participants