Github user pwendell commented on a diff in the pull request:
https://github.com/apache/spark/pull/3328#discussion_r20825542
--- Diff: core/src/main/resources/org/apache/spark/ui/static/table.js ---
@@ -15,16 +15,18 @@
* limitations under the License.
*/
-/* Adds background colors to stripe table rows. This is necessary (instead
of using css or the
- * table striping provided by bootstrap) to appropriately stripe tables
with hidden rows. */
-function stripeTables() {
- $("table.table-striped-custom").each(function() {
- $(this).find("tr:not(:hidden)").each(function (index) {
- if (index % 2 == 1) {
- $(this).css("background-color", "#f9f9f9");
- } else {
- $(this).css("background-color", "#ffffff");
- }
- });
+/* Adds background colors to stripe table rows in the summary table (on
the stage page). This is
+ * necessary (instead of using css or the table striping provided by
bootstrap) because the summary
+ * table has hidden rows.
+ *
+ * An ID selector (rather than a class selector) is used to ensure this
runs quickly even on pages
+ * with thousands of task rows (ID selectors are much faster than class
selectors). */
+function stripeSummaryTable() {
+ $("#task-summary-table").find("tr:not(:hidden)").each(function (index)
{
--- End diff --
just wondering - is using this selector more expensive than just traversing
child elements and checking manually for each one (and then maintaining your
own counter)? It seems like interpreting this string could be expensive inside
of javascript.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]