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

file caching and dependency listings #22

Open
freylax opened this issue Jan 15, 2020 · 3 comments
Open

file caching and dependency listings #22

freylax opened this issue Jan 15, 2020 · 3 comments

Comments

@freylax
Copy link

freylax commented Jan 15, 2020

Thank you very much for this nice tool. I use it for purescript-native cpp code generation:
PureScript Shared Objects
It is essential in the sence that the ffi implementations are not complete and zephyr allowes me to generate only the code which is just needed and does not pull in references of unimplemented functions. One issue i stumbled across is that zephyr creates new files for each run, regardless if the contents has changed or not. This will trigger all depending compilations which should not necessary at all. I worked around this by comparing the file sizes with the previous run, if they match then the new file gets the timestamp of the older file. (zephyr.bash in the mentioned repo)
The second issue is that I would like to get the dependencies for groups of entry points. I use this for automatic assembling of the libraries and applications. I worked around this by calling zephyr for each group for different output directories. This should be possible in one run too.
If this makes sense for you I would like to hear from you. I could try to implement this if you give me some guidance. Thanks a lot!

@coot
Copy link
Collaborator

coot commented Jan 22, 2020

Caching

This is not easy, as zephyr is doing global analysis across module boundaries. This means that even if a file hasn't changed, something else now can require something from the module. But we could cache the internal graph for that module. That could give a quite good performance improvement, but it's worth to profile zephyr to see how much that would help or if there are other possible improvements.

Group dependencies

You already can give multiple entry points. Is this what you're looking for?

@freylax
Copy link
Author

freylax commented Jan 23, 2020

I suspected that this is a challenge. Yes I use multiple entry points but what I have to know is which sub group of entry points has which dependencies (list of modules). Right now I run zephyr multiple times with different entry point groups was is stupid from the performace point of view.
This bash script does
what I need for two given groups of entry points, It makes 3 zephyr runs, one with all given entry points, this corefn output will be used further. The other two runs with the one and second group as argument go to different output directories and there I use just the names of the directories (module names). So a file for each group containing the list of modules would be sufficient.
Thank you for your time :)

@coot
Copy link
Collaborator

coot commented Feb 16, 2020

majority of time zephyr spends on reading and parsing data, doing it once would be indeed more efficient.

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

No branches or pull requests

2 participants