All Projects → Thorium → Linq.Expression.Optimizer

Thorium / Linq.Expression.Optimizer

Licence: Unlicense license
System.Linq.Expression expressions optimizer. http://thorium.github.io/Linq.Expression.Optimizer

Programming Languages

F#
602 projects
shell
77523 projects
Batchfile
5799 projects

Projects that are alternatives of or similar to Linq.Expression.Optimizer

lambda2js
Converts a C# expression tree (from Linq namespace) to a syntatically correct javascript code.
Stars: ✭ 51 (-37.04%)
Mutual labels:  linq, expression-tree
booleval
Header-only C++17 library for evaluating logical expressions.
Stars: ✭ 54 (-33.33%)
Mutual labels:  boolean-algebra, expression-tree
Linqaf
Low allocation re-implementation of LINQ-to-Objects
Stars: ✭ 203 (+150.62%)
Mutual labels:  linq
Linq.ts
linq for typescript
Stars: ✭ 33 (-59.26%)
Mutual labels:  linq
eigen-js
⚡ Eigen-js is a port of the Eigen C++ linear algebra library
Stars: ✭ 78 (-3.7%)
Mutual labels:  optimisation
Linqpadless
LINQPad Queries without LINQPad
Stars: ✭ 218 (+169.14%)
Mutual labels:  linq
Masuit.Tools
该仓库为 https://github.com/ldqk/Masuit.Tools 的镜像仓库,代码更新存在较大的延迟。建议前往源仓库:https://github.com/ldqk/Masuit.Tools
Stars: ✭ 755 (+832.1%)
Mutual labels:  linq
Mvc.jquery.datatables
ASP MVC Helpers for connecting IQueryables with the amazing DataTables.net plugin
Stars: ✭ 179 (+120.99%)
Mutual labels:  linq
python-linq-samples
Python Linq Examples: Comparision of C# Linq functional programming to Python
Stars: ✭ 69 (-14.81%)
Mutual labels:  linq
Typescript.net
A JavaScript-Friendly .NET Based TypeScript Library (Moved)
Stars: ✭ 245 (+202.47%)
Mutual labels:  linq
mathcore
Advanced .NET math library (.NET Standard).
Stars: ✭ 24 (-70.37%)
Mutual labels:  expression-tree
Morelinq
Extensions to LINQ to Objects
Stars: ✭ 2,833 (+3397.53%)
Mutual labels:  linq
Go Linq
.NET LINQ capabilities in Go
Stars: ✭ 2,791 (+3345.68%)
Mutual labels:  linq
nim-mathexpr
Tiny math expression evaluator library implemented in pure Nim
Stars: ✭ 58 (-28.4%)
Mutual labels:  mathematical-expressions
Mongodb.entities
A data access library for MongoDB with an elegant api, LINQ support and built-in entity relationship management
Stars: ✭ 204 (+151.85%)
Mutual labels:  linq
LinqBuilder
LinqBuilder is an advanced implementation of the specification pattern specifically targeting LINQ query generation.
Stars: ✭ 34 (-58.02%)
Mutual labels:  linq
Extralinq
Useful extension methods for .NET sequence and collection types.
Stars: ✭ 202 (+149.38%)
Mutual labels:  linq
Dapper.lnskydb
基于Dapper的LINQ扩展,支持Lambda表达式,支持按时间分库分表,也可以自定义分库分表方法,且实体类有T4模版自动生成.省去手写实体类的麻烦。已在实际项目使用
Stars: ✭ 228 (+181.48%)
Mutual labels:  linq
PocoDynamo
C# .NET Typed POCO Client for AWS Dynamo DB
Stars: ✭ 39 (-51.85%)
Mutual labels:  linq
react-native-math-view
Math view for react native! No WebView!
Stars: ✭ 49 (-39.51%)
Mutual labels:  mathematical-expressions

Issue Stats Issue Stats

Linq.Expression.Optimizer

Lightweight optimizer of System.Linq.Expression expressions. Just basic boolean algebra and reductions, constant and tuple/anonymous type eliminations. For side-effect free Expressions. No compilation-subjective optimizations. This is meant to be used with expressions that are not compiled but transferred to other domain.

Supported frameworks: Net 3.5, Net 4.5-... (and Mono), .NET Standard 1.6 (so also .NET Core)

Supported optimizations

Example as a quote. There are various other cases also.

  • Replace constants comparisons: 3 < 4 -> true
  • Remove anonymous types: new AnonymousObject(Item1 = x, Item2 = "").Item1 --> x
  • Cut not used condition: if false then x else y -> y
  • Remove not: not(false) -> true
  • Binary tree balancing: a or (b or (c or (d or (e or (f or (g or h)))))) -> ((a or b) or (c or d)) or ((e or f) or (g or h))
  • Captured closure constant ("free variable") evaluation: y = 3 and (y + x) -> (3 + x)
  • Execute simple math: 5 * 3 -> 15
  • Boolean algebra reductions:
    • gather (x or y) and (x or z) -> x or (y and z)
    • identity false or y -> y
    • annihilate true or x -> true
    • absorb x and (x or y) -> x
    • idempotence y or y -> y
    • complement x and not(x) -> false
    • doubleNegation not(not(y)) -> y
    • deMorgan not(x) and not(y) -> not(x or y)

Background

This is a side-track from SQLProvider, excelent tool that is kind of OR-mapper with auto-generated objects, so it compiles any databases to .NET-language, and works fast on design time in Visual Studio or other editors.

But I needed better SQL-queries. So this optimses .NET LINQ-expressions. These expressions were not ment to be compiled so Nessos LinqOptimizer was not the right tool. I thought that .NET would optimize these automatically, but no.

Read the Getting started tutorial to learn more.

Documentation: http://thorium.github.io/Linq.Expression.Optimizer

Maintainer(s)

If you want more optimizations, please feel free to send PRs!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].