Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[benchmarks] Fix edit and "after edit" experiments #2122

Merged
merged 1 commit into from Aug 22, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 9 additions & 6 deletions ghcide/bench/lib/Experiments.hs
Expand Up @@ -74,10 +74,10 @@ experiments =
isJust <$> getHover doc (fromJust identifierP),
---------------------------------------------------------------------------------------
bench "edit" $ \docs -> do
forM_ docs $ \DocumentPositions{..} ->
forM_ docs $ \DocumentPositions{..} -> do
changeDoc doc [charEdit stringLiteralP]
-- wait for a fresh build start
waitForProgressStart
-- wait for a fresh build start
waitForProgressStart
-- wait for the build to be finished
waitForProgressDone
return True,
Expand Down Expand Up @@ -121,8 +121,9 @@ experiments =
( \docs -> do
unless (any (isJust . identifierP) docs) $
error "None of the example modules is suitable for this experiment"
forM_ docs $ \DocumentPositions{..} ->
forM_ docs $ \DocumentPositions{..} -> do
forM_ identifierP $ \p -> changeDoc doc [charEdit p]
waitForProgressStart
waitForProgressDone
)
( \docs -> not . null . catMaybes <$> forM docs (\DocumentPositions{..} ->
Expand All @@ -139,8 +140,9 @@ experiments =
forM_ identifierP $ \p -> changeDoc doc [charEdit p]
)
( \docs -> do
forM_ docs $ \DocumentPositions{..} ->
forM_ docs $ \DocumentPositions{..} -> do
changeDoc doc [charEdit stringLiteralP]
waitForProgressStart
waitForProgressDone
not . null . catMaybes <$> forM docs (\DocumentPositions{..} -> do
forM identifierP $ \p ->
Expand All @@ -160,8 +162,9 @@ experiments =
liftIO $ appendFile (fromJust $ uriToFilePath hieYamlUri) "##\n"
sendNotification SWorkspaceDidChangeWatchedFiles $ DidChangeWatchedFilesParams $
List [ FileEvent hieYamlUri FcChanged ]
forM_ docs $ \DocumentPositions{..} ->
forM_ docs $ \DocumentPositions{..} -> do
changeDoc doc [charEdit stringLiteralP]
waitForProgressStart
waitForProgressDone
not . null . catMaybes <$> forM docs (\DocumentPositions{..} -> do
forM identifierP $ \p ->
Expand Down