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

Create an appropriate data structure for subs and dirs result #30

Closed
edoardottt opened this issue Apr 5, 2021 · 1 comment
Closed

Comments

@edoardottt
Copy link
Owner

Whenever scilla produces new results (dirs or subs) and it wants to print them, it looks into all the array of Assets to search if the Printed value is set to false.
So, to speed up the performance we can do two things:
Create a new data structure with two fields:

type Result struct {
assets    []Asset,
?
}

The second field can be a boolean, and this means that it can be changed to true (or false, it depends) when you have to print somethings, or a couple of integers telling us the printed values and the total value. In this second case we don't need the Printed item in Asset....

Another thing we can do to speed up performance is to print the results in reverse order, starting from the last found and going up to the first, when we encounter a Printed == true, it means we don't have more values to print.

@edoardottt
Copy link
Owner Author

  1. Tried to speed up performance with the Result struct (due to modified field) but it doesn't seem there is a good advantage in doing this.

  2. It's impossible to loops reverse through the results since it's a hashmap ( 🥇 )

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

No branches or pull requests

1 participant