Sorting Performance
See original GitHub issuePicking up from #366 what do you recommend for sorting? On my end, at least with the code I wrote, sorting is way slower than the initial rendering. I tried two approaches.
Approach 1: Sorts array then refresh with $.observable(array).refresh(sorted);
Approach 2: Iterate array and move items around as we sort using $.observable(array).move(...)
Not sure if there’s any other way to sort. 🤔
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Sorting Algorithms Compared - Cprogramming.com
Sorting algorithms are usually judged by their efficiency. In this case, efficiency refers to the algorithmic efficiency as the size of the input...
Read more >Sorting Algorithms: Slowest to Fastest! | by Dhanam Parekh
Revise these sorting algorithms along with their performance analysis.
Read more >Sorting algorithm - Wikipedia
In computer science, a sorting algorithm is an algorithm that puts elements of a list into ... based on comparisons, such as counting...
Read more >Performance of Sorting Algorithms :: CC 310 Textbook
Performance of Sorting Algorithms. We introduced four sorting algorithms in this chapter: selection sort, bubble sort, merge sort, and quicksort.
Read more >Tuning sort performance - IBM
Techniques for managing sort performance · Determine which database in the instance has the largest sortheap value. · Determine the average size of...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I plan to provide for async deferred data-linking after V1. See https://github.com/BorisMoore/jsviews/issues/368.
With the new update I am working on (84) Approach 1 will no longer involve any calls to cleanData, and will simply shuffle the tr’s (and update #index properties etc.).
I just tested it in Chrome with your full data, and I get: 2.17 seconds initial render 1.54 seconds sort
(Sorting on City):
Approach 2 will work fine too, but Approach 1 in fact uses .move() internally - so for you Approach 1 is simpler.
If you are interested you can try with my current working copy here: jsviews.zip
But bear in mind it is not yet full tested, and there is some work in progress within it, in other areas. Also some breaking changes, so you may not be able to run with it without the documented changes…