Relative Content

Tag Archive for optimization

Is Google’s Page Speed not working fine?

I’ve been making small improvements to a public ASP.NET site that I have and have ran it through Google’s online Page Speed several times. I have a specific problem, but something that really threw me off was that even if I didn’t make any changes and just kept running it time after time (5 minutes intervals) I’d keep getting different scores by +-1 or 2 points. That is just weird in itself. Anyways,

Allocation problem identification

I have a matrix. I have a list of people who have to occupy n1,n2,n3 etc cells, different number of cells in different rows. I have to place the people in the cells. Occupying the same cell across rows is considered overlap. Overlap has to be minimized.

Registration: Email hash and verifying only one account per email

I’m using a registration function that hashes the email in PBKDF2 with a random and unique Salt each time. The hashes email and his salt are saved in the DB. No problem with that.
The problem is that now I want to make sure that users only create one single account per email. Obviously to verify that I need to check my DB and that’s where the problem starts. I either lose in security or in time.

When should code favour optimization over readability and ease-of-use?

I am in the process of designing a small library, where one of my design goals is that the API should be as close to the domain language as possible. While working on the design, I’ve noticed that there are some cases in the code where a more intuitive, readable attribute/method call requires some functionally unnecessary encapsulation. Since the final product will not necessarily require high performance, I am unconcerned about making the decision to favour ease-of-use in my current project over the most efficient implementation of the code in question.