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

Query Data from the HTTP Archive and GitHub Archive #4

Open
jridgewell opened this issue Oct 28, 2019 · 4 comments
Open

Query Data from the HTTP Archive and GitHub Archive #4

jridgewell opened this issue Oct 28, 2019 · 4 comments

Comments

@jridgewell
Copy link
Member

jridgewell commented Oct 28, 2019

Underscore Function Count Percentage vs filter
_.filter 427,420
_.select 8,743 2%
_.reject 64,018 15%
_.partition 7,013 1.6%

Using the following query format:

SELECT
  COUNT(*)
FROM
  `httparchive.response_bodies.2019_10_01_desktop`
WHERE
  REGEXP_CONTAINS(body, r"_\.filter\(")
@jridgewell
Copy link
Member Author

jridgewell commented Oct 28, 2019

Query data from 2016-01-01 (when underscore/lodash were more popular):

Underscore Function Count Percentage vs filter
_.filter 8,764
_.select 576 6.5%
_.reject 1,858 21%
_.partition 137 1.6%

@hax
Copy link
Member

hax commented Oct 30, 2019

It seems _.select has been removed in the recent version of lodash?

@jridgewell
Copy link
Member Author

Right, v4.0.0 removed all aliases.

@jridgewell
Copy link
Member Author

jridgewell commented Dec 6, 2019

Querying github archive for ruby files (which has select, reject, filter, and partition as first class methods):

Ruby Function Count Relative percentage
filter 10475 4.8%
select 141987 65.5%
reject 59052 27.2%
partition 5414 2.5%
SELECT
  COUNT(*)
FROM
  `bigquery-public-data.github_repos.contents`
WHERE
  NOT binary
  AND REGEXP_CONTAINS(content, r"\.reject\b")
  AND id IN (
    SELECT id FROM `bigquery-public-data.github_repos.files`
    WHERE ENDS_WITH(path, '.rb')
  )

@jridgewell jridgewell changed the title Query Data from the HTTP Archive Query Data from the HTTP Archive and GitHub Archive Dec 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants