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

Add support for 32-bit systems #30

Merged
merged 1 commit into from
May 16, 2020
Merged

Add support for 32-bit systems #30

merged 1 commit into from
May 16, 2020

Conversation

kimikage
Copy link
Collaborator

@kimikage kimikage commented May 13, 2020

This fixes #28.

This also fixes the potential stack overflow of status(). However, flamegraph!() can still cause a stack overflow. So, we can also remove the change from this PR.

Profiling on 32-bit systems seems to be "somewhat" different than on 64-bit systems.

@codecov
Copy link

codecov bot commented May 13, 2020

Codecov Report

Merging #30 into master will increase coverage by 0.02%.
The diff coverage is 87.50%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #30      +/-   ##
==========================================
+ Coverage   96.53%   96.56%   +0.02%     
==========================================
  Files           5        5              
  Lines         231      233       +2     
==========================================
+ Hits          223      225       +2     
  Misses          8        8              
Impacted Files Coverage Δ
src/graph.jl 97.61% <80.00%> (+0.02%) ⬆️
src/io.jl 98.03% <100.00%> (+0.03%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fb240cd...2adf606. Read the comment docs.

@kimikage
Copy link
Collaborator Author

If JuliaLang/julia#35870 is fixed,, the tests on x86 may show the warning. However, I haven't been able to identify the reason why so many instruction pointers stored on 32-bit system.

Copy link
Owner

@timholy timholy left a comment

Choose a reason for hiding this comment

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

Thanks!

src/graph.jl Outdated
for child in values(node.down)
child.frame.from_c || continue
st |= status(child, C)
parents = [node] # use BFS (breadth first search) for simplicity
Copy link
Owner

Choose a reason for hiding this comment

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

I'd say "for simplicity" seems misleading since this is quite a few more lines of code than the original. Is the stackoverflow a problem in practice?

Copy link
Collaborator Author

@kimikage kimikage May 16, 2020

Choose a reason for hiding this comment

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

Yes, it means the simplicity compared to DFS and the original recursion is much simpler.

Is the stackoverflow a problem in practice?

Personally, the answer is no. Since flamegraphs are intended for visualization, too deep graphs are useless.
I don't know the cause, but on 32-bit systems, "TTFP" easily causes a stack overflow. For example, without Profile.init(n=10000), the test will fail.
It's no wonder that the 32-bit version is inefficient in some way and takes a longer process time, i.e. the width of the graph increases. However, it is strange that the depth increases.:confused:

As mentioned above, it would be meaningless to take measures only here, so I will revert it.

src/graph.jl Outdated
child.frame.from_c || continue
st |= status(child, C)
parents = [node] # use BFS (breadth first search) for simplicity
while !isempty(parents) || st === 0b111

This comment was marked as outdated.

@timholy timholy merged commit 47b62b6 into timholy:master May 16, 2020
@timholy
Copy link
Owner

timholy commented May 16, 2020

Thanks @kimikage!

@kimikage kimikage deleted the issue28 branch May 17, 2020 01:30
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.

Error on x86 machine
2 participants