rchillyard / The-repository-formerly-known-as

2 stars 12 forks source link

Get timings for comparisons #29

Open rchillyard opened 4 years ago

rchillyard commented 4 years ago

In the paper, we talk about how much faster comparing two primitives is as opposed to comparing two objects. But how much faster--for the kinds of objects we want to sort?

I'd like to see a benchmark designed with just this in mind.

darshan-dedhia commented 4 years ago

Will write the benchmark for:

  1. int vs Integer (That has autoboxing and unboxing overhead) {Comparison Type: Primitive vs their object} This case covers primitive vs their object comparison.
  2. int vs SSN of Person object (which is int) {Comparison Type: Primitive vs Primitive field in an object} This case will cover comparisons benchmark of primitive vs primitive field in objects. Does this approach seem appropriate?
rchillyard commented 4 years ago

Actually, it turns out I already did this. I forgot I'd mentioned this here. But I'd be happy to get a second opinion.

EDIT: I should have mentioned that I did it in INFO6205_Solutions.

rchillyard commented 4 years ago

This issue is still open. However, it's of low importance because, of course, we use quicksort for primitives. It doesn't really matter how much faster (but I measured about a 2.5 increase in time for Integers -- using System sort).