Beware of implicit boxing of value types

In the last post, we looked at some inef­fi­cien­cies with ref­er­ence types in .Net and per­haps over­sold val­ue types a lit­tle  In any case, now that we’ve made the ini­tial sale and you’re back for more, let’s talk about some pit­falls wrt the use of val­ue types you should be aware of. Specif­i­cal­ly let’s focus on cas­es …

Beware of implic­it box­ing of val­ue typesRead More »

Smallest .Net ref type is 12 bytes (or why you should consider using value types)

(Update 2015/07/21 : read the next post in this series to learn about the places where implic­it box­ing hap­pens with val­ue types and how you can pre­vent them)   I chanced upon Sasha Goldshtein’s excel­lent book, Pro .Net Per­for­mance : Opti­mize Your C# Appli­ca­tion, a few years back and I thor­ough­ly enjoyed it. Even though …

Small­est .Net ref type is 12 bytes (or why you should con­sid­er using val­ue types)Read More »

Design for Latency issues

The most com­mon issue I have encoun­tered in pro­duc­tion are latency/performance relat­ed. They can be symp­toms of a whole host of under­ly­ing caus­es rang­ing from AWS net­work issues (which can also man­i­fest itself in laten­­cy/er­ror-rate spikes in any of the AWS ser­vices), over-loaded servers to sim­ple GC paus­es. Laten­cy issues are inevitable – as much …

Design for Laten­cy issuesRead More »

Seven ineffective coding habits many F# programmers don’t have

This post is part of the F# Advent Cal­en­dar in Eng­lish 2014 project. Check out all the oth­er great posts there! Spe­cial thanks to Sergey Tihon for orga­niz­ing this. A good cod­ing habit is an incred­i­bly pow­er­ful tool, it allows us to make good deci­sions with min­i­mal cog­ni­tive effort and can be the dif­fer­ence between …

Sev­en inef­fec­tive cod­ing habits many F# pro­gram­mers don’t haveRead More »

Project Euler – Problem 68 Solution

Prob­lem Con­sid­er the fol­low­ing “mag­ic” 3-gon ring, filled with the num­bers 1 to 6, and each line adding to nine. Work­ing clock­wise, and start­ing from the group of three with the numer­i­cal­ly low­est exter­nal node (4,3,2 in this exam­ple), each solu­tion can be described unique­ly. For exam­ple, the above solu­tion can be described by the …

Project Euler – Prob­lem 68 Solu­tionRead More »

Project Euler – Problem 64 Solution

Prob­lem All square roots are peri­od­ic when writ­ten as con­tin­ued frac­tions and can be writ­ten in the form: For exam­ple, let us con­sid­er ?23: If we con­tin­ue we would get the fol­low­ing expan­sion: The process can be sum­marised as fol­lows: It can be seen that the sequence is repeat­ing. For con­cise­ness, we use the nota­tion …

Project Euler – Prob­lem 64 Solu­tionRead More »

Project Euler – Problem 80 Solution

Prob­lem It is well known that if the square root of a nat­ur­al num­ber is not an inte­ger, then it is irra­tional. The dec­i­mal expan­sion of such square roots is infi­nite with­out any repeat­ing pat­tern at all. The square root of two is 1.41421356237309504880…, and the dig­i­tal sum of the first one hun­dred dec­i­mal dig­its …

Project Euler – Prob­lem 80 Solu­tionRead More »

Project Euler – Problem 61 Solution

Prob­lem Tri­an­gle, square, pen­tag­o­nal, hexag­o­nal, hep­tag­o­nal, and octag­o­nal num­bers are all fig­u­rate (polyg­o­nal) num­bers and are gen­er­at­ed by the fol­low­ing for­mu­lae: The ordered set of three 4-dig­it num­bers: 8128, 2882, 8281, has three inter­est­ing prop­er­ties. The set is cyclic, in that the last two dig­its of each num­ber is the first two dig­its of the …

Project Euler – Prob­lem 61 Solu­tionRead More »

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.