liveBook · Manning

Performance optimization

As explained in AI for Everyday IT

Performance optimization is the practice of improving a system's execution speed, resource efficiency, or throughput.

Performance optimization improves execution speed, resource efficiency, or throughput. In practice, it means finding costly database operations or implementation choices, then requesting changes that scale better and satisfy explicit performance requirements. section 10.3 section 11.2

From slow lookups to scalable data structures

When an AI assistant used arrays for content-filtering lookups, performance concerns prompted a better question: which JavaScript structure remains efficient as data grows? The suggested change was to use Maps. State requirements such as performance, error handling, and scalability explicitly, then review the result for edge cases. section 11.2

SELECT TOP 10
    DB_NAME(ps.database_id) AS DatabaseName,
    OBJECT_NAME(ps.[object_id], ps.database_id) AS StoredProcedure,
    ps.execution_count AS ExecutionCount,
    ps.total_elapsed_time / ps.execution_count AS AvgElapsedTime,
    ps.total_worker_time / ps.execution_count AS AvgCPU,
    ps.total_logical_reads / ps.execution_count AS AvgReads
FROM sys.dm_exec_procedure_stats AS ps
ORDER BY ps.total_elapsed_time / ps.execution_count DESC;

Use this SQL Server query to rank the ten stored procedures with the highest average execution time, CPU use, and logical reads. section 10.3

How AI for Everyday IT covers it

How deep it goes
Measures average elapsed time, CPU time, and logical reads, while noting that highly variable runtimes may require different analysis.
Examples
Uses a SQL Server top-ten query and an array-to-Map lookup comparison.
What it assumes
Builds on basic software-engineering judgment while encouraging explicit requirements and review of generated code.
What you can do after
Diagnose bottlenecks with SQL Server procedure statistics and evaluate AI-generated code against performance and scalability requirements.
How it connects
Connects stored procedures with performance tuning, scalability, data structures, caching, and error handling.

Also explained in

Compare how 7 books explain performance optimization →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of AI for Everyday IT. The section links point to the parts of the book it draws on.