Skip to content
This repository has been archived by the owner on Nov 20, 2019. It is now read-only.
/ dart_benchmarks Public archive

Benchmarks of different code snippets written in Dart

License

Notifications You must be signed in to change notification settings

gyrdym/dart_benchmarks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dart benchmarks

This library contains some code snippets and their benchmarks. You may use the lib as a guide for writing efficient code for Dart Virtual Machine. Some of these benchmarks may be quite obvious, but, someone may find it useful.

Key insights:

Iterable benchmarks

For all the iterables a collection of 10000 double elements has been used as a source

  • List#indexOf - It took the same time to find the index of a value for both growable and fixed version of List
  • Set#contains - It took much less time to find if the value exists than indexOf of List. But, conversion to Set takes much time, so there is no use to convert your list to a set just to make a single check
  • List#forEach - It took the same time to iterate through the both fixed and growable list
  • for..in loop - It took a little more time than List#forEach to iterate through the collection

Releases

No releases published

Packages

No packages published

Languages