This is the famous first post! I'm starting to blog about mostly technology related things (.NET in particular), probably with special focus on my pet project, Quartz.NET.
Javascript primitives in Jint Jint has abstraction for each primitive Javascript type. Having these fundamental types work and interact with the engine in efficient manner is crucial for good performance. In this blog post we are investigating some of them and problems I found while profiling.
The past weekend I read about an interesting pull request which is bringing a new type of dictionary with great interest. The idea of creating a new, simpler and enhanced version , now called DictionarySlim, original spun from the famous k-nucleotide benchmark where .NET had some trouble performing well with the built-in Dictionary . What is this new member in *Slim family?
So you want your code go fast? Just remove all occurrences of using System.Linq; and make the code compile again without it and be done with! In all seriousness, LINQ is a powerful tool, but it also has it's pitfalls. It really makes a difference if you use LINQ in the wrong places, one being the hot paths of a Javascript interpreter. Next I'm going to show examples of better performing code - it's neither prettier nor more idiomatic than the LINQ counterpart. So be warned. You should again weigh your use case and whether anything here is really needed. Jint optimization: usage of LINQ in Jint Jint used LINQ in some places and made the code quite easy to read. Jint being an interpreter, it made things unnecessarily slow however. When scripts are run there can be millions of iterations in loops, choosing the correct way of looping and collecting data can make a big difference. Removing LINQ is quite the easy optimization for libraries that have hot paths and ...
Comments
Post a Comment