New and updated pages

HTML 5

Added a link to WTF is HTML5 (infographic).

Recommended books and sites

Added Basics of Compiler Design by Torben Mogensen.

Benchmarking CRC32 and PopCnt instructions

Added SSSE3 implementation (thanks to Wojciech Muła!)

Hash functions: An empirical comparison

Added hardware-accelerated CRC32 function (tested on Core i5 processor).

JavaScript as the Next Big Language

jQuery is now supported on the server side.

Recent comments

ace:

Your test are very insightful, thanks Alexander.

Alexander:

See some hash tests here (Russian): http://amsoftware.narod.ru/algo.html

ace:

IMHO...

Peter Kankowski:

Your thread may be scheduled to different cores...

Stein0r:

you really should implement a possibility to edit comments... i wanted to add: are my assumptions correct? :-)

Welcome to strchr.com

Welcome to strchr.com, a web site about algorithms, code optimization, assembly and C programming. Feel free to browse the articles and post your comments.

New: Try out free in-browser calculator.

Calculator interface

General

Discussion: the first language *

Which programming language to learn first?

Recommended books and sites *

The minimal reading list to become a good programmer.

JavaScript as the Next Big Language

Predictions and reality.

HTML 5

New features and showcase examples.

strchr.com calculator

Instant calculator in JavaScript.

Algorithms

Hash functions: An empirical comparison *

Benchmark program for hash tables and comparison of 15 popular hash functions.

Plural forms

Spelling messages like "1 file found" or "5 files found" correctly in any language.

Two-stage tables for storing Unicode character properties

A data structure for storing the properties of Unicode characters.

Using ternary DAGs for spelling correction

A ternary structure for storing dictionaries is proposed. The structure is based on ternary search trie that is "compressed" into a DAG by linking together equal subtrees. By using it, you can eliminate affix stripping and implement a faster spelling corrector.

Searching for duplicate files

Designing an effective algorithm for finding identical files.

Assembly language and machine code

Win32 Assembly Cheat Sheet

One-page reference for Win32 assembly language programming.

x86 Machine Code Statistics *

Which instructions and addressing modes are used most often. What is the average instruction length.

Redundancy of x86 Machine Code

One assembly language instruction can be encoded differently in machine code. Possible applications are steganography and compiler identification.

Interfaces

PHP database library

Designing a database interface for web programming.

Metaprogramming with aggressive inlining

Inlined and optimized functions can be used as macros.

Software interface design tips *

How to design easy-to-use interfaces between modules of your program.

Interpreters and compilers

Introduction: Writing a simple expression evaluator

Code generator

Reverse Polish Notation and Expression Compiler

Adding variables to expression evaluator

Win32 programming

Self-extracting executables

Techniques for creating SFX archives and interpreters.

Enabling additional compiler warnings

How to catch more bugs with MSVC++.

Detecting access to freed memory

Improving MSVC++ free function.

Debugging buffer overflows

A technique for debugging complex parsers.

Corrections to Raymond Chen's wheel scrolling code

For one rotation of the wheel, never scroll the window by more than one page.

Dark corners in Microsoft's documentation

Hexadecimal locale IDs, saving user data on shutdown, and other bugs.

The perils of alloca function

alloca is useful for small arrays or strings, but can be dangerous if the array is larger than you expected.

Low-level code optimization

What your compiler can do for you

You should not obfuscate you code with low-level optimizations: your compiler can do them for you.

Performance measurements with RDTSC

A method for measuring performance with RDTSC instruction.

Optimized abs function

Branchless abs function for x86 processors.

Calculating standard deviation in one pass

An example of using algebraic transformations for code optimization.

Fast strlen function

Unrolling the loop in strlen function.

Using sentinel for string manipulation

A method for optimizing search functions.

Checking if the point belongs to an interval

How to replace two comparisons with one.

Implementing strcmp, strlen, and strstr using SSE 4.2 instructions *

Using new Intel Core i7 instructions to speed up string manipulation.

SSE2 optimised strlen

Optimising strlen function using SSE2 SIMD instructions.

Table-driven approach *

How to make you code shorter and easier to maintain by using arrays.

Benchmarking CRC32 and PopCnt instructions

Exploring new instructions in Core i7/i5.