Slides

  1. Perl literacy course
  2. Some words and definitions about sorting
  3. Why sort?
  4. Using Perl's sort
  5. Ascending lexicographical sorting
  6. Comparison operators
  7. $a and $b
  8. Case matters
  9. Case matters (cont.)
  10. Case matters -- example
  11. Lexicographical sort -- ASCII
  12. Descending
  13. Descending (cont.)
  14. Numerical sort
  15. How to sort a hash?
  16. Multi-subkey sorts -- sorting by several criteria
  17. Template for multi-subkey sort
  18. Using a subroutine
  19. Limitations due to stability
  20. Sortkeys
  21. Sortkeys (cont.)
  22. Sortkeys (cont.)
  23. Example for sortkey extraction
  24. Where can we optimize?
  25. Sorting a list of IP addresses
  26. Naive multi-subkey record sorts
  27. Computing a single packed-string sortkey
  28. Computing a single packed-string sortkey (cont.)
  29. Still inefficient
  30. Caching the sortkeys -- using a hash
  31. Caching the sortkeys -- using a hash (cont.)
  32. Caching the sortkeys -- using a hash (cont.)
  33. Caching the sortkeys -- in multi-key comparison
  34. Caching the sortkeys -- using multi-level cache
  35. A note about cached sorts
  36. The Orcish Maneuver (or-cache)
  37. The Orcish Maneuver -- example
  38. The Orcish Maneuver -- two-subkey comparison using two caches
  39. Efficiency flaws in the Orcish Maneuver
  40. The Schwartzian Transform
  41. The Schwartzian Transform (cont.)
  42. The Schwartzian Transform -- multi-subkey sort
  43. More about the Schwartzian Transform
  44. Something in-common to techniques we saw
  45. Can we do better?
  46. Packed Default -- the mechanics
  47. Packed Default -- example
  48. Packed Default -- key extraction samples
  49. Packed Default -- conclusion
  50. Sort in Perl 5.8
  51. Sort in Perl 5.8 -- MergeSort instead of QuickSort
  52. Sort in Perl 5.8 -- MergeSort instead of QuickSort (cont.)
  53. Bibliography
  54. Thank you