Skip to content

shtikeln/OptimizeMePlease

 
 

Repository files navigation

My Result

Method Mean Error Ratio Gen0 Gen1 Gen2 Allocated
GetAuthors 1,453.556 ms 28.6683 ms baseline 29000.0000 10000.0000 3000.0000 182798.23 KB
GetAuthors_Optimized 9.796 ms 0.1915 ms 148.759x faster - - - 78.12 KB

OptimizeMePlease

You are probably here because you saw my post on Linkedin.

Welcome!

Steps

  • Before you run an application, you will need to create a database (I'm using MSSQL) named "OptimizeMePlease"
  • Go to Program.cs class
  • "IWillPopulateDate()" is a method which will get a script from the project directory and run in on created DB
  • Run application in Debug/Release mode
  • Comment or delete IWillPopulateData() call from Main method
  • Go to BenchmarkService.cs class
  • Start coding within GetAuthors_Optimized method

How do I submit my solution?

  • Send me a Linkedin message with your github username, I will add you and create a branch for you.

OR

  • Clone the project, create a branch and work on that branch.

OR

  • If you don't want to bother with github, after you're done with the changes, send me the results on Linkedin.

Rules

  • Only Entity Framework (Core) is allowed for using
  • The data obtained in the non-optimized version of the code must also be obtained in the optimized version
  • If you see potential optimization of something else, you can do it
  • Entities and DbContext cannot be changed (you got legacy code no matter what it might be bad :) )
  • The models returned from the method can be changed

What should the method return?

  • Given that there is a predefined database of data, the method should in any case return the list of data currently returned by the non-optimized method.

How will performance success be measured?

  • Given that each of us works on a computer with different performance and power, the execution time quotient of the non-optimized and optimized method will be checked for each separately.

Example:

Non-optimized method Execution time: 1.1s = 1100ms Optimized method Execution time: 200ms

Result: 1100ms/200ms = 5.5x faster.

In addition, I will check the performance on my computer for individual results.

GOOD LUCK!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%