Remove c
article thumbnail

Faster remainders when the divisor is a constant: beating compilers and libdivide

Daniel Lemire

I believe that all optimizing C/C++ compilers know how to pull this trick and it is generally beneficial irrespective of the processor’s architecture. In concrete terms, here is the C code to compute the remainder of the division by some fixed divisor d : uint32_t d =. ; // your divisor > 0. Can we do better?

C++ 279
article thumbnail

Fundamentals of table expressions, Part 5 – CTEs, logical considerations

SQL Performance

T-SQL supports it starting with SQL Server 2005. For example, you can use a query that is based on derived tables as the inner query of a CTE definition, as in the following example: WITH C AS. ( ) SELECT orderyear , numcusts FROM C ; However, the same does not hold true for a query that is based on CTEs. CROSS JOIN. (

C++ 140
Insiders

Sign Up for our Newsletter

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

article thumbnail

Overlooked T-SQL Gems

SQL Performance

Using a cursor, you would normally use code similar to the following: DECLARE @dbname AS sysname ; DECLARE C CURSOR FORWARD_ONLY STATIC READ_ONLY FOR. databases ; OPEN C ; FETCH NEXT FROM C INTO @dbname ; WHILE @@FETCH_STATUS = 0. databases ; OPEN @C ; FETCH NEXT FROM @C INTO @dbname ; WHILE @@FETCH_STATUS = 0.

C++ 111
article thumbnail

Back-to-Basics Weekend Reading - A Decomposition Storage Model

All Things Distributed

The first practical modern implementation is probably C-Store by Stonebraker, et al. Combined with the rise of data warehouse workloads, where there is often significant redundancy in the values stored in columns, and database models based on column oriented storage took off.

Storage 72
article thumbnail

Additional T-SQL Improvements in SQL Server 2022

SQL Performance

75 Test XYZ Student C 55 Test XYZ 77.5 75 Test XYZ Student C 55 Test XYZ 77.5 If you’re using T-SQL to compute percentiles as part of your work, these functions should be familiar to you since they’ve been supported in SQL Server 2005 and later. 75 Test XYZ Student D 55 Test XYZ 77.5 75 Test XYZ Student H 65 Test XYZ 77.5

Servers 142
article thumbnail

Web Performance Bookshelf

Rigor

Steve Souders, plus Dion Almaer, Doug Crockford, Ben Galbraith, Tony Gentilcore, Dylan Schiemann, Stoyan Stefanov, Nicole Sullivan, Nicholas C. You only have a few seconds to get compelling content onto the screen. Fail, and you can kiss your customers and profits goodbye.” ” – Andy King, 2003. Even Faster Websites.

article thumbnail

Advent Calendars For Web Designers And Developers (December 2021 Edition)

Smashing Magazine

C# Advent Calendar. It’s time for the fifth annual C# advent calendar that will feature two pieces of content every day. Anyone can contribute by sharing their blog posts, videos, articles or podcast episodes dedicated to C# development. It launched in 2005 and still has all of the calendars available online.

Design 110