Friday, July 30, 2010

Designing creative & scalable algorithms

New ways to looking at and solving problems.

Categorizing algorithms
•Theoretical
Big-O notation
•Practical

Disk Accesses
•disk is extremely slow
Slowest part of app is probably the disk.

Be practical
How much work does it do.

Structkeyexists fast
CreateUUID super slow
Randrange not too bad with smaller ranges

Structs typically better than arrays
Queries great for many reasons

Sorting
Handled by SQL
Trust the API, it's faster

Arraysort not too useful
Structsort very fast
Querysort very powerful, slightly slower (sort on multiple fields)


Lists are not your friend
Never use lists use arrays or structs

Query of queries super fast

Merging

SQL handles

Other objects?
Array
Query
Struct

CF9 much faster than CF8

Look into read-only locks

Look at Transfer ORM

Hibernate XML
xmlSearch use it

Don't bother transforming XML

Caching
Trades memory for speed
Try to make better algorithms before leaning on caching

Cache hot spots
Cache frequented paths
Cache most expensive things

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.