comparison src/monoize.sml @ 2213:365727ff68f4

Complete overhaul: cache queries based on immediate query result, not eventual HTML output.
author Ziv Scully <ziv@mit.edu>
date Tue, 14 Oct 2014 18:05:09 -0400
parents 7c2229aa22fc
children 794017f378de
comparison
equal deleted inserted replaced
2212:388ba4dc7c96 2213:365727ff68f4
1955 val ft = (L'.TFun ((L'.TRecord rt, loc), 1955 val ft = (L'.TFun ((L'.TRecord rt, loc),
1956 (L'.TFun (state, 1956 (L'.TFun (state,
1957 (L'.TFun (un, state), loc)), 1957 (L'.TFun (un, state), loc)),
1958 loc)), loc) 1958 loc)), loc)
1959 1959
1960 val body' = (L'.EApp ( 1960 val body'' = (L'.EApp (
1961 (L'.EApp ( 1961 (L'.EApp (
1962 (L'.EApp ((L'.ERel 4, loc), 1962 (L'.EApp ((L'.ERel 4, loc),
1963 (L'.ERel 1, loc)), loc), 1963 (L'.ERel 1, loc)), loc),
1964 (L'.ERel 0, loc)), loc), 1964 (L'.ERel 0, loc)), loc),
1965 (L'.ERecord [], loc)), loc) 1965 (L'.ERecord [], loc)), loc)
1966 1966 val body' = (L'.EQuery {exps = exps,
1967 val body = (L'.EQuery {exps = exps, 1967 tables = tables,
1968 tables = tables, 1968 state = state,
1969 state = state, 1969 query = (L'.ERel 3, loc),
1970 query = (L'.ERel 3, loc), 1970 body = body'',
1971 body = body', 1971 initial = (L'.ERel 1, loc)},
1972 initial = (L'.ERel 1, loc)}, 1972 loc)
1973 loc) 1973 val (body, fm) = if Settings.getSqlcache () then
1974 let
1975 val (urlifiedRel0, fm) = urlifyExp env fm ((L'.ERel 0, loc), state)
1976 in
1977 (Sqlcache.instrumentQuery (body', urlifiedRel0), fm)
1978 end
1979 else (body', fm)
1974 in 1980 in
1975 ((L'.EAbs ("q", s, (L'.TFun (ft, (L'.TFun (state, (L'.TFun (un, state), loc)), loc)), loc), 1981 ((L'.EAbs ("q", s, (L'.TFun (ft, (L'.TFun (state, (L'.TFun (un, state), loc)), loc)), loc),
1976 (L'.EAbs ("f", ft, (L'.TFun (state, (L'.TFun (un, state), loc)), loc), 1982 (L'.EAbs ("f", ft, (L'.TFun (state, (L'.TFun (un, state), loc)), loc),
1977 (L'.EAbs ("i", state, (L'.TFun (un, state), loc), 1983 (L'.EAbs ("i", state, (L'.TFun (un, state), loc),
1978 (L'.EAbs ("_", un, state, 1984 (L'.EAbs ("_", un, state,