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

Fix loading of precompiled JSON when DataStructures is not present #126

Merged
merged 2 commits into from
Sep 26, 2015

Conversation

tkelman
Copy link
Contributor

@tkelman tkelman commented Sep 25, 2015

closes #123

first commit adds a test to demonstrate failure case on travis, then second commit moves the conditional dependency on DataStructures into an __init__ function.

catch
false
function __init__()
global _HAVE_DATASTRUCTURES = try
Copy link
Member

Choose a reason for hiding this comment

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

global const?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think Jameson hates it JuliaLang/julia#12010

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't see any harm in allowing this to be modified at runtime if someone really wants to. Would there be a performance impact?

Copy link
Member

Choose a reason for hiding this comment

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

Well, globals are usually slower than constant globals because of the type instability... though maybe it doesn't matter here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

You could annotate all usages, e.g., _HAVE_DATASTRUCTURES::Bool.

Copy link
Member

Choose a reason for hiding this comment

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

Even annotating them is not nearly as efficient as a const, last I checked the generated code. You could make it a const _HAVE_DATASTRUCTURES = [false].

Again, it could be that _HAVE_DATASTRUCTURES is not used in any performance-critical situations, so maybe we shouldn't worry.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm going to merge this then, fix what's broken. Adjusting constness can be done separately if it makes a difference.

tkelman added a commit that referenced this pull request Sep 26, 2015
Fix loading of precompiled JSON when DataStructures is not present
@tkelman tkelman merged commit fe9de2d into master Sep 26, 2015
@tkelman tkelman deleted the tk/fixprecompile branch September 26, 2015 17:07
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

Successfully merging this pull request may close these issues.

tag new release?
4 participants