ScratchData LogoScratchData
Back to imfh's profile

SPD: Dictionary Keys

IMimfh•Created January 13, 2019
SPD: Dictionary Keys
8
4
144 views
View on Scratch

Instructions

When you click the flag, two sets of 100,000 random keys (with duplicates) will be generated. Clicking on each broadcast will compare the time it takes to use either a list or costumes to turn all 100,000 dictionary keys into a list number. The first two only have 9 possible keys. The second two have 64 possible keys. All of them test 100,000 randomly generated keys.

Description

This is a speed test comparing different methods of accessing dictionary values. Dictionaries are like lists that use text instead of numbers to access items. They are useful for things such as a PTE engine's font. The test results seem to show that using costumes is faster than using lists when there are a large number of keys. The time varies somewhat, so the one to use could depend on the situation.

Project Details

Project ID279267353
CreatedJanuary 13, 2019
Last ModifiedSeptember 22, 2023
SharedJanuary 18, 2019
Visibilityvisible
CommentsAllowed