Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
198
Issues
198
List
Board
Labels
Milestones
Merge Requests
12
Merge Requests
12
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
haskell-gargantext
Commits
8e2c2351
Verified
Commit
8e2c2351
authored
Aug 29, 2025
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[phylo] performance boost when there's lots of periods
parent
aeb97dc2
Pipeline
#7844
passed with stages
in 47 minutes and 36 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
PhyloMaker.hs
src/Gargantext/Core/Viz/Phylo/PhyloMaker.hs
+10
-3
No files found.
src/Gargantext/Core/Viz/Phylo/PhyloMaker.hs
View file @
8e2c2351
...
...
@@ -385,7 +385,14 @@ toSeriesOfClusteringFis phylo phyloDocs = fromList $ parMap rpar (func (corpusPa
toSeriesOfClusteringMaxClique
::
Phylo
->
Map
(
Date
,
Date
)
[
Document
]
->
(
Double
,
MaxCliqueFilter
)
->
Map
(
Date
,
Date
)
[
Clustering
]
toSeriesOfClusteringMaxClique
phylo
phyloDocs
(
thr
,
filterType
)
=
fromList
mcl
where
mcl
=
parMap
rpar
(
\
(
prd
,
docs
)
->
-- This looks innocent but is a big performance
-- improvement. Suppose there are few docs but many periods (like
-- when one computes phylo with second or minute
-- resolution). Without pattern matching on empty docs (many
-- periods will have no docs associated), one will fire
-- `getMaxCliques` with all the Accelerate machinery.
mapFunc
(
prd
,
[]
)
=
(
prd
,
[]
)
mapFunc
(
prd
,
docs
)
=
let
cooc
=
map
round
$
foldl
sumCooc
empty
$
map
(
\
d
->
listToMatrix
$
ngramsToIdx
(
text
d
)
(
getRoots
phylo
))
docs
...
...
@@ -395,8 +402,8 @@ toSeriesOfClusteringMaxClique phylo phyloDocs (thr, filterType) = fromList mcl
,
_clustering_period
=
prd
,
_clustering_visWeighting
=
Nothing
,
_clustering_visFiltering
=
[]
})
$
getMaxCliques
filterType
Conditional
thr
cooc
)
)
$
toList
phyloDocs
$
getMaxCliques
filterType
Conditional
thr
cooc
)
mcl
=
parMap
rpar
mapFunc
$
toList
phyloDocs
--------------------------------------
-- dev viz graph maxClique getMaxClique
...
...
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