Re: CW#6 -- Timing

30 views
Skip to first unread message

Akif Eyler

unread,
Nov 14, 2018, 4:26:00 AM11/14/18
to BLM
CW6 -- Timing

* Open this page and click on the buttons several times
https://maeyler.github.io/BLM305/exam/Timing.html
This shows clearly that the first method is about x40 faster

* Using that page and the same data, do a timing study for Array vs Map
1. read all Student id's into Array a using fetch().then()

2. make a Map from id into Student
 map.set(std.id, std)

3. search 10.000 Student id's in both data separately
  Start with a 9-digit number such as 215170000 <-- select randomly
  Use an indexed for loop with 10.000 numbers
  Test:  a.includes(id)  and  map.has(id)

4. report the total number found and timing results (in msec)
  The total number must be the same for both data

* Put your work in your repo and add a link to it on the home page

* Send me a screen shot


Reply all
Reply to author
Forward
0 new messages