aboutsummaryrefslogtreecommitdiff
path: root/src/lux/optimizer.clj
blob: be6df920fe3393611523e4631307f452cbfb8669 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
(ns lux.optimizer
  (:require [lux.analyser :as &analyser]))

;; [List of pending optimizations]
;; Global functions: direct currying or direct invocation when function is known at compile-time
;; Improving function calls: add extra arities (apply2, apply3, ..., apply16)
;; Recursion: tail-call optimization
;; Pattern-matching: decision-trees to avoid unnecessary tests
;; Less classes generated per function: Fold nested function classes into one.
;; Mutability for performance: do escape analysis to know when data-structures can be mutated in-place without anybody noticing.
;; Avoid (un)boxing: Analyser movement of primitive values to/from functions to known when (un)boxing can be avoided.
;; Pre-compute constant expressions: Find function calls for which all arguments are known at compile-time and pre-calculate everything prior to compilation.

;; [Exports]
(def optimize &analyser/analyse)