Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Cloogle
cloogle.org
Commits
5835547a
Verified
Commit
5835547a
authored
Jun 27, 2017
by
Camil Staps
🐟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Several performance improvements
parent
84ab357a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
9 deletions
+27
-9
backend/Cloogle
backend/Cloogle
+1
-1
backend/CloogleServer.icl
backend/CloogleServer.icl
+9
-0
backend/builddb.icl
backend/builddb.icl
+17
-8
No files found.
Cloogle
@
c1ccaba3
Compare
1bf618f0
...
c1ccaba3
Subproject commit
1bf618f0f25f38d1a70be983c9cec2bc9b3bbcdc
Subproject commit
c1ccaba33a375818daea03744dbcb7fc10400f3f
backend/CloogleServer.icl
View file @
5835547a
...
...
@@ -75,6 +75,7 @@ Start w
#
w
=
disableSwap
w
#!
(_,
f
,
w
)
=
fopen
"types.json"
FReadText
w
#!
(
db
,
f
)
=
openDb
f
#!
db
=
eval_all_nodes
db
#!
(_,
w
)
=
fclose
f
w
=
serve
(
handle
db
)
(
Just
log
)
(
toInt
port
)
w
where
...
...
@@ -93,6 +94,14 @@ where
#
io
=
io
<<<
"Could not lock memory ("
<<<
err
<<<
"); process may get swapped out
\n
"
=
snd
$
fclose
io
w
eval_all_nodes
::
!.
a
->
.
a
// From GraphCopy
eval_all_nodes
g
=
code {
push_a
0
.d
1
0
jsr
_eval_to_nf
.o
0
0
}
handle
::
!
CloogleDB
!(
Maybe
Request
)
!*
World
->
*(!
Response
,
CacheKey
,
!*
World
)
handle
db
Nothing
w
=
(
err
InvalidInput
"Couldn't parse input"
,
""
,
w
)
handle
db
(
Just
request
=:{
unify
,
name
,
page
})
w
...
...
backend/builddb.icl
View file @
5835547a
...
...
@@ -18,8 +18,8 @@ from Text import class Text(concat,startsWith), instance Text String
import
CloogleDB
import
Type
from
CloogleDBFactory
import
findModules
,
getModuleTypes
,
constructor_functions
,
record_functions
from
CloogleDBFactory
import
::
TemporaryDB
,
newTemporaryDb
,
finaliseDb
,
findModules
,
indexModule
,
constructor_functions
,
record_functions
::
CLI
=
{
help
::
Bool
,
version
::
Bool
...
...
@@ -85,7 +85,8 @@ Start w
|
cli
.
version
=
fclose
(
f
<<<
VERSION
)
w
#
(
modss
,
w
)
=
mapSt
(
flip
(
uncurry
$
findModules
cli
.
exclude
cli
.
root
)
""
)
cli
.
libs
w
#
mods
=
flatten
modss
#!
(
db
,
w
)
=
loop
cli
.
root
mods
newDb
w
#!
(
db
,
w
)
=
loop
cli
.
root
mods
newTemporaryDb
w
#!
db
=
finaliseDb
db
newDb
#!
db
=
putFunctions
predefFunctions
db
#!
db
=
putClasses
predefClasses
db
#!
db
=
putTypes
predefTypes
db
...
...
@@ -98,13 +99,22 @@ Start w
|
not
ok
=
abort
"Couldn't close stdio"
=
w
where
loop
::
String
[(
String
,
String
,
Bool
)]
!
Cloogle
DB
!*
World
->
*(!
Cloogle
DB
,
!*
World
)
loop
::
String
[(
String
,
String
,
Bool
)]
!
Temporary
DB
!*
World
->
*(!
Temporary
DB
,
!*
World
)
loop
_
[]
db
w
=
(
db
,
w
)
loop
root
[(
lib
,
mod
,
iscore
):
list
]
db
w
#!
w
=
snd
(
fclose
(
stderr
<<<
lib
<<<
": "
<<<
mod
<<<
"
\n
"
)
w
)
#!
(
db
,
w
)
=
getModuleTypes
root
mod
lib
iscore
db
w
#!
(
db
,
w
)
=
indexModule
root
mod
lib
iscore
db
w
#!
db
=
eval_all_nodes
db
=
loop
root
list
db
w
eval_all_nodes
::
!.
a
->
.
a
// From GraphCopy
eval_all_nodes
g
=
code {
push_a
0
.d
1
0
jsr
_eval_to_nf
.o
0
0
}
parseCLI
::
[
String
]
->
Either
String
CLI
parseCLI
[]
=
Right
zero
parseCLI
[
x
:
a
]
=
case
(
x
,
a
)
of
...
...
@@ -123,17 +133,15 @@ where
<<<
"| Functions | "
<<<
funs
<<<
" |
\n
"
<<<
"| Types | "
<<<
types
<<<
" |
\n
"
<<<
"| Classes | "
<<<
classes
<<<
" |
\n
"
<<<
"| Instances | "
<<<
insts
<<<
" |
\n
"
<<<
"| Derivations | "
<<<
derives
<<<
" |
\n
"
<<<
"+-------------+-------+
\n
"
where
[
modules
,
funs
,
types
,
classes
,
insts
,
derives
:_]
[
modules
,
funs
,
types
,
classes
,
derives
:_]
=
map
(
pad
5
)
[
moduleCount
db
,
functionCount
db
,
typeCount
db
,
classCount
db
,
instanceCount
db
,
deriveCount
db
]
pad
n
i
=
{
' '
\\
_
<-
[
0
..
n
-
size
(
toString
i
)
-1
]}
+++
toString
i
...
...
@@ -155,6 +163,7 @@ predefClasses
,
ce_context
=[]
,
ce_documentation
=
Nothing
,
ce_members
=[]
,
ce_instances
=[]
}
)
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment