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

Tests and benches #43

Merged
merged 5 commits into from
Feb 16, 2021

Conversation

QuantumEntangledAndy
Copy link
Contributor

This should get all the tests and benches working for the recent changes.

I have gone and used the resolver=2 feature resolver so that amethyst/metal or vulkan dependencies auto enable based on the os. This is a new feature that has only recently been stabalised so may need to use the latest rust. Rust stablise PR is here

@norman784
Copy link
Owner

Thanks for the fixes.

I have one change that like to ask you, because you splitted the benches from single entry point to individual ones, maybe should remove the benchmarks module and move the code to each entry point.

@QuantumEntangledAndy
Copy link
Contributor Author

Sure I was debating that with myself but thought I'd try to keep the diff to a minimal

@QuantumEntangledAndy
Copy link
Contributor Author

QuantumEntangledAndy commented Feb 16, 2021

I have made the change and I am running the benches now to make sure I didn't break anything

@QuantumEntangledAndy
Copy link
Contributor Author

Ok Done!

@QuantumEntangledAndy
Copy link
Contributor Author

QuantumEntangledAndy commented Feb 16, 2021

By the way the whole reason I did this was because I wanted to test the benches.

I had a chunk where depth, width and height were expensive functions calls and the voxel baker was calling them often as you can see here:

    let x_limit = chunk.width() as usize - 1;
    let y_limit = chunk.height() as usize - 1;
    let z_limit = chunk.depth() as usize - 1;

    for x in 0..chunk.width() as usize {
      for y in 0..chunk.height() as usize {
        for z in 0..chunk.depth() as usize {

For large chunks (600 voxels per dimension) the functions depth width and height will get called millions of times and I wanted to see if this can be improved by caching the value. That meant using the benches

@norman784 norman784 merged commit 2f77b44 into norman784:master Feb 16, 2021
@QuantumEntangledAndy
Copy link
Contributor Author

I am going to add another bench mark using a chunk with a 3d checkerboard:

0 1 0 1 0
1 0 1 0 1
0 1 0 1 0

This should resemble a chunk that requires maximum work to bake as their are 6 unique edges per vertex.

@QuantumEntangledAndy QuantumEntangledAndy deleted the tests_and_benches branch July 5, 2021 14:03
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.

2 participants