Main Content

La traduzione di questa pagina non è aggiornata. Fai clic qui per vedere l'ultima versione in inglese.

Framework di test delle prestazioni

Misurare le prestazioni del codice MATLAB®

È possibile utilizzare il framework di test delle prestazioni di MATLAB per misurare le prestazioni del codice MATLAB. Il framework comprende feature orientate alla misurazione delle prestazioni, come l'esecuzione del codice più volte per riscaldarlo e la considerazione del rumore nelle misurazioni.

L'interfaccia di test delle prestazioni sfrutta le interfacce di test delle unità basate su script, funzioni e classi. Pertanto, è possibile eseguire le qualifiche all'interno dei test delle prestazioni per garantire un comportamento funzionale corretto mentre si misura la prestazione del codice. Inoltre, è possibile eseguire i test sulle prestazioni come test di regressione standard per garantire che le modifiche al codice non interrompano i test sulle prestazioni.

Per iniziare, vedere Overview of Performance Testing Framework.

Funzioni

runperfRun set of tests for performance measurement
testsuiteCreate suite of tests

Classi

matlab.perftest.TimeExperimentInterface for measuring execution time of code under test
matlab.perftest.FixedTimeExperimentTimeExperiment that collects fixed number of measurements
matlab.perftest.FrequentistTimeExperimentTimeExperiment that collects variable number of measurements
matlab.perftest.TestCaseClass for writing tests with performance testing framework
matlab.perftest.TimeResultResult from running time experiment
matlab.unittest.measurement.DefaultMeasurementResultDefault implementation of MeasurementResult class
matlab.unittest.measurement.MeasurementResultBase class for classes holding measurement results
matlab.unittest.measurement.chart.ComparisonPlotVisually compare two sets of time experiment results (Da R2019b)

Argomenti

Informazioni complementari