After a few months of using my Endpoints library to help solve myriad of problems in production, I've only had anecdotal evidence that it was a "way more" performant way of interacting with API endpoints, compared to more traditional method of using AppsScripts advanced services. So I decided to actually measure it.
In my domain, there are 26 google groups, a set for each grade in the school, where a set is one for students and one for parents. We have about 30 students per grade, which means membership of the each students group is about 30, but for the parents, it is twice that (as both parents are a member).
With two different code bases, I download all memberships of all these groups.
- The code that I test with the Endpoints library interacts with the membership list directory endpoint with
UrlFetchApp.fetchAllvia batch operations. The library can be found here.
- The code that I test with the advanced services
AdminDirectory.Members.listalso interacts with the memberships. It does it one by one, however.
Script needs admin directory v1, and corresponding permissions on the domain for the user (beyond this report).
Lower numbers are better.
Iteration 1 admindirectory completed in 4.673 seconds endpoints_lib completed in 0.441 seconds Iteration 2 admindirectory completed in 4.548 seconds endpoints_lib completed in 0.299 seconds Iteration 3 admindirectory completed in 4.609 seconds endpoints_lib completed in 0.293 seconds Iteration 4 admindirectory completed in 4.485 seconds endpoints_lib completed in 0.304 seconds Iteration 5 admindirectory completed in 4.353 seconds endpoints_lib completed in 0.29 seconds