TeamEEDev / EECloud.PlayerIO

EECloud.PlayerIO is an unofficial open-sourced version of the Player.IO client DLL written in C#.
5 stars 3 forks source link

Just a quick little optimization #13

Closed Jojatekok closed 11 years ago

Yonom commented 11 years ago

could you please explain why this is "better"?

kevin-brown commented 11 years ago

Any benefit that this could have had (creating separate methods for each type) was lost when you moved/added the type checking to Add(object[]).

Yonom commented 11 years ago

It is impossible to send any other type over the protocol. The benefit of the current method is that you don't have to do all the type checking if you have an unknown type. I wouldn't want to add 8 methods that do the same thing to my library. (I have had this issue in one of my libraries) It will lose the capability of compile time check trough. Closing, if you have a better idea feel free to reopen.

Jojatekok commented 11 years ago

It's better like this in performance, as C# - if ikr - compiles all the overloads of Add() as "separate" methods in the IL code; so it should take less time for the DLL to process. I don't see any "non-benefits", but let me retry in my next pull request. ;)

Yonom commented 11 years ago

Add all the overloads without removing the current add method

Jojatekok commented 11 years ago

LOL you read my mind :'(

Jojatekok commented 11 years ago

There you go ;p

Yonom commented 11 years ago

Awesome, now we save a few nanoseconds

Jojatekok commented 11 years ago

Every nanosec counts ;)