You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
examples_to_run=[]changed_files.eachdo |file| # nexamples.eachdo |ex| # n * nexamples_to_run << exifex.related_files.include?(file)# n * n * nendend
Invert the way data is stored
examples_to_run=changed_files.flat_map(&:related_examples)# O(n)# For a single file (as in the file that was just# saved when using --watch)examples_to_run=changed_file.related_examples# O(1)
Pros:
Faster lookup
Cons:
Uses more memory
Have larger dump files
Significant effort to perform this inversion
Backwards incompatibility
The text was updated successfully, but these errors were encountered:
The way lookup works now:
Invert the way data is stored
Pros:
Cons:
The text was updated successfully, but these errors were encountered: